WP_REST_Font_Faces_Controller::prepare_links
Prepares links for the request.
Method of the class: WP_REST_Font_Faces_Controller{}
No Hooks.
Returns
Array. Links for the given post.
Usage
// protected - for code of main (parent) or child class $result = $this->prepare_links( $post );
- $post(WP_Post) (required)
- Post object.
Changelog
| Since 6.5.0 | Introduced. |
WP_REST_Font_Faces_Controller::prepare_links() WP REST Font Faces Controller::prepare links code WP 7.0
protected function prepare_links( $post ) {
// Entity meta.
return array(
'self' => array(
'href' => rest_url( $this->namespace . '/font-families/' . $post->post_parent . '/font-faces/' . $post->ID ),
),
'collection' => array(
'href' => rest_url( $this->namespace . '/font-families/' . $post->post_parent . '/font-faces' ),
),
'parent' => array(
'href' => rest_url( $this->namespace . '/font-families/' . $post->post_parent ),
),
);
}