Make WordPress Core


Ignore:
Timestamp:
12/14/2018 09:50:16 PM (5 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.

File:
1 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 -->
Note: See TracChangeset for help on using the changeset viewer.