WP_REST_Settings_Controller::set_additional_properties_to_false()protectedWP 4.9.0

Deprecated from version 6.1.0. It is no longer supported and can be removed in future releases. See {@see rest_default_additional_properties_to_false()}.

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 settings values to only registered items, as the REST API will allow additional properties by default.

Method of the class: WP_REST_Settings_Controller{}

No Hooks.

Return

Array.

Usage

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

Changelog

Since 4.9.0 Introduced.
Deprecated since 6.1.0 Use {@see rest_default_additional_properties_to_false()} instead.

WP_REST_Settings_Controller::set_additional_properties_to_false() code WP 6.5.2

protected function set_additional_properties_to_false( $schema ) {
	_deprecated_function( __METHOD__, '6.1.0', 'rest_default_additional_properties_to_false()' );

	return rest_default_additional_properties_to_false( $schema );
}