Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor gjanes

    (@gjanes)

    This is an interesting concept, and I could see the benefit. Although looking at the example code provided in that artcile, it appears to me that the shortcode isn’t actually being processed by wordpress, but instead the JS plugin for tinymce is processessing it.

    Now, I already have some functionality in place to use an ajax request to process the shortcode and return it (for the option to return HTML instead of shortcode), so I could probably utilize that in a tinymce plugin of some kind.

    But again it may be a matter of how much time it would take to implement, and also if it would have the desired outcome. I would be afraid that if I parsed the shortcode for the tinymce view, that if you did an update it would actually replace the shortcode in the post with the HTML… I’m not certain I know exactly how this would work, or how the built-in [caption] processing for tinymce works, as mentioned in that article.

    Anyone else have any experience doing something like this?

    Plugin Contributor gjanes

    (@gjanes)

    From the comments in that article you shared, it appears as though the “wpgallery” tinymce plugin performs such a task, and basically it appears to:

    1) before displaying the content in the visual editor, it calls a JS function that processes content to switch the [gallery ...] shortcode into the HTML img tags, etc.
    2) before saving the content on an “update”, it calls a JS function that processes the editor content and returns the HTML back to the shortcode format.

    So the real problem with that is the time it would take to do step #2. I could use ajax to have wordpress handle #1 fairly easily I would think. But reversing #1 back to shortcodes for #2 would be the tricky part.

    It’s actually a shame that there isn’t a plugin for wordpress that does this already, since this type of operation would be generic for any and all wordpress shortcodes.

    Don’t know that such a thing would be feasible for this plugin alone given the amount of time I allocate to development on it.

    Thread Starter markusk

    (@markusk)

    yes.. instantly been looking for a plugin doing this myself, but it indeed seems there isn’t any..

    i would love to help out, but as mentioned – i can’t code myself. i can read code and hack around a bit, but just can’t write a single line from scratch..

    anyways, it’s great you got it updated that far, let’s hope someone able to might give it some more pimping at some point..

    thanks,
    markus.

    Thread Starter markusk

    (@markusk)

    actually i mainly miss the visual presentation for single images inserted via shortcode now – or rather less myself than people like my girlfriend doing the content for our swimming-team’s homepage. didn’t realize that using such thing like the above also would render whole galleries of course.. mh.

    i know i could still switch back to the html-injection, but i’d much prefer going the futureproof way using the shortcode.

    but well, maybe someone comes up with an idea one day.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘execute shortcode in tinymce?’ is closed to new replies.