[wp-trac] [WordPress Trac] #22400: Remove all, or at least most, uses of extract() within WordPress
WordPress Trac
noreply at wordpress.org
Fri Nov 9 23:13:57 UTC 2012
#22400: Remove all, or at least most, uses of extract() within WordPress
--------------------------+------------------------------
Reporter: Viper007Bond | Owner:
Type: enhancement | Status: new
Priority: lowest | Milestone: Awaiting Review
Component: General | Version: 3.4.2
Severity: minor | Resolution:
Keywords: |
--------------------------+------------------------------
Changes (by scribu):
* keywords: needs-patch =>
* milestone: Future Release => Awaiting Review
Comment:
The overwhelming scenario where extract() is used in WP is this:
{{{
function some_function( $args = array() ) {
$defaults = array(
'foo' => 'bar',
...
);
$args = wp_parse_args( $args, $defaults );
extract( $args, EXTR_SKIP );
...
}
}}}
As long as the `$defaults` array contains all the variables that will be
used further down, I don't think it's a problem.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22400#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list