Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Marco Chiesi

    (@marcochiesi)

    Hi there,
    actually the behavior should not be the one you described, unless you made a custom call to do_shortcode in a function attached to the widget_text filter.
    The current order of operations is the following:

    1. apply filter widget_text
    2. translate (icl_t)
    3. do shortcode
    Thread Starter Emil

    (@qu1em)

    Thanks for the quick response!

    Sorry, you’re right. I misread your code. This is very strange. Maybe I have a plugin installed that filters widget_text to execute shortcodes. Will have a look.

    Thread Starter Emil

    (@qu1em)

    Yes indeed Canvas by WooThemes was the culprit. Such a bad theme framework in comparison to Genesis, honestly…

    Plugin Author Marco Chiesi

    (@marcochiesi)

    I think I could change the order in the plugin and put the widget_text filter as last thing. Or, better, I could run all the operations via different filter hooks with proper priorities, so anyone who needs to alter the behavior will not need to change plugin’s code. Can you tell me the priority used by Canvas? What do you think about such a solution?

    Thread Starter Emil

    (@qu1em)

    I definitely think using filter hooks with different priorities could be a very clean and good solution. I know a lot of other plugins/themes also does the same thing as Canvas. I’m trying to think about the repercussions changing this could have and I can’t really think of any. I’d say it’s a great idea 🙂 Canvas uses the default priority, 10.

    Thanks for the great support!

    Plugin Author Marco Chiesi

    (@marcochiesi)

    Ok, I will change this in next release. I would use the following priorities for the widget_text filter:

    5 – icl_t translation (called by BSTW)
    10 – default priority for external calls (i.e. Canvas)
    15 – do_shortcode (called by BSTW)

    This way everyone is free to change the behavior with custom code using remove_filter, etc.

    Thread Starter Emil

    (@qu1em)

    Thank you! Thats great!

    Plugin Author Marco Chiesi

    (@marcochiesi)

    For anyone reading this, please note that starting from version 2 of the plugin the above priorities changed. Look at the source code for details.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘run_shortcode() is applied before text filter’ is closed to new replies.