X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/0461a5f2e55c8d5f1fde96ca2e83117152573c7d..refs/tags/wordpress-4.0:/wp-includes/shortcodes.php diff --git a/wp-includes/shortcodes.php b/wp-includes/shortcodes.php index 15f8561d..55e64a18 100644 --- a/wp-includes/shortcodes.php +++ b/wp-includes/shortcodes.php @@ -65,12 +65,12 @@ $shortcode_tags = array(); * * // [bartag foo="bar"] * function bartag_func($atts) { - * extract(shortcode_atts(array( + * $args = shortcode_atts(array( * 'foo' => 'no foo', * 'baz' => 'default baz', - * ), $atts)); + * ), $atts); * - * return "foo = {$foo}"; + * return "foo = {$args['foo']}"; * } * add_shortcode('bartag', 'bartag_func'); * @@ -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 ( ! empty( $shortcode[5] ) && has_shortcode( $shortcode[5], $tag ) ) { + return true; + } } } return false;