WP_REST_Post_Search_Handler::detect_rest_item_route()protectedWP 5.0.0

Устарела с версии 5.5.0. Больше не поддерживается и может быть удалена. Используйте rest_get_route_for_post().

Attempts to detect the route to access a single item.

Метод класса: WP_REST_Post_Search_Handler{}

Хуков нет.

Возвращает

Строку. REST route relative to the REST base URI, or empty string if unknown.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->detect_rest_item_route( $post );
$post(WP_Post) (обязательный)
Post object.

Заметки

Список изменений

С версии 5.0.0 Введена.
Устарела с 5.5.0 Use rest_get_route_for_post()

Код WP_REST_Post_Search_Handler::detect_rest_item_route() 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 );
}