mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Make has_shortcode()
recursive/work for nested shortcodes.
Adds unit test. Props katzwebdesign. Fixes #26343. Built from https://develop.svn.wordpress.org/trunk@29197 git-svn-id: http://core.svn.wordpress.org/trunk@28981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
cf3deb2ecb
commit
1292ee0151
@ -165,8 +165,11 @@ function has_shortcode( $content, $tag ) {
|
||||
return false;
|
||||
|
||||
foreach ( $matches as $shortcode ) {
|
||||
if ( $tag === $shortcode[2] )
|
||||
if ( $tag === $shortcode[2] ) {
|
||||
return true;
|
||||
} elseif ( isset( $shortcode[5] ) && has_shortcode( $shortcode[5], $tag ) ) {
|
||||
return has_shortcode( $shortcode[5], $tag );
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user