Make WordPress Core


Ignore:
Timestamp:
01/12/2019 03:19:23 AM (5 years ago)
Author:
pento
Message:

Coding Standards: Extract extract() from the codebase.

Of the last four instances of extract() occurring, three of them are removed by this commit, and the fourth is appropriately documented.

See #45934.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/shortcode.php

    r44136 r44569  
    4444    // [bartag foo="bar"]
    4545    function _shortcode_bartag( $atts ) {
    46         extract(
    47             shortcode_atts(
    48                 array(
    49                     'foo' => 'no foo',
    50                     'baz' => 'default baz',
    51                 ),
    52                 $atts,
    53                 'bartag'
    54             )
    55         );
    56 
    57         return "foo = {$foo}";
     46        $processed_atts = shortcode_atts(
     47            array(
     48                'foo' => 'no foo',
     49                'baz' => 'default baz',
     50            ),
     51            $atts,
     52            'bartag'
     53        );
     54
     55        return "foo = {$processed_atts['foo']}";
    5856    }
    5957
Note: See TracChangeset for help on using the changeset viewer.