mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-09 23:24:34 +00:00
Make has_shortcode() recursive/work for nested shortcodes.
Adds unit test. Props katzwebdesign. Fixes #26343. git-svn-id: https://develop.svn.wordpress.org/trunk@29197 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -394,4 +394,17 @@ EOF;
|
||||
$this->assertEquals( $output, shortcode_unautop( $in ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 26343
|
||||
*/
|
||||
function test_has_shortcode() {
|
||||
$content = 'This is a blob with [gallery] in it';
|
||||
$this->assertTrue( has_shortcode( $content, 'gallery' ) );
|
||||
|
||||
add_shortcode( 'foo', '__return_false' );
|
||||
$content_nested = 'This is a blob with [foo] [gallery] [/foo] in it';
|
||||
$this->assertTrue( has_shortcode( $content_nested, 'gallery' ) );
|
||||
remove_shortcode( 'foo' );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user