Filter hook 'rest_prepare_wp_font_family'

in WP Core File wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php at line 271

View Source

rest_prepare_wp_font_family

Filter Hook
Description
Filters the font family data for a REST API response.

Hook Information

File Location wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php View on GitHub
Hook Type Filter
Line Number 271

Hook Parameters

Type Name Description
WP_REST_Response $response The response object.
WP_Post $post Font family post object.
WP_REST_Request $request Request object.

Usage Examples

Basic Usage
<?php
// Hook into rest_prepare_wp_font_family
add_filter('rest_prepare_wp_font_family', 'my_custom_filter', 10, 3);

function my_custom_filter($response, $post, $request) {
    // Your custom filtering logic here
    return $response;
}

Source Code Context

wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php:271 - How this hook is used in WordPress core
<?php
 266  		 *
 267  		 * @param WP_REST_Response $response The response object.
 268  		 * @param WP_Post          $post     Font family post object.
 269  		 * @param WP_REST_Request  $request  Request object.
 270  		 */
 271  		return apply_filters( 'rest_prepare_wp_font_family', $response, $item, $request );
 272  	}
 273  
 274  	/**
 275  	 * Retrieves the post's schema, conforming to JSON Schema.
 276  	 *

PHP Documentation

<?php
/**
		 * Filters the font family data for a REST API response.
		 *
		 * @since 6.5.0
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param WP_Post          $post     Font family post object.
		 * @param WP_REST_Request  $request  Request object.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php
Related Hooks

Related hooks will be displayed here in future updates.