WP_REST_Post_Search_Handler::detect_rest_item_route()protectedWP 5.0.0

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.


String. REST route relative to the REST base URI, or empty string if unknown.


// protected - for code of main (parent) or child class
$result = $this->detect_rest_item_route( $post );
$post(WP_Post) (required)
Post object.



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() code WP 6.5.4

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 );