allow_empty_comment

allow_empty_comment

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

See hook in core

Displaying hooks found in version: wordpress-6.5.2

apply_filters('allow_empty_comment') is found 3 times:

  • /wp-includes/class-wp-xmlrpc-server.php line 4007
     
    		$comment['comment_parent'] = isset( $content_struct['comment_parent'] ) ? absint( $content_struct['comment_parent'] ) : 0;
    
    		/** This filter is documented in wp-includes/comment.php */
    		$allow_empty = apply_filters( 'allow_empty_comment', false, $comment );
    
    		if ( ! $allow_empty && '' === $comment['comment_content'] ) {
    			return new IXR_Error( 403, __( 'Comment is required.' ) );
    		}
    
    		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    
  • /wp-includes/comment.php line 3661
    	 *
    	 * @param bool  $allow_empty_comment Whether to allow empty comments. Default false.
    	 * @param array $commentdata         Array of comment data to be sent to wp_insert_comment().
    	 */
    	$allow_empty_comment = apply_filters( 'allow_empty_comment', false, $commentdata );
    	if ( '' === $comment_content && ! $allow_empty_comment ) {
    		return new WP_Error( 'require_valid_comment', __( '<strong>Error:</strong> Please type your comment text.' ), 200 );
    	}
    
    	$check_max_lengths = wp_check_comment_data_max_lengths( $commentdata );
    	if ( is_wp_error( $check_max_lengths ) ) {
    
  • /wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php line 1903
    			)
    		);
    
    		/** This filter is documented in wp-includes/comment.php */
    		$allow_empty = apply_filters( 'allow_empty_comment', false, $check );
    
    		if ( $allow_empty ) {
    			return true;
    		}
    
    		/*