WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/14/2018 02:32:33 AM (16 months ago)
Author:
pento
Message:

Default Themes: Import Twenty Nineteen from the 5.0 branch.

Merges [43808,43821,43842,43860,43892,43904,43909,43926-43929,43956,43961-43963] from the 5.0 branch to trunk.

Props allancole, karmatosed, kjellr, yingling017, mrasharirfan, milana_cap, fabiankaegy, westonruter, jorbin, netweb, b-07, khleomix, audrasjb, nielslange, mmaumio, richsalvucci, littlebigthing, dimadin, joyously, anevins, peterwilsoncc, dannycooper, iCaleb, siriokun, technosiren, travel_girl, azchughtai, ianbelanger, nadim1992, ismailelkorchi, nativeinside, chetan200891, grapplerulrich, ocean90, joshfeck, frankew, AbdulWahab610, mendezcode, eliorivero, melchoyce, joen, laurelfulford, mdawaffe, kraftbj, dsmart, nao, mayukojpn, enodekciw, ketuchetan, atanasangelovdev, poena, sharaz, artisticasad, mukesh27, burhandodhy, crunnells, aprakasa, themeroots, imonly_ik, tlxo, youthkee, brentswisher, smyoon315, mrahmadawais, desideveloper, Kau-Boy, mor10, mikeyarce, dingo_bastard, xkon, twoabove.

Fixes #45424.

Location:
trunk
Files:
2 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/wp-content/themes/twentynineteen/comments.php

    r43808 r44149  
    1010 * @package WordPress
    1111 * @subpackage Twenty_Nineteen
     12 * @since 1.0.0
    1213 */
    1314
    1415/*
    15 If the current post is protected by a password and
     16 * If the current post is protected by a password and
    1617 * the visitor has not yet entered the password we will
    1718 * return early without loading the comments.
     
    2122}
    2223
     24$discussion = twentynineteen_get_discussion_data();
    2325?>
    2426
    2527<div id="comments" class="<?php echo comments_open() ? 'comments-area' : 'comments-area comments-closed'; ?>">
    26     <div class="<?php echo twentynineteen_get_discussion_data()->responses > 0 ? 'comments-title-wrap' : 'comments-title-wrap no-responses'; ?>">
     28    <div class="<?php echo $discussion->responses > 0 ? 'comments-title-wrap' : 'comments-title-wrap no-responses'; ?>">
    2729        <h2 class="comments-title">
    2830        <?php
    2931            if ( comments_open() ) {
    3032                if ( have_comments() ) {
    31                     echo esc_html_e( 'Join the Conversation', 'twentynineteen' );
     33                    _e( 'Join the Conversation', 'twentynineteen' );
    3234                } else {
    33                     echo esc_html_e( 'Leave a comment', 'twentynineteen' );
     35                    _e( 'Leave a comment', 'twentynineteen' );
    3436                }
    3537            } else {
    36                 $comments_number = get_comments_number();
    37                 if ( '1' === $comments_number ) {
     38                if ( '1' == $discussion->responses ) {
    3839                    /* translators: %s: post title */
    3940                    printf( _x( 'One reply on &ldquo;%s&rdquo;', 'comments title', 'twentynineteen' ), get_the_title() );
     
    4445                            '%1$s reply on &ldquo;%2$s&rdquo;',
    4546                            '%1$s replies on &ldquo;%2$s&rdquo;',
    46                             $comments_number,
     47                            $discussion->responses,
    4748                            'comments title',
    4849                            'twentynineteen'
    4950                        ),
    50                         number_format_i18n( $comments_number ),
     51                        number_format_i18n( $discussion->responses ),
    5152                        get_the_title()
    5253                    );
     
    8586        <?php
    8687
    87         // Show comment form at bottom if showing newest comments at the bottom.
    88         if ( comments_open() && 'asc' === strtolower( get_option( 'comment_order', 'asc' ) ) ) :
    89             ?>
    90             <div class="comment-form-flex">
    91                 <span class="screen-reader-text"><?php esc_html_e( 'Leave a comment', 'twentynineteen' ); ?></span>
    92                 <?php twentynineteen_comment_form( 'asc' ); ?>
    93                 <h2 class="comments-title" aria-hidden="true"><?php esc_html_e( 'Leave a comment', 'twentynineteen' ); ?></h2>
    94             </div>
    95             <?php
    96         endif;
    97 
    9888        // Show comment navigation
    9989        if ( have_comments() ) :
     
    10999        endif;
    110100
     101        // Show comment form at bottom if showing newest comments at the bottom.
     102        if ( comments_open() && 'asc' === strtolower( get_option( 'comment_order', 'asc' ) ) ) :
     103            ?>
     104            <div class="comment-form-flex">
     105                <span class="screen-reader-text"><?php _e( 'Leave a comment', 'twentynineteen' ); ?></span>
     106                <?php twentynineteen_comment_form( 'asc' ); ?>
     107                <h2 class="comments-title" aria-hidden="true"><?php _e( 'Leave a comment', 'twentynineteen' ); ?></h2>
     108            </div>
     109            <?php
     110        endif;
     111
    111112        // If comments are closed and there are comments, let's leave a little note, shall we?
    112113        if ( ! comments_open() ) :
    113114            ?>
    114115            <p class="no-comments">
    115                 <?php esc_html_e( 'Comments are closed.', 'twentynineteen' ); ?>
     116                <?php _e( 'Comments are closed.', 'twentynineteen' ); ?>
    116117            </p>
    117118            <?php
Note: See TracChangeset for help on using the changeset viewer.