rest_allow_anonymous_comments

rest_allow_anonymous_comments

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.7

apply_filters('rest_allow_anonymous_comments') is found 1 times:

  • /wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php line 466
    			 *                              be created. Default `false`.
    			 * @param WP_REST_Request $request Request used to generate the
    			 *                                 response.
    			 */
    			$allow_anonymous = apply_filters( 'rest_allow_anonymous_comments', false, $request );
    
    			if ( ! $allow_anonymous ) {
    				return new WP_Error(
    					'rest_comment_login_required',
    					__( 'Sorry, you must be logged in to comment.' ),
    					array( 'status' => 401 )