rest_(taxonomy)_query хук-фильтр . WP 4.7.0
Filters the query arguments before passing them to get_terms().
The dynamic portion of the hook name, $this->taxonomy, refers to the taxonomy slug.
Enables adding extra arguments or setting defaults for a terms collection request.
Использование
add_filter( 'rest_(taxonomy)_query', 'filter_function_name_6219', 10, 2 ); function filter_function_name_6219( $prepared_args, $request ){ // filter... return $prepared_args; }
- $prepared_args(массив)
- Array of arguments to be passed to get_terms().
- $request(WP_REST_Request)
- The current request.
Список изменений
С версии 4.7.0 | Введена. |
Где вызывается хук
rest_(taxonomy)_query
wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php 251
$prepared_args = apply_filters( "rest_{$this->taxonomy}_query", $prepared_args, $request );