WP_REST_Widget_Types_Controller::get_items()
Retrieves the list of all widget types.
Метод класса: WP_REST_Widget_Types_Controller{}
Хуков нет.
Возвращает
WP_REST_Response|WP_Error
. Response object on success, or WP_Error object on failure.
Использование
$WP_REST_Widget_Types_Controller = new WP_REST_Widget_Types_Controller(); $WP_REST_Widget_Types_Controller->get_items( $request );
- $request(WP_REST_Request) (обязательный)
- Full details about the request.
Список изменений
С версии 5.8.0 | Введена. |
Код WP_REST_Widget_Types_Controller::get_items() WP REST Widget Types Controller::get items WP 6.6.1
public function get_items( $request ) { $data = array(); foreach ( $this->get_widgets() as $widget ) { $widget_type = $this->prepare_item_for_response( $widget, $request ); $data[] = $this->prepare_response_for_collection( $widget_type ); } return rest_ensure_response( $data ); }