WC_REST_Data_Continents_Controller::get_items()
Return the list of states for all continents.
Метод класса: WC_REST_Data_Continents_Controller{}
Хуков нет.
Возвращает
WP_Error|WP_REST_Response
.
Использование
$WC_REST_Data_Continents_Controller = new WC_REST_Data_Continents_Controller(); $WC_REST_Data_Continents_Controller->get_items( $request );
- $request(WP_REST_Request) (обязательный)
- Request data.
Список изменений
С версии 3.5.0 | Введена. |
Код WC_REST_Data_Continents_Controller::get_items() WC REST Data Continents Controller::get items WC 7.7.0
public function get_items( $request ) { $continents = WC()->countries->get_continents(); $data = array(); foreach ( array_keys( $continents ) as $continent_code ) { $continent = $this->get_continent( $continent_code, $request ); $response = $this->prepare_item_for_response( $continent, $request ); $data[] = $this->prepare_response_for_collection( $response ); } return rest_ensure_response( $data ); }