wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
rest_get_queried_resource_route › WordPress Function
Seit5.5.0
Veraltetn/v
› rest_get_queried_resource_route ( Keine Parameter )
Gibt zurück: |
|
Definiert in: |
|
Codex: |
Gets the REST route for the currently queried object.
Ähnliche Funktionen: register_rest_route, get_queried_object, rest_ensure_response, get_queried_object_id, rest_filter_response_by_context
Quellcode
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 ); }