Make WordPress Core

Changeset 44199


Ignore:
Timestamp:
12/14/2018 09:50:16 PM (8 years ago)
Author:
desrosj
Message:

Twenty Nineteen: Fixes and improvements.

This commit brings over several changes that occurred upstream in the theme’s GitHub repository into core.

Props khleomix, grapplerulrich, iCaleb, kjellr, allancole.

See #45424.

Location:
branches/5.0/src/wp-content/themes/twentynineteen
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/src/wp-content/themes/twentynineteen/classes/class-twentynineteen-walker-comment.php

    r44196 r44199  
    3434                                        <div class="comment-author vcard">
    3535                                                <?php
    36                                                         $comment_author_link = get_comment_author_link( $comment );
    37                                                         $comment_author_url  = get_comment_author_url( $comment );
    38                                                         $comment_author      = get_comment_author( $comment );
    39                                                         $avatar              = get_avatar( $comment, $args['avatar_size'] );
    40                                                         if ( 0 != $args['avatar_size'] ) {
    41                                                                 if ( empty( $comment_author_url ) ) {
    42                                                                         echo $avatar;
    43                                                                 } else {
    44                                                                         printf( '<a href="%s" rel="external nofollow" class="url">', $comment_author_url );
    45                                                                         echo $avatar;
    46                                                                 }
     36                                                $comment_author_link = get_comment_author_link( $comment );
     37                                                $comment_author_url  = get_comment_author_url( $comment );
     38                                                $comment_author      = get_comment_author( $comment );
     39                                                $avatar              = get_avatar( $comment, $args['avatar_size'] );
     40                                                if ( 0 != $args['avatar_size'] ) {
     41                                                        if ( empty( $comment_author_url ) ) {
     42                                                                echo $avatar;
     43                                                        } else {
     44                                                                printf( '<a href="%s" rel="external nofollow" class="url">', $comment_author_url );
     45                                                                echo $avatar;
    4746                                                        }
     47                                                }
     48                                                /*
     49                                                 * Using the `check` icon instead of `check_circle`, since we can't add a
     50                                                 * fill color to the inner check shape when in circle form.
     51                                                 */
     52                                                if ( twentynineteen_is_comment_by_post_author( $comment ) ) {
     53                                                        printf( '<span class="post-author-badge" aria-hidden="true">%s</span>', twentynineteen_get_icon_svg( 'check', 24 ) );
     54                                                }
    4855
    49                                                         /*
    50                                                          * Using the `check` icon instead of `check_circle`, since we can't add a
    51                                                          * fill color to the inner check shape when in circle form.
    52                                                          */
    53                                                         if ( twentynineteen_is_comment_by_post_author( $comment ) ) {
    54                                                                 printf( '<span class="post-author-badge" aria-hidden="true">%s</span>', twentynineteen_get_icon_svg( 'check', 24 ) );
    55                                                         }
     56                                                printf(
     57                                                        /* translators: %s: comment author link */
     58                                                        wp_kses(
     59                                                                __( '%s <span class="screen-reader-text says">says:</span>', 'twentynineteen' ),
     60                                                                array(
     61                                                                        'span' => array(
     62                                                                                'class' => array(),
     63                                                                        ),
     64                                                                )
     65                                                        ),
     66                                                        '<b class="fn">' . get_comment_author_link( $comment ) . '</b>'
     67                                                );
    5668
    57                                                         printf(
    58                                                                 /* translators: %s: comment author link */
    59                                                                 __( '%s <span class="screen-reader-text says">says:</span>', 'twentynineteen' ),
    60                                                                 sprintf( '<span class="fn">%s</span>', $comment_author )
    61                                                         );
    62 
    63                                                         if ( ! empty( $comment_author_url ) ) {
    64                                                                 echo '</a>';
    65                                                         }
     69                                                if ( ! empty( $comment_author_url ) ) {
     70                                                        echo '</a>';
     71                                                }
    6672                                                ?>
    6773                                        </div><!-- .comment-author -->
  • branches/5.0/src/wp-content/themes/twentynineteen/comments.php

    r43892 r44199  
    2929                <h2 class="comments-title">
    3030                <?php
    31                         if ( comments_open() ) {
    32                                 if ( have_comments() ) {
    33                                         _e( 'Join the Conversation', 'twentynineteen' );
    34                                 } else {
    35                                         _e( 'Leave a comment', 'twentynineteen' );
    36                                 }
     31                if ( comments_open() ) {
     32                        if ( have_comments() ) {
     33                                _e( 'Join the Conversation', 'twentynineteen' );
    3734                        } else {
    38                                 if ( '1' == $discussion->responses ) {
    39                                         /* translators: %s: post title */
    40                                         printf( _x( 'One reply on &ldquo;%s&rdquo;', 'comments title', 'twentynineteen' ), get_the_title() );
    41                                 } else {
    42                                         printf(
    43                                                 /* translators: 1: number of comments, 2: post title */
    44                                                 _nx(
    45                                                         '%1$s reply on &ldquo;%2$s&rdquo;',
    46                                                         '%1$s replies on &ldquo;%2$s&rdquo;',
    47                                                         $discussion->responses,
    48                                                         'comments title',
    49                                                         'twentynineteen'
    50                                                 ),
    51                                                 number_format_i18n( $discussion->responses ),
    52                                                 get_the_title()
    53                                         );
    54                                 }
     35                                _e( 'Leave a comment', 'twentynineteen' );
    5536                        }
     37                } else {
     38                        if ( '1' == $discussion->responses ) {
     39                                /* translators: %s: post title */
     40                                printf( _x( 'One reply on &ldquo;%s&rdquo;', 'comments title', 'twentynineteen' ), get_the_title() );
     41                        } else {
     42                                printf(
     43                                        /* translators: 1: number of comments, 2: post title */
     44                                        _nx(
     45                                                '%1$s reply on &ldquo;%2$s&rdquo;',
     46                                                '%1$s replies on &ldquo;%2$s&rdquo;',
     47                                                $discussion->responses,
     48                                                'comments title',
     49                                                'twentynineteen'
     50                                        ),
     51                                        number_format_i18n( $discussion->responses ),
     52                                        get_the_title()
     53                                );
     54                        }
     55                }
    5656                ?>
    5757                </h2><!-- .comments-title -->
    5858                <?php
    5959                        // Only show discussion meta information when comments are open and available.
    60                         if ( have_comments() && comments_open() ) {
     60                if ( have_comments() && comments_open() ) {
    6161                        get_template_part( 'template-parts/post/discussion', 'meta' );
    62                         }
     62                }
    6363                ?>
    6464        </div><!-- .comments-title-flex -->
  • branches/5.0/src/wp-content/themes/twentynineteen/header.php

    r44187 r44199  
    3838
    3939                                                $classes = 'entry-header';
    40                                                 if ( ! empty( $discussion ) && count( $discussion->responses ) > 0 ) {
     40                                                if ( ! empty( $discussion ) && absint( $discussion->responses ) > 0 ) {
    4141                                                        $classes = 'entry-header has-discussion';
    4242                                                }
  • branches/5.0/src/wp-content/themes/twentynineteen/sass/blocks/_blocks.scss

    r44196 r44199  
    530530                        padding: 0;
    531531                        color: #fff;
    532                         -ms-hyphens: auto;
    533                         -moz-hyphens: auto;
    534                         -webkit-hyphens: auto;
    535                         hyphens: auto;
    536532
    537533                        @include media(tablet) {
  • branches/5.0/src/wp-content/themes/twentynineteen/style-rtl.css

    r44196 r44199  
    39693969  padding: 0;
    39703970  color: #fff;
    3971   -ms-hyphens: auto;
    3972   -moz-hyphens: auto;
    3973   -webkit-hyphens: auto;
    3974   hyphens: auto;
    39753971}
    39763972
  • branches/5.0/src/wp-content/themes/twentynineteen/style.css

    r44196 r44199  
    39813981  padding: 0;
    39823982  color: #fff;
    3983   -ms-hyphens: auto;
    3984   -moz-hyphens: auto;
    3985   -webkit-hyphens: auto;
    3986   hyphens: auto;
    39873983}
    39883984
  • branches/5.0/src/wp-content/themes/twentynineteen/template-parts/post/author-bio.php

    r44196 r44199  
    1111<div class="author-bio">
    1212        <h2 class="author-title">
    13                 <?php /* translators: %s: author name */ ?>
    14                 <span class="author-heading"><?php echo esc_html( sprintf( __( 'Published by %s', 'twentynineteen' ), get_the_author() ) ); ?></span>
     13                <span class="author-heading">
     14                        <?php
     15                        printf(
     16                        /* translators: %s: post author */
     17                                __( 'Published by %s', 'twentynineteen' ),
     18                                esc_html( get_the_author() )
     19                        );
     20                        ?>
     21                </span>
    1522        </h2>
    1623        <p class="author-description">
  • branches/5.0/src/wp-content/themes/twentynineteen/template-parts/post/discussion-meta.php

    r43892 r44199  
    1818        $meta_label = __( 'No comments', 'twentynineteen' );
    1919}
    20 
    2120?>
    2221
Note: See TracChangeset for help on using the changeset viewer.