Created
March 25, 2015 21:04
-
-
Save sirchrispy/63e700470e665acf04dc to your computer and use it in GitHub Desktop.
WP: Allow shortcodes everywhere
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Shortcode optimization | |
add_filter( 'the_content', 'do_shortcode' ); // Allow shortcodes inside of shortcodes | |
add_filter( 'comment_text', 'do_shortcode' ); // Allow shortcodes in comments | |
add_filter( 'comment_text', 'shortcode_unautop' ); // Prevent comment shortcodes from wrapping in <p>...</p> tags | |
add_filter( 'the_excerpt', 'do_shortcode' ); // Allow shortcodes in excerpts | |
add_filter( 'the_excerpt', 'shortcode_unautop' ); // Prevent excerpt shortcodes from wrapping in <p>...</p> tags | |
add_filter( 'widget_text', 'do_shortcode' ); // Allow shortcodes in widgets | |
add_filter( 'widget_text', 'shortcode_unautop' ); // Prevent shortcodes in widgets from wrapping in <p>...</p> tags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment