rest_{$this->taxonomy}_query WordPress Filter Hook

The rest_{$this->taxonomy}_query hook is used to modify the taxonomy query for a given request. This hook is called before the taxonomy query is executed.

apply_filters( "rest_{$this->taxonomy}_query", array $prepared_args, WP_REST_Request $request ) #

Filters get_terms() arguments when querying terms via the REST API.


Description

The dynamic portion of the hook name, $this->taxonomy, refers to the taxonomy slug.

Possible hook names include:

  • rest_category_query
  • rest_post_tag_query

Enables adding extra arguments or setting defaults for a terms collection request.


Top ↑

Parameters

$prepared_args

(array)Array of arguments for get_terms().

$request

(WP_REST_Request)The REST API request.


Top ↑

Source

File: wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.