Filter hook 'rest_allow_anonymous_comments'

in WP Core File wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php at line 466

Description

Filters whether comments can be created via the REST API without authentication. Enables creating comments for anonymous users.

Occurrences

Filename Line Number
wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php 466

Parameters

Type Name Description
bool $allow_anonymous Whether to allow anonymous comments to be created. Default `false`.
WP_REST_Request $request Request used to generate the response.

PHP Doc

/**
			 * Filters whether comments can be created via the REST API without authentication.
			 *
			 * Enables creating comments for anonymous users.
			 *
			 * @since 4.7.0
			 *
			 * @param bool $allow_anonymous Whether to allow anonymous comments to
			 *                              be created. Default `false`.
			 * @param WP_REST_Request $request Request used to generate the
			 *                                 response.
			 */