rest_query_var-(key)
Filters the query_vars used in get_items() for the constructed query.
The dynamic portion of the hook name, $key, refers to the query_var key.
Использование
add_filter( 'rest_query_var-(key)', 'wp_kama_rest_query_var_key_filter' ); /** * Function for `rest_query_var-(key)` filter-hook. * * @param string $value The query_var value. * * @return string */ function wp_kama_rest_query_var_key_filter( $value ){ // filter... return $value; }
- $value(строка)
- The query_var value.
Список изменений
С версии 4.7.0 | Введена. |
Где вызывается хук
rest_query_var-(key)
rest_query_var-(key)
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 1194
$query_args[ $key ] = apply_filters( "rest_query_var-{$key}", $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php 537
$query_args[ $key ] = apply_filters( "rest_query_var-{$key}", $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores