WP_REST_Widget_Types_Controller::prepare_links
Prepares links for the widget type.
Метод класса: WP_REST_Widget_Types_Controller{}
Хуков нет.
Возвращает
array. Links for the given widget type.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->prepare_links( $widget_type );
- $widget_type(массив) (обязательный)
- Widget type data.
Список изменений
| С версии 5.8.0 | Введена. |
Код WP_REST_Widget_Types_Controller::prepare_links() WP REST Widget Types Controller::prepare links WP 7.1.2
protected function prepare_links( $widget_type ) {
return array(
'collection' => array(
'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ),
),
'self' => array(
'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, $widget_type['id'] ) ),
),
);
}