mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Use wp_parse_args(). fixes #4237
git-svn-id: https://develop.svn.wordpress.org/trunk@5444 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -687,16 +687,14 @@ class WP_Ajax_Response {
|
||||
|
||||
// a WP_Error object can be passed in 'id' or 'data'
|
||||
function add( $args = '' ) {
|
||||
if ( is_array($args) )
|
||||
$r = &$args;
|
||||
else
|
||||
parse_str($args, $r);
|
||||
|
||||
$defaults = array('what' => 'object', 'action' => false, 'id' => '0', 'old_id' => false,
|
||||
'data' => '', 'supplemental' => array());
|
||||
|
||||
$r = array_merge($defaults, $r);
|
||||
extract($r);
|
||||
$defaults = array(
|
||||
'what' => 'object', 'action' => false,
|
||||
'id' => '0', 'old_id' => false,
|
||||
'data' => '', 'supplemental' => array()
|
||||
);
|
||||
|
||||
$r = wp_parse_args( $args, $defaults );
|
||||
extract( $r );
|
||||
|
||||
if ( is_wp_error($id) ) {
|
||||
$data = $id;
|
||||
|
||||
Reference in New Issue
Block a user