rest_comment_collection_params WordPress Filter Hook

The rest_comment_collection_params hook allows you to modify the parameters that are used to query the comments from the WordPress REST API. This can be useful if you want to change the default order of the comments, or limit the number of comments that are returned.

apply_filters( 'rest_comment_collection_params', array $query_params ) #

Filters REST API collection parameters for the comments controller.


Description

This filter registers the collection parameter, but does not map the collection parameter to an internal WP_Comment_Query parameter. Use the rest_comment_query filter to set WP_Comment_Query parameters.


Top ↑

Parameters

$query_params

(array)JSON Schema-formatted collection parameters.


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.