Update the inline docs for add_shortcode()
to eliminate suggestion to use extract()
.
See #22400. git-svn-id: https://develop.svn.wordpress.org/trunk@28413 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
9d873771b7
commit
e9f929443f
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user