WordPress.org

Make WordPress Core

Ticket #16206: 16206.3.patch

File 16206.3.patch, 3.2 KB (added by rianrietveld, 5 years ago)

adds comment_notes_logged_in_before

  • wp-includes/comment-template.php

     
    12411241 * @global int        $user_ID
    12421242 * @global string     $user_identity
    12431243 * @global bool       $overridden_cpage
    1244  * @global bool       $withcomments 
     1244 * @global bool       $withcomments
    12451245 *
    12461246 * @param string $file              Optional. The file to load. Default '/comments.php'.
    12471247 * @param bool   $separate_comments Optional. Whether to separate the comments by comment type.
     
    21112111
    21122112        $req      = get_option( 'require_name_email' );
    21132113        $aria_req = ( $req ? " aria-required='true'" : '' );
    2114         $html_req = ( $req ? " required='required'" : '' );
     2114        $html_req = ( $req ? " required" : '' );
    21152115        $html5    = 'html5' === $args['format'];
    21162116        $fields   =  array(
    21172117                'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
     
    21342134        $fields = apply_filters( 'comment_form_default_fields', $fields );
    21352135        $defaults = array(
    21362136                'fields'               => $fields,
    2137                 'comment_field'        => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" aria-required="true" required="required"></textarea></p>',
     2137                'comment_field'        => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . ' <span class="required">*</span></label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" aria-required="true" required></textarea></p>',
    21382138                /** This filter is documented in wp-includes/link-template.php */
    21392139                '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>',
    21402140                /** This filter is documented in wp-includes/link-template.php */
    21412141                'logged_in_as'         => '<p class="logged-in-as">' . sprintf( __( '<a href="%1$s" aria-label="Logged in as %2$s. Edit your profile.">Logged in as %2$s</a>. <a href="%3$s">Log out?</a>' ), get_edit_user_link(), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
    21422142                'comment_notes_before' => '<p class="comment-notes"><span id="email-notes">' . __( 'Your email address will not be published.' ) . '</span>'. ( $req ? $required_text : '' ) . '</p>',
     2143                'comment_notes_logged_in_before' => '<p class="comment-notes">'. $required_text . '</p>',
    21432144                'comment_notes_after'  => '',
    21442145                'id_form'              => 'commentform',
    21452146                'id_submit'            => 'submit',
     
    22152216                                        do_action( 'comment_form_top' );
    22162217
    22172218                                        if ( is_user_logged_in() ) :
     2219
    22182220                                                /**
    22192221                                                 * Filter the 'logged in' message for the comment form for display.
    22202222                                                 *
     
    22282230                                                 */
    22292231                                                echo apply_filters( 'comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity );
    22302232
     2233                                                echo $args['comment_notes_logged_in_before'];
     2234
    22312235                                                /**
    22322236                                                 * Fires after the is_user_logged_in() check in the comment form.
    22332237                                                 *