WP_REST_Settings_Controller::set_additional_properties_to_false

SummerySummery

Recursively add additionalProperties = false to all objects in a schema.

Syntax

WP_REST_Settings_Controller::set_additional_properties_to_false( array $schema )

DescriptionDescription

This is need to restrict properties of objects in settings values to only registered items, as the REST API will allow additional properties by default.

ParametersParameters

$schema

(array) (Required) The schema array.

ReturnReturn

(array)

SourceSource

File: wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php


			

ChangelogChangelog

Changelog
Version Description
4.9.0 Introduced.
Scroll to Top