Title: WP_REST_Font_Families_Controller::prepare_font_face_links
Published: April 3, 2024
Last modified: August 20, 2026

---

# WP_REST_Font_Families_Controller::prepare_font_face_links( int $font_family_id ): array

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_rest_font_families_controller/prepare_font_face_links/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_rest_font_families_controller/prepare_font_face_links/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_rest_font_families_controller/prepare_font_face_links/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_rest_font_families_controller/prepare_font_face_links/?output_format=md#related)

Prepares child font face links for the request.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_rest_font_families_controller/prepare_font_face_links/?output_format=md#parameters)󠁿

 `$font_family_id`intrequired

Font family post ID.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_rest_font_families_controller/prepare_font_face_links/?output_format=md#return)󠁿

 array Links for the child font face posts.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_rest_font_families_controller/prepare_font_face_links/?output_format=md#source)󠁿

    ```php
    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;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php#L502)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php#L502-L512)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_rest_font_families_controller/prepare_font_face_links/?output_format=md#related)󠁿

| Uses | Description | 
| [WP_REST_Font_Families_Controller::get_font_face_ids()](https://developer.wordpress.org/reference/classes/wp_rest_font_families_controller/get_font_face_ids/)`wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php` |

Get the child font face post IDs.

  | 
| [rest_url()](https://developer.wordpress.org/reference/functions/rest_url/)`wp-includes/rest-api.php` |

Retrieves the URL to a REST endpoint.

  |

| Used by | Description | 
| [WP_REST_Font_Families_Controller::prepare_links()](https://developer.wordpress.org/reference/classes/wp_rest_font_families_controller/prepare_links/)`wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php` |

Prepares font family links for the request.

  |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_rest_font_families_controller%2Fprepare_font_face_links%2F)
before being able to contribute a note or feedback.