WP_REST_Template_Revisions_Controller::prepare_links
Prepares links for the request.
Метод класса: WP_REST_Template_Revisions_Controller{}
Хуков нет.
Возвращает
Массив. Links for the given post.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->prepare_links( $template );
- $template(WP_Block_Template) (обязательный)
- Template.
Список изменений
| С версии 6.4.0 | Введена. |
Код WP_REST_Template_Revisions_Controller::prepare_links() WP REST Template Revisions Controller::prepare links WP 6.9
protected function prepare_links( $template ) {
$links = array(
'self' => array(
'href' => rest_url( sprintf( '/%s/%s/%s/%s/%d', $this->namespace, $this->parent_base, $template->id, $this->rest_base, $template->wp_id ) ),
),
'parent' => array(
'href' => rest_url( sprintf( '/%s/%s/%s', $this->namespace, $this->parent_base, $template->id ) ),
),
);
return $links;
}