mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-18 04:25:07 +00:00
Update the inline docs for add_shortcode()
to eliminate suggestion to use extract()
.
See #22400. Built from https://develop.svn.wordpress.org/trunk@28413 git-svn-id: http://core.svn.wordpress.org/trunk@28240 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4b94efd93b
commit
947aa04900
@ -65,12 +65,12 @@ $shortcode_tags = array();
|
|||||||
* <code>
|
* <code>
|
||||||
* // [bartag foo="bar"]
|
* // [bartag foo="bar"]
|
||||||
* function bartag_func($atts) {
|
* function bartag_func($atts) {
|
||||||
* extract(shortcode_atts(array(
|
* $args = shortcode_atts(array(
|
||||||
* 'foo' => 'no foo',
|
* 'foo' => 'no foo',
|
||||||
* 'baz' => 'default baz',
|
* 'baz' => 'default baz',
|
||||||
* ), $atts));
|
* ), $atts);
|
||||||
*
|
*
|
||||||
* return "foo = {$foo}";
|
* return "foo = {$args['foo']}";
|
||||||
* }
|
* }
|
||||||
* add_shortcode('bartag', 'bartag_func');
|
* add_shortcode('bartag', 'bartag_func');
|
||||||
* </code>
|
* </code>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user