WP_REST_Template_Autosaves_Controller::prepare_links()
Prepares links for the request.
Метод класса: WP_REST_Template_Autosaves_Controller{}
Хуков нет.
Возвращает
Массив
. Links for the given post.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->prepare_links( $template );
- $template(WP_Block_Template) (обязательный)
- Template.
Список изменений
С версии 6.4.0 | Введена. |
Код WP_REST_Template_Autosaves_Controller::prepare_links() WP REST Template Autosaves Controller::prepare links WP 6.7.1
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; }