Skip to content

Instantly share code, notes, and snippets.

@jentanbernardus
Created April 17, 2014 04:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jentanbernardus/10953411 to your computer and use it in GitHub Desktop.
Save jentanbernardus/10953411 to your computer and use it in GitHub Desktop.
Quick WordPress Tip: Enabling shortcodes in widgets. Source: https://dannyvankooten.com/630/enabling-shortcodes-in-widgets-quick-wordpress-tip/
<!-- To ensure that the output of our shortcode callback is not wrapped in paragraph tags, it is best to run one more function on the widget text, ‘shortcode_unautop‘. -->
add_filter( 'widget_text', 'shortcode_unautop');
add_filter( 'widget_text', 'do_shortcode', 11);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment