I seem to remember shortcodes used to work in HTML widgets, but now they dont? Is this a CP thing, or is this a WP thing? or am I simply misremembering?
They still work in both WP and CP. But, in either case, you need to ensure you have set the appropriate filter, namely:
add_filter( 'widget_text', 'do_shortcode' );
5 Likes
Just confirming that ClassicPress didn’t make any changes here. Thanks Tim for the code snippet.
2 Likes
I believe that code snip that Tim posted should cause shortcodes to work in any widget. Did you try it?
1 Like
I did not try it yet, I’ll do that then. I am always a bit hesitent to just add code to my functions till I know what exactly it does, haha.
1 Like
That is understandable. If you ever need to enable shortcodes in excerpts, there is a similar code snip you can use.
2 Likes
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.