WP_REST_Template_Revisions_Controller::prepare_links
Prepares links for the request.
Method of the class: WP_REST_Template_Revisions_Controller{}
No Hooks.
Returns
Array. Links for the given post.
Usage
// protected - for code of main (parent) or child class $result = $this->prepare_links( $template );
- $template(WP_Block_Template) (required)
- Template.
Changelog
| Since 6.4.0 | Introduced. |
WP_REST_Template_Revisions_Controller::prepare_links() WP REST Template Revisions Controller::prepare links code WP 6.9.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;
}