On this page
apply_filters( 'rest_allow_anonymous_comments', bool $allow_anonymous, WP_REST_Request $request )
Filters whether comments can be created via the REST API without authentication.
Description
Enables creating comments for anonymous users.
Parameters
$allow_anonymousbool-
Whether to allow anonymous comments to be created. Default
false. $requestWP_REST_Request-
Request used to generate the response.
Source
File: wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php. View all references
$allow_anonymous = apply_filters( 'rest_allow_anonymous_comments', false, $request );
Related
Used By
| Used By | Description |
|---|---|
| WP_REST_Comments_Controller::create_item_permissions_check() wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php | Checks if a given request has access to create a comment. |
Changelog
| Version | Description |
|---|---|
| 4.7.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/rest_allow_anonymous_comments