Changeset 29197
- Timestamp:
- 07/16/2014 10:04:08 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/shortcodes.php
r28413 r29197 166 166 167 167 foreach ( $matches as $shortcode ) { 168 if ( $tag === $shortcode[2] ) 168 if ( $tag === $shortcode[2] ) { 169 169 return true; 170 } elseif ( isset( $shortcode[5] ) && has_shortcode( $shortcode[5], $tag ) ) { 171 return has_shortcode( $shortcode[5], $tag ); 172 } 170 173 } 171 174 } -
trunk/tests/phpunit/tests/shortcode.php
r28716 r29197 395 395 } 396 396 } 397 398 /** 399 * @ticket 26343 400 */ 401 function test_has_shortcode() { 402 $content = 'This is a blob with [gallery] in it'; 403 $this->assertTrue( has_shortcode( $content, 'gallery' ) ); 404 405 add_shortcode( 'foo', '__return_false' ); 406 $content_nested = 'This is a blob with [foo] [gallery] [/foo] in it'; 407 $this->assertTrue( has_shortcode( $content_nested, 'gallery' ) ); 408 remove_shortcode( 'foo' ); 409 } 397 410 }
Note: See TracChangeset
for help on using the changeset viewer.