Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm well aware that WordPress by default does not process shortcodes in the sidebar. My question is why.

I'm building a very small plugin that exports some content when the shortcode is present. This will be primarily used in the content area. I want to allow the user to display that content in the sidebar and I'm debating including the one line fix to enable the shortcodes rather than adding ~50 lines of code to create a widget.

Is there something going on under the hood that is a good reason to avoid the shortcode in the sidebar? Is it simply a convention?

share|improve this question

1 Answer 1

There are a few pitfalls, mainly with wpautop being applied after the shortcode filter, and multiple do_shortcode calls because of plugins that already added this filter to widget_text.

See the discussion in the following ticket: http://core.trac.wordpress.org/ticket/10457

share|improve this answer
    
this is awesome information! Thanks. –  BFTrick Oct 2 '12 at 13:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.