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