Make WordPress Core

Ticket #16206: 16206.patch

File 16206.patch, 2.0 KB (added by solarissmoke, 14 years ago)

Mark comment field as required

  • wp-includes/comment-template.php

     
    15301530        $required_text = sprintf( ' ' . __('Required fields are marked %s'), '<span class="required">*</span>' );
    15311531        $defaults = array(
    15321532                'fields'               => apply_filters( 'comment_form_default_fields', $fields ),
    1533                 'comment_field'        => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>',
     1533                'comment_field'        => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <span class="required">*</span><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>',
    15341534                'must_log_in'          => '<p class="must-log-in">' .  sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
    15351535                'logged_in_as'         => '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
    1536                 'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email address will not be published.' ) . ( $req ? $required_text : '' ) . '</p>',
     1536                'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email address will not be published.' ) . $required_text . '</p>',
    15371537                'comment_notes_after'  => '<p class="form-allowed-tags">' . sprintf( __( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: %s' ), ' <code>' . allowed_tags() . '</code>' ) . '</p>',
    15381538                'id_form'              => 'commentform',
    15391539                'id_submit'            => 'submit',