Automattic\WooCommerce\StoreApi\Schemas\V1

AbstractSchema::get_extended_schema()protectedWC 1.0

Returns extended schema for a specific endpoint.

Method of the class: AbstractSchema{}

No Hooks.

Return

Array. the data that will get added.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_extended_schema( $endpoint, ...$passed_args );
$endpoint(string) (required)
The endpoint identifer.
...$passed_args(array) (required)
An array of arguments to be passed to callbacks.

AbstractSchema::get_extended_schema() code WC 8.7.0

protected function get_extended_schema( $endpoint, ...$passed_args ) {
	$extended_schema = $this->extend->get_endpoint_schema( $endpoint, $passed_args );
	$defaults        = $this->get_recursive_schema_property_defaults( $extended_schema );

	return [
		'type'        => 'object',
		'context'     => [ 'view', 'edit' ],
		'arg_options' => [
			'default'           => $defaults,
			'validate_callback' => $this->get_recursive_validate_callback( $extended_schema ),
			'sanitize_callback' => $this->get_recursive_sanitize_callback( $extended_schema ),
		],
		'properties'  => $extended_schema,
	];
}