Make WordPress Core


Ignore:
Timestamp:
07/16/2014 10:04:08 PM (10 years ago)
Author:
wonderboymusic
Message:

Make has_shortcode() recursive/work for nested shortcodes.

Adds unit test.

Props katzwebdesign.
Fixes #26343.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/shortcodes.php

    r28413 r29197  
    166166
    167167        foreach ( $matches as $shortcode ) {
    168             if ( $tag === $shortcode[2] )
     168            if ( $tag === $shortcode[2] ) {
    169169                return true;
     170            } elseif ( isset( $shortcode[5] ) && has_shortcode( $shortcode[5], $tag ) ) {
     171                return has_shortcode( $shortcode[5], $tag );
     172            }
    170173        }
    171174    }
Note: See TracChangeset for help on using the changeset viewer.