Make WordPress Core


Ignore:
Timestamp:
05/15/2014 03:27:17 AM (10 years ago)
Author:
wonderboymusic
Message:

Update the inline docs for add_shortcode() to eliminate suggestion to use extract().

See #22400.

File:
1 edited

Legend:

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

    r27394 r28413  
    6666 * // [bartag foo="bar"]
    6767 * function bartag_func($atts) {
    68  *  extract(shortcode_atts(array(
     68 *  $args = shortcode_atts(array(
    6969 *      'foo' => 'no foo',
    7070 *      'baz' => 'default baz',
    71  *  ), $atts));
    72  *
    73  *  return "foo = {$foo}";
     71 *  ), $atts);
     72 *
     73 *  return "foo = {$args['foo']}";
    7474 * }
    7575 * add_shortcode('bartag', 'bartag_func');
Note: See TracChangeset for help on using the changeset viewer.