WordPress at a glance
function is not described

WP_REST_Meta_Fields::default_additional_properties_to_false() protected WP 5.3.0

Deprecated in 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.

{} It's a method of the class: WP_REST_Meta_Fields{}

No Hooks.

Return

Array.

Usage

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

Changelog

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

Code of WP_REST_Meta_Fields::default_additional_properties_to_false() WP 5.6

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