WordPress at Your Fingertips
function is not described

WC_REST_Product_Attributes_V1_Controller::get_items() public WC 1.0

Get all attributes.

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

No Hooks.

Return

Array.

Usage

$WC_REST_Product_Attributes_V1_Controller = new WC_REST_Product_Attributes_V1_Controller();
$WC_REST_Product_Attributes_V1_Controller->get_items( $request );
$request(WP_REST_Request) (required)
The request to get the attributes from.

Code of WC_REST_Product_Attributes_V1_Controller::get_items() WC 5.9.0

public function get_items( $request ) {
	$attributes = wc_get_attribute_taxonomies();
	$data       = array();
	foreach ( $attributes as $attribute_obj ) {
		$attribute = $this->prepare_item_for_response( $attribute_obj, $request );
		$attribute = $this->prepare_response_for_collection( $attribute );
		$data[]    = $attribute;
	}

	$response = rest_ensure_response( $data );

	// This API call always returns all product attributes due to retrieval from the object cache.
	$response->header( 'X-WP-Total', count( $data ) );
	$response->header( 'X-WP-TotalPages', 1 );

	return $response;
}