apply_filters( ‘rest_allow_anonymous_comments’, bool $allow_anonymous, WP_REST_Request $request )

In this article

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

$allow_anonymous = apply_filters( 'rest_allow_anonymous_comments', false, $request );

Changelog

VersionDescription
4.7.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.