Created
February 21, 2023 17:24
-
-
Save cliffordp/48713847d9d22511737aa74b03a891d1 to your computer and use it in GitHub Desktop.
Enable 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
<?php | |
// https://gist.github.com/cliffordp/48713847d9d22511737aa74b03a891d1 This snippet. | |
// Site Title | |
add_filter( 'option_blogname', 'shortcode_unautop'); | |
add_filter( 'option_blogname', 'do_shortcode' ); | |
// Site Info when 'display' | |
add_filter( 'bloginfo', 'shortcode_unautop'); | |
add_filter( 'bloginfo', 'do_shortcode' ); | |
// Menus | |
add_filter( 'wp_nav_menu', 'shortcode_unautop'); | |
add_filter( 'wp_nav_menu', 'do_shortcode' ); | |
// Post Titles (including Search Results) | |
add_filter( 'the_title', 'shortcode_unautop' ); | |
add_filter( 'the_title', 'do_shortcode' ); | |
// Text Widgets | |
add_filter( 'widget_text', 'shortcode_unautop'); | |
add_filter( 'widget_text', 'do_shortcode'); | |
// Comments | |
add_filter( 'comment_text', 'shortcode_unautop'); | |
add_filter( 'comment_text', 'do_shortcode' ); | |
// Excerpts | |
add_filter( 'the_excerpt', 'shortcode_unautop'); | |
add_filter( 'the_excerpt', 'do_shortcode'); | |
// Category, Tag, and Taxonomy Descriptions | |
add_filter( 'term_description', 'shortcode_unautop'); | |
add_filter( 'term_description', 'do_shortcode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment