WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\Domain\Services

ExtendRestApi::get_endpoint_data() public WC 1.0

Returns the registered endpoint data

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

No Hooks.

Return

Object. Returns an casted object with registered endpoint data.

Usage

$ExtendRestApi = new ExtendRestApi();
$ExtendRestApi->get_endpoint_data( $endpoint, $passed_args );
$endpoint(string) (required)
A valid identifier.
$passed_args(array)
Passed arguments from the Schema class.
Default: []

Code of ExtendRestApi::get_endpoint_data() WC 5.7.1

public function get_endpoint_data( $endpoint, array $passed_args = [] ) {
	$registered_data = [];
	if ( ! isset( $this->extend_data[ $endpoint ] ) ) {
		return (object) $registered_data;
	}
	foreach ( $this->extend_data[ $endpoint ] as $namespace => $callbacks ) {
		$data = [];

		try {
			$data = $callbacks['data_callback']( ...$passed_args );

			if ( ! is_array( $data ) ) {
				throw new Exception( '$data_callback must return an array.' );
			}
		} catch ( Throwable $e ) {
			$this->throw_exception( $e );
			continue;
		}

		$registered_data[ $namespace ] = $data;
	}
	return (object) $registered_data;
}