mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-23 00:31:28 +01:00
REST API: Don't assume all item schemas have properties.
All schema types, not just objects, are permitted as the base type of a resource. A future patch could add validation support for those types, but this fix only prevents a PHP warning from being issued. Props dhavalkasvala, johnwatkins0, birgire. Fixes #48785. Built from https://develop.svn.wordpress.org/trunk@47328 git-svn-id: http://core.svn.wordpress.org/trunk@47122 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a5cfb704bd
commit
5031baa32b
@ -344,9 +344,11 @@ abstract class WP_REST_Controller {
|
|||||||
|
|
||||||
$schema = $this->get_item_schema();
|
$schema = $this->get_item_schema();
|
||||||
|
|
||||||
|
if ( ! empty( $schema['properties'] ) ) {
|
||||||
foreach ( $schema['properties'] as &$property ) {
|
foreach ( $schema['properties'] as &$property ) {
|
||||||
unset( $property['arg_options'] );
|
unset( $property['arg_options'] );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $schema;
|
return $schema;
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.4-beta2-47327';
|
$wp_version = '5.4-beta2-47328';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user