wp_is_rest_endpoint
Filter HookDescription
Filters whether a REST endpoint request is currently being handled. This may be a standalone REST API request, or an internal request dispatched from within a regular page load.Hook Information
File Location |
wp-includes/rest-api.php
View on GitHub
|
Hook Type | Filter |
Line Number | 3480 |
Hook Parameters
Type | Name | Description |
---|---|---|
bool
|
$is_request_endpoint
|
Whether a REST endpoint request is currently being handled. |
Usage Examples
Basic Usage
<?php
// Hook into wp_is_rest_endpoint
add_filter('wp_is_rest_endpoint', 'my_custom_filter', 10, 1);
function my_custom_filter($is_request_endpoint) {
// Your custom filtering logic here
return $is_request_endpoint;
}
Source Code Context
wp-includes/rest-api.php:3480
- How this hook is used in WordPress core
<?php
3475 *
3476 * @since 6.5.0
3477 *
3478 * @param bool $is_request_endpoint Whether a REST endpoint request is currently being handled.
3479 */
3480 return (bool) apply_filters( 'wp_is_rest_endpoint', $is_rest_endpoint );
3481 }
PHP Documentation
<?php
/**
* Filters whether a REST endpoint request is currently being handled.
*
* This may be a standalone REST API request, or an internal request dispatched from within a regular page load.
*
* @since 6.5.0
*
* @param bool $is_request_endpoint Whether a REST endpoint request is currently being handled.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/rest-api.php
Related Hooks
Related hooks will be displayed here in future updates.