WP_REST_Settings_Controller::set_additional_properties_to_false( array $schema ): array

This method has been deprecated. Use {@see rest_default_additional_properties_to_false()} instead.

Recursively add additionalProperties = false to all objects in a schema if no additionalProperties setting is specified.

Description

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.

Parameters

$schemaarrayrequired
The schema array.

Return

array

Source

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

Changelog

VersionDescription
6.1.0Use rest_default_additional_properties_to_false() instead.
4.9.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.