REST API: JavaScript client should use `_.extend` when merging objects.
Correct an issue during the client's dynamic route discovery in `wp.api.utils.decorateFromRoute` where `_.union` potentially failed if used on objects. Props ketuchetan, adamsilverstein. Merges [40040] to the 4.7 branch. Fixes #39341. Built from https://develop.svn.wordpress.org/branches/4.7@40084 git-svn-id: http://core.svn.wordpress.org/branches/4.7@40021 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5789e5f074
commit
cb22496f4c
|
@ -185,7 +185,7 @@
|
|||
} else {
|
||||
|
||||
// We already have args, merge these new args in.
|
||||
modelInstance.prototype.args = _.union( routeEndpoint.args, modelInstance.prototype.defaults );
|
||||
modelInstance.prototype.args = _.extend( modelInstance.prototype.args, routeEndpoint.args );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -202,7 +202,7 @@
|
|||
} else {
|
||||
|
||||
// We already have options, merge these new args in.
|
||||
modelInstance.prototype.options = _.union( routeEndpoint.args, modelInstance.prototype.options );
|
||||
modelInstance.prototype.options = _.extend( modelInstance.prototype.options, routeEndpoint.args );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.7.3-alpha-40083';
|
||||
$wp_version = '4.7.3-alpha-40084';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue