AbstractSchema::force_schema_readonly() – Force all schema properties to be readonly.

You appear to be a bot. Output may be restricted

Description

Force all schema properties to be readonly.

Usage

$array = AbstractSchema::force_schema_readonly( $properties );

Parameters

$properties
( array ) required – Schema.

Returns

array Updated schema.

Source

File name: woocommerce/packages/woocommerce-blocks/src/StoreApi/Schemas/AbstractSchema.php


Lines:

1 to 13 of 13
  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;
      },
      (array) $properties
    );
  }
 

 View on GitHub View on Trac