WordPress at Your Fingertips
function is not described

WC_REST_Data_Controller::get_items() public WC 3.5.0

Return the list of data resources.

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

No Hooks.

Return

WP_Error|WP_REST_Response.

Usage

$WC_REST_Data_Controller = new WC_REST_Data_Controller();
$WC_REST_Data_Controller->get_items( $request );
$request(WP_REST_Request) (required)
Request data.

Changelog

Since 3.5.0 Introduced.

Code of WC_REST_Data_Controller::get_items() WC 5.7.1

public function get_items( $request ) {
	$data      = array();
	$resources = array(
		array(
			'slug'        => 'continents',
			'description' => __( 'List of supported continents, countries, and states.', 'woocommerce' ),
		),
		array(
			'slug'        => 'countries',
			'description' => __( 'List of supported states in a given country.', 'woocommerce' ),
		),
		array(
			'slug'        => 'currencies',
			'description' => __( 'List of supported currencies.', 'woocommerce' ),
		),
	);

	foreach ( $resources as $resource ) {
		$item   = $this->prepare_item_for_response( (object) $resource, $request );
		$data[] = $this->prepare_response_for_collection( $item );
	}

	return rest_ensure_response( $data );
}