WordPress at Your Fingertips
function is not described

WC_REST_Data_Countries_Controller::get_item() public WC 3.5.0

Return the list of states for a given country.

{} 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_item( $request );
$request(WP_REST_Request) (required)
Request data.

Changelog

Since 3.5.0 Introduced.

Code of WC_REST_Data_Countries_Controller::get_item() WC 5.9.0

public function get_item( $request ) {
	$data = $this->get_country( strtoupper( $request['location'] ), $request );
	if ( empty( $data ) ) {
		return new WP_Error( 'woocommerce_rest_data_invalid_location', __( 'There are no locations matching these parameters.', 'woocommerce' ), array( 'status' => 404 ) );
	}
	return $this->prepare_item_for_response( $data, $request );
}