Give preference to null data-type over others

This commit is contained in:
vedanshujain 2020-08-13 14:17:48 +05:30
parent 9f680aa120
commit 5c0be2a715
1 changed files with 1 additions and 1 deletions

View File

@ -127,7 +127,7 @@ abstract class WC_REST_Controller extends WP_REST_Controller {
* WARNING: Order of fields here is important, types of fields are ordered from most specific to least specific as perceived by core's built-in type validation methods.
*/
if ( 'mixed' === $params['type'] ) {
$params['type'] = array( 'object', 'string', 'number', 'boolean', 'integer', 'array', 'null' );
$params['type'] = array( 'null', 'object', 'string', 'number', 'boolean', 'integer', 'array' );
}
if ( isset( $params['properties'] ) ) {