From 24a69e160205a620857d37895bc11166c05b926c Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 5 Nov 2012 22:27:36 +0000 Subject: [PATCH] Allow hyphens in shortcode names. Props kovshenin, solarissmoke, aaroncampbell fixes #17657 git-svn-id: https://develop.svn.wordpress.org/trunk@22382 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/formatting.php | 2 +- wp-includes/shortcodes.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 . '(?:'