WP_REST_Post_Search_Handler::detect_rest_item_route()
Deprecated from version 5.5.0. It is no longer supported and can be removed in future releases. Use rest_get_route_for_post() instead.
Attempts to detect the route to access a single item.
Method of the class: WP_REST_Post_Search_Handler{}
No Hooks.
Return
String
. REST route relative to the REST base URI, or empty string if unknown.
Usage
// protected - for code of main (parent) or child class $result = $this->detect_rest_item_route( $post );
- $post(WP_Post) (required)
- Post object.
Notes
Changelog
Since 5.0.0 | Introduced. |
Deprecated since 5.5.0 | Use rest_get_route_for_post() |
WP_REST_Post_Search_Handler::detect_rest_item_route() WP REST Post Search Handler::detect rest item route code WP 6.5.2
protected function detect_rest_item_route( $post ) { _deprecated_function( __METHOD__, '5.5.0', 'rest_get_route_for_post()' ); return rest_get_route_for_post( $post ); }