diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index caa8006497..2ccb953e2f 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -295,7 +295,7 @@ function shortcode_unautop( $pee ) { . '(' // 1: The shortcode . '\\[' // Opening bracket . "($tagregexp)" // 2: Shortcode name - . '\\b' // Word boundary + . '(?![\\w-])' // Word boundary // Unroll the loop: Inside the opening shortcode tag . '[^\\]\\/]*' // Not a closing bracket or forward slash . '(?:' diff --git a/wp-includes/shortcodes.php b/wp-includes/shortcodes.php index e1722f5236..2ed9c8af75 100644 --- a/wp-includes/shortcodes.php +++ b/wp-includes/shortcodes.php @@ -182,7 +182,7 @@ function get_shortcode_regex() { '\\[' // Opening bracket . '(\\[?)' // 1: Optional second opening bracket for escaping shortcodes: [[tag]] . "($tagregexp)" // 2: Shortcode name - . '\\b' // Word boundary + . '(?![\\w-])' // Word boundary . '(' // 3: Unroll the loop: Inside the opening shortcode tag . '[^\\]\\/]*' // Not a closing bracket or forward slash . '(?:'