Recursively add additionalProperties = false to all objects in a schema if no additionalProperties setting is specified.
This is needed to restrict properties of objects in meta values to only registered items, as the REST API will allow additional properties by default.
$schemaarrayrequired
protected function default_additional_properties_to_false( $schema ) {
_deprecated_function( __METHOD__, '5.6.0', 'rest_default_additional_properties_to_false()' );
return rest_default_additional_properties_to_false( $schema );
}
| Version | Description |
|---|---|
| 5.6.0 | Use rest_default_additional_properties_to_false() instead. |
| 5.3.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_meta_fields/default_additional_properties_to_false