Make WordPress Core


Ignore:
Timestamp:
11/07/2021 09:13:11 PM (5 years ago)
Author:
joedolson
Message:

Comments: Mark comment text field as required.

Add required asterisk to the comment text field. Historically, the name and email fields are marked as required, but the comment text field is not, though it is actually a required field.

Props infected, solarissmoke, rianrietveld, afercia, sabernhardt, strider72, mai21, audrasjb.
Fixes #16206.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment.php

    r51837 r52029  
    35503550        if ( get_option( 'require_name_email' ) && ! $user->exists() ) {
    35513551                if ( '' == $comment_author_email || '' == $comment_author ) {
    3552                         return new WP_Error( 'require_name_email', __( '<strong>Error</strong>: Please fill the required fields (name, email).' ), 200 );
     3552                        return new WP_Error( 'require_name_email', __( '<strong>Error</strong>: Please fill the required fields.' ), 200 );
    35533553                } elseif ( ! is_email( $comment_author_email ) ) {
    35543554                        return new WP_Error( 'require_valid_email', __( '<strong>Error</strong>: Please enter a valid email address.' ), 200 );
Note: See TracChangeset for help on using the changeset viewer.