WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\StoreApi\Schemas

AbstractSchema::force_schema_readonly() protected WC 1.0

Force all schema properties to be readonly.

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

No Hooks.

Return

Array. Updated schema.

Usage

// protected - for code of main (parent) or child class
$result = $this->force_schema_readonly( $properties );
$properties(array) (required)
Schema.

Code of AbstractSchema::force_schema_readonly() WC 5.6.0

protected function force_schema_readonly( $properties ) {
	return array_map(
		function( $property ) {
			$property['readonly'] = true;
			if ( isset( $property['items']['properties'] ) ) {
				$property['items']['properties'] = $this->force_schema_readonly( $property['items']['properties'] );
			}
			return $property;
		},
		$properties
	);
}