Bit of clean-up.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5415 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
627725be1a
commit
1e30a12eb5
|
@ -1490,21 +1490,24 @@ function smilies_init() {
|
|||
}
|
||||
|
||||
function wp_parse_args( $args, $defaults = '' ) {
|
||||
if ( is_array($args) ) :
|
||||
if ( is_array( $args ) ) {
|
||||
$r =& $args;
|
||||
else :
|
||||
} else {
|
||||
parse_str( $args, $r );
|
||||
if ( get_magic_quotes_gpc() )
|
||||
if ( get_magic_quotes_gpc() ) {
|
||||
$r = stripslashes_deep( $r );
|
||||
endif;
|
||||
|
||||
if ( is_array($defaults) ) :
|
||||
extract($defaults);
|
||||
extract($r);
|
||||
return compact(array_keys($defaults)); // only those options defined in $defaults
|
||||
else :
|
||||
}
|
||||
}
|
||||
|
||||
if ( is_array( $defaults ) ) {
|
||||
extract( $defaults );
|
||||
extract( $r );
|
||||
// Note: this only returns the variables that were in $defaults
|
||||
// to begin with. All other variables are discarded.
|
||||
return compact( array_keys( $defaults ) );
|
||||
} else {
|
||||
return $r;
|
||||
endif;
|
||||
}
|
||||
}
|
||||
|
||||
function wp_maybe_load_widgets() {
|
||||
|
|
Loading…
Reference in New Issue