WP_REST_Font_Families_Controller::prepare_font_face_links
Prepares child font face links for the request.
Method of the class: WP_REST_Font_Families_Controller{}
No Hooks.
Returns
Array. Links for the child font face posts.
Usage
// protected - for code of main (parent) or child class $result = $this->prepare_font_face_links( $font_family_id );
- $font_family_id(int) (required)
- Font family post ID.
WP_REST_Font_Families_Controller::prepare_font_face_links() WP REST Font Families Controller::prepare font face links code WP 7.0
protected function prepare_font_face_links( $font_family_id ) {
$font_face_ids = $this->get_font_face_ids( $font_family_id );
$links = array();
foreach ( $font_face_ids as $font_face_id ) {
$links[] = array(
'embeddable' => true,
'href' => rest_url( sprintf( '%s/%s/%s/font-faces/%s', $this->namespace, $this->rest_base, $font_family_id, $font_face_id ) ),
);
}
return $links;
}