Make WordPress Core


Ignore:
Timestamp:
12/14/2018 02:32:33 AM (6 years 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/inc/template-tags.php

    r43808 r44149  
    55 * @package WordPress
    66 * @subpackage Twenty_Nineteen
     7 * @since 1.0.0
    78 */
    89
     
    2627
    2728        printf(
    28             '<span class="posted-on">%1$s<a href="%2$s" rel="bookmark">' . $time_string . '</a></span>',
     29            '<span class="posted-on">%1$s<a href="%2$s" rel="bookmark">%3$s</a></span>',
    2930            twentynineteen_get_icon_svg( 'watch', 16 ),
    3031            esc_url( get_permalink() ),
     
    4344            /* translators: 1: SVG icon. 2: post author, only visible to screen readers. 3: author link. */
    4445            twentynineteen_get_icon_svg( 'person', 16 ),
    45             esc_html__( 'Posted by', 'twentynineteen' ),
     46            __( 'Posted by', 'twentynineteen' ),
    4647            esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    4748            esc_html( get_the_author() )
     
    7374    function twentynineteen_entry_footer() {
    7475
    75         // Posted by
    76         twentynineteen_posted_by();
    77 
    78         // Hide category and tag text for pages.
     76        // Hide author, post date, category and tag text for pages.
    7977        if ( 'post' === get_post_type() ) {
     78
     79            // Posted by
     80            twentynineteen_posted_by();
     81
     82            // Posted on
     83            twentynineteen_posted_on();
     84
    8085            /* translators: used between list items, there is a space after the comma. */
    81             $categories_list = get_the_category_list( esc_html__( ', ', 'twentynineteen' ) );
     86            $categories_list = get_the_category_list( __( ', ', 'twentynineteen' ) );
    8287            if ( $categories_list ) {
    8388                /* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of categories. */
     
    8590                    '<span class="cat-links">%1$s<span class="screen-reader-text">%2$s</span>%3$s</span>',
    8691                    twentynineteen_get_icon_svg( 'archive', 16 ),
    87                     esc_html__( 'Posted in', 'twentynineteen' ),
     92                    __( 'Posted in', 'twentynineteen' ),
    8893                    $categories_list
    8994                ); // WPCS: XSS OK.
     
    9196
    9297            /* translators: used between list items, there is a space after the comma. */
    93             $tags_list = get_the_tag_list( '', esc_html__( ', ', 'twentynineteen' ) );
     98            $tags_list = get_the_tag_list( '', __( ', ', 'twentynineteen' ) );
    9499            if ( $tags_list ) {
    95100                /* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of tags. */
    96101                printf(
    97                     '<span class="cat-links">%1$s<span class="screen-reader-text">%2$s </span>%3$s</span>',
     102                    '<span class="tags-links">%1$s<span class="screen-reader-text">%2$s </span>%3$s</span>',
    98103                    twentynineteen_get_icon_svg( 'tag', 16 ),
    99                     esc_html__( 'Tags:', 'twentynineteen' ),
     104                    __( 'Tags:', 'twentynineteen' ),
    100105                    $tags_list
    101106                ); // WPCS: XSS OK.
     
    151156            ?>
    152157
    153             <figure class="post-thumbnail">
    154                 <a class="post-thumbnail-inner" href="<?php the_permalink(); ?>" aria-hidden="true" tabindex="-1">
    155                     <?php
    156                     the_post_thumbnail(
    157                         'post-thumbnail',
    158                         array(
    159                             'alt' => the_title_attribute(
    160                                 array( 'echo' => false )
    161                             ),
    162                         )
    163                     );
    164                     ?>
    165                 </a>
    166             </figure><!-- .post-thumbnail -->
     158        <figure class="post-thumbnail">
     159            <a class="post-thumbnail-inner" href="<?php the_permalink(); ?>" aria-hidden="true" tabindex="-1">
     160                <?php
     161                the_post_thumbnail( 'post-thumbnail' );
     162                ?>
     163            </a>
     164        </figure>
    167165
    168166            <?php
     
    171169endif;
    172170
    173 if ( ! function_exists( 'twentynineteen_header_featured_image_css' ) ) :
    174     /**
    175      * Returns the CSS for the header featured image background.
    176      */
    177     function twentynineteen_header_featured_image_css() {
    178         $img_url = get_the_post_thumbnail_url( get_the_ID(), 'post-thumbnail' );
    179         return sprintf( 'body.singular .site-header.featured-image .site-branding-container:before { background-image: url(%s); }', esc_url( $img_url ) );
    180     }
    181 endif;
    182 
    183171if ( ! function_exists( 'twentynineteen_comment_avatar' ) ) :
    184172    /**
     
    186174     */
    187175    function twentynineteen_get_user_avatar_markup( $id_or_email = null ) {
     176
    188177        if ( ! isset( $id_or_email ) ) {
    189178            $id_or_email = get_current_user_id();
    190179        }
    191180
    192         $classes = array( 'comment-author', 'vcard' );
    193 
    194181        return sprintf( '<div class="comment-user-avatar comment-author vcard">%s</div>', get_avatar( $id_or_email, twentynineteen_get_avatar_size() ) );
    195182    }
     
    201188     */
    202189    function twentynineteen_discussion_avatars_list( $comment_authors ) {
    203         if ( ! empty( $comment_authors ) ) {
    204             $out = array( '<ol class="discussion-avatar-list">' );
    205             foreach ( $comment_authors as $id_or_email ) {
    206                 $out[] = sprintf( '<li>%s</li>', twentynineteen_get_user_avatar_markup( $id_or_email ) );
    207             }
    208             $out[] = '</ol><!-- .discussion-avatar-list -->';
    209             echo implode( "\n", $out );
    210         }
    211         return null;
     190        if ( empty( $comment_authors ) ) {
     191            return;
     192        }
     193        echo '<ol class="discussion-avatar-list">', "\n";
     194        foreach ( $comment_authors as $id_or_email ) {
     195            printf(
     196                "<li>%s</li>\n",
     197                twentynineteen_get_user_avatar_markup( $id_or_email )
     198            );
     199        }
     200        echo '</ol><!-- .discussion-avatar-list -->', "\n";
    212201    }
    213202endif;
     
    219208    function twentynineteen_comment_form( $order ) {
    220209        if ( true === $order || strtolower( $order ) === strtolower( get_option( 'comment_order', 'asc' ) ) ) {
     210
    221211            comment_form(
    222212                array(
    223                     'title_reply_before' => twentynineteen_get_user_avatar_markup(),
    224213                    'logged_in_as'       => null,
    225214                    'title_reply'        => null,
Note: See TracChangeset for help on using the changeset viewer.