Proper way to add_filter with shortcode
-
Greetings,
My plugin RSS Retriever, located here: https://www.ads-software.com/plugins/wp-rss-retriever/ is a simple shortcode plugin which fetchs and displays an RSS feed.
I’ve had a few requests to add support for using the shortcode inside a text widget. The following filter will do this:
add_filter( 'widget_text', 'do_shortcode' );
However, I’m not sure what would be the proper, or WordPress way, of doing this. Should I just add another attribute to the shortcode, something like “widget=true” or is there a more recommended way of doing this? I don’t want to clutter the shortcode with too many attributes…
Thanks for any help!
– Travis
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Proper way to add_filter with shortcode’ is closed to new replies.