WordPress at Your Fingertips
function is not described

WC_REST_Data_Countries_Controller::get_items() public WC 3.5.0

Return the list of states for all countries.

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

No Hooks.

Return

WP_Error|WP_REST_Response.

Usage

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

Changelog

Since 3.5.0 Introduced.

Code of WC_REST_Data_Countries_Controller::get_items() WC 5.9.0

public function get_items( $request ) {
	$countries = WC()->countries->get_countries();
	$data      = array();

	foreach ( array_keys( $countries ) as $country_code ) {
		$country  = $this->get_country( $country_code, $request );
		$response = $this->prepare_item_for_response( $country, $request );
		$data[]   = $this->prepare_response_for_collection( $response );
	}

	return rest_ensure_response( $data );
}