]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/shortcodes.php
WordPress 4.0
[autoinstalls/wordpress.git] / wp-includes / shortcodes.php
index 15f8561d5b11d0a6d6bfac29a209407f7647c72a..55e64a1863f9f9891b42595b2c7bc02cb76ae8d4 100644 (file)
@@ -65,12 +65,12 @@ $shortcode_tags = array();
  * <code>
  * // [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');
  * </code>
@@ -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;