rest_comment_query filter-hook . WP 4.7.0
Filters arguments, before passing to WP_Comment_Query, when querying comments via the REST API.
Usage
add_filter( 'rest_comment_query', 'filter_function_name_7783', 10, 2 ); function filter_function_name_7783( $prepared_args, $request ){ // filter... return $prepared_args; }
- $prepared_args(array)
- Array of arguments for WP_Comment_Query.
- $request(WP_REST_Request)
- The current request.
Changelog
Since 4.7.0 | Introduced. |
Where the hook is called
rest_comment_query
wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php 273
$prepared_args = apply_filters( 'rest_comment_query', $prepared_args, $request );