-
-
Save alexmustin/ebc5a1621c5636ade611d916c659997a 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