WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\Domain\Services

ExtendRestApi::format_extensions_properties() private WC 1.0

Format schema for an extension.

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

No Hooks.

Return

Array. Formatted schema.

Usage

// private - for code of main (parent) class only
$result = $this->format_extensions_properties( $namespace, $schema, $data_type );
$namespace(string) (required)
Error message or Exception.
$schema(array) (required)
An error to throw if we have debug enabled and user is admin.
$data_type(string) (required)
How should data be shaped.

Code of ExtendRestApi::format_extensions_properties() WC 5.6.0

private function format_extensions_properties( $namespace, $schema, $data_type ) {
	if ( ARRAY_N === $data_type ) {
		return [
			/* translators: %s: extension namespace */
			'description' => sprintf( __( 'Extension data registered by %s', 'woocommerce' ), $namespace ),
			'type'        => [ 'array', 'null' ],
			'context'     => [ 'view', 'edit' ],
			'readonly'    => true,
			'items'       => $schema,
		];
	}
	return [
		/* translators: %s: extension namespace */
		'description' => sprintf( __( 'Extension data registered by %s', 'woocommerce' ), $namespace ),
		'type'        => [ 'object', 'null' ],
		'context'     => [ 'view', 'edit' ],
		'readonly'    => true,
		'properties'  => $schema,
	];
}