rest_prepare_wp_font_face
Filters the font face data for a REST API response.
Usage
add_filter( 'rest_prepare_wp_font_face', 'wp_kama_rest_prepare_wp_font_face_filter', 10, 3 ); /** * Function for `rest_prepare_wp_font_face` filter-hook. * * @param WP_REST_Response $response The response object. * @param WP_Post $post Font face post object. * @param WP_REST_Request $request Request object. * * @return WP_REST_Response */ function wp_kama_rest_prepare_wp_font_face_filter( $response, $post, $request ){ // filter... return $response; }
- $response(WP_REST_Response)
- The response object.
- $post(WP_Post)
- Font face post object.
- $request(WP_REST_Request)
- Request object.
Changelog
Since 6.5.0 | Introduced. |
Where the hook is called
rest_prepare_wp_font_face
wp-includes/rest-api/endpoints/class-wp-rest-font-faces-controller.php 483
return apply_filters( 'rest_prepare_wp_font_face', $response, $item, $request );