WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

rest_get_queried_resource_route() WP 5.5.0

Gets the REST route for the currently queried object.

Хуки из функции
Возвращает

Строку. The REST route of the resource, or an empty string if no resource identified.

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

rest_get_queried_resource_route();

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

С версии 5.5.0 Введена.

Код rest_get_queried_resource_route() WP 5.5.1

wp-includes/rest-api.php
<?php
function rest_get_queried_resource_route() {
	if ( is_singular() ) {
		$route = rest_get_route_for_post( get_queried_object() );
	} elseif ( is_category() || is_tag() || is_tax() ) {
		$route = rest_get_route_for_term( get_queried_object() );
	} elseif ( is_author() ) {
		$route = '/wp/v2/users/' . get_queried_object_id();
	} else {
		$route = '';
	}

	/**
	 * Filters the REST route for the currently queried object.
	 *
	 * @since 5.5.0
	 *
	 * @param string $link The route with a leading slash, or an empty string.
	 */
	return apply_filters( 'rest_queried_resource_route', $route );
}