apply_filters( 'rest_route_for_post', string $route, WP_Post $post )
- Since
- 5.5.0
Filters the REST API route for a post.
Compatibility
- WordPress
- since 5.5.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$routestring- The route path.
$postWP_Post- The post object.
Where this hook fires · 1
wp-includes/rest-api.php:3253rest_get_route_for_post()
Source code
* * @since 5.5.0 * * @param string $route The route path. * @param WP_Post $post The post object. */ return apply_filters( 'rest_route_for_post', $route, $post );} /** * Gets the REST API route for a post type. * * @since 5.9.0Changelog
Introduced in 5.5.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.