rest_comment_query WordPress Filter Hook

The rest_comment_query hook is used to modify the parameters of a comment query made via the REST API. This hook allows you to change the default behavior of the REST API in regards to comments, and can be used to customize the output of your comment queries.

apply_filters( 'rest_comment_query', array $prepared_args, WP_REST_Request $request ) #

Filters WP_Comment_Query arguments when querying comments via the REST API.


Parameters

$prepared_args

(array)Array of arguments for WP_Comment_Query.

$request

(WP_REST_Request)The REST API request.


Top ↑

Source

File: wp-includes/rest-api/endpoints/class-wp-rest-comments-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.