WP_REST_Meta_Fields::default_additional_properties_to_false()protectedWP 5.3.0

Deprecated from version 5.6.0. It is no longer supported and can be removed in future releases. Use rest_default_additional_properties_to_false() instead.

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.

Method of the class: WP_REST_Meta_Fields{}

No Hooks.




// protected - for code of main (parent) or child class
$result = $this->default_additional_properties_to_false( $schema );
$schema(array) (required)
The schema array.


Since 5.3.0 Introduced.
Deprecated since 5.6.0 Use rest_default_additional_properties_to_false() instead.

WP_REST_Meta_Fields::default_additional_properties_to_false() code WP 6.1.1

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 );