diff --git a/wp-includes/shortcodes.php b/wp-includes/shortcodes.php index 0b2b7327ff..15f8561d5b 100644 --- a/wp-includes/shortcodes.php +++ b/wp-includes/shortcodes.php @@ -155,6 +155,10 @@ function shortcode_exists( $tag ) { * @return boolean */ function has_shortcode( $content, $tag ) { + if ( false === strpos( $content, '[' ) ) { + return false; + } + if ( shortcode_exists( $tag ) ) { preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER ); if ( empty( $matches ) ) @@ -186,6 +190,10 @@ function has_shortcode( $content, $tag ) { function do_shortcode($content) { global $shortcode_tags; + if ( false === strpos( $content, '[' ) ) { + return $content; + } + if (empty($shortcode_tags) || !is_array($shortcode_tags)) return $content; @@ -375,6 +383,10 @@ function shortcode_atts( $pairs, $atts, $shortcode = '' ) { function strip_shortcodes( $content ) { global $shortcode_tags; + if ( false === strpos( $content, '[' ) ) { + return $content; + } + if (empty($shortcode_tags) || !is_array($shortcode_tags)) return $content;