Make WordPress Core

Changeset 44305


Ignore:
Timestamp:
12/18/2018 10:45: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.

.com/WordPress/twentynineteen/pull/47

.com/WordPress/twentynineteen/pull/661

Props kjellr, allancole, dimadin, westonruter, khleomix, grapplerulrich, iCaleb, desrosj.

Merges [44196], [44199], and [44201-44202] into trunk.

Fixes #45424.

Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/wp-content/themes/twentynineteen/classes/class-twentynineteen-walker-comment.php

    r44155 r44305  
    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'] );
     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'] );
    4040                                                if ( 0 != $args['avatar_size'] ) {
    4141                                                        if ( empty( $comment_author_url ) ) {
     
    4646                                                        }
    4747                                                }
    48 
    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                                                          */
     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                                                 */
    5352                                                if ( twentynineteen_is_comment_by_post_author( $comment ) ) {
    54                                                         /* translators: %s: SVG Icon */
    5553                                                        printf( '<span class="post-author-badge" aria-hidden="true">%s</span>', twentynineteen_get_icon_svg( 'check', 24 ) );
    5654                                                }
    5755
    58                                                         printf(
    59                                                                 /* translators: %s: comment author link */
     56                                                /*
     57                                                 * Using the `check` icon instead of `check_circle`, since we can't add a
     58                                                 * fill color to the inner check shape when in circle form.
     59                                                 */
     60                                                if ( twentynineteen_is_comment_by_post_author( $comment ) ) {
     61                                                        printf( '<span class="post-author-badge" aria-hidden="true">%s</span>', twentynineteen_get_icon_svg( 'check', 24 ) );
     62                                                }
     63
     64                                                printf(
     65                                                        /* translators: %s: comment author link */
     66                                                        wp_kses(
    6067                                                                __( '%s <span class="screen-reader-text says">says:</span>', 'twentynineteen' ),
    61                                                                 sprintf( '<span class="fn">%s</span>', $comment_author )
    62                                                         );
     68                                                                array(
     69                                                                        'span' => array(
     70                                                                                'class' => array(),
     71                                                                        ),
     72                                                                )
     73                                                        ),
     74                                                        '<b class="fn">' . get_comment_author_link( $comment ) . '</b>'
     75                                                );
    6376
    6477                                                if ( ! empty( $comment_author_url ) ) {
     
    111124                <?php
    112125        }
    113 
    114126}
  • trunk/src/wp-content/themes/twentynineteen/functions.php

    r44298 r44305  
    222222        wp_style_add_data( 'twentynineteen-style', 'rtl', 'replace' );
    223223
    224         wp_enqueue_script( 'twentynineteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20151215', true );
    225 
    226224        if ( has_nav_menu( 'menu-1' ) ) {
    227225                wp_enqueue_script( 'twentynineteen-priority-menu', get_theme_file_uri( '/js/priority-menu.js' ), array(), '1.0', true );
     
    236234}
    237235add_action( 'wp_enqueue_scripts', 'twentynineteen_scripts' );
     236
     237/**
     238 * Fix skip link focus in IE11.
     239 *
     240 * This does not enqueue the script because it is tiny and because it is only for IE11,
     241 * thus it does not warrant having an entire dedicated blocking script being loaded.
     242 *
     243 * @link https://git.io/vWdr2
     244 */
     245function twentynineteen_skip_link_focus_fix() {
     246        // The following is minified via `terser --compress --mangle -- js/skip-link-focus-fix.js`.
     247        ?>
     248        <script>
     249        /(trident|msie)/i.test(navigator.userAgent)&&document.getElementById&&window.addEventListener&&window.addEventListener("hashchange",function(){var t,e=location.hash.substring(1);/^[A-z0-9_-]+$/.test(e)&&(t=document.getElementById(e))&&(/^(?:a|select|input|button|textarea)$/i.test(t.tagName)||(t.tabIndex=-1),t.focus())},!1);
     250        </script>
     251        <?php
     252}
     253add_action( 'wp_print_footer_scripts', 'twentynineteen_skip_link_focus_fix' );
    238254
    239255/**
  • trunk/src/wp-content/themes/twentynineteen/header.php

    r44298 r44305  
    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                                        }
  • trunk/src/wp-content/themes/twentynineteen/inc/template-tags.php

    r44298 r44305  
    4141        function twentynineteen_posted_by() {
    4242                printf(
     43                        /* translators: 1: SVG icon. 2: post author, only visible to screen readers. 3: author link. */
    4344                        '<span class="byline">%1$s<span class="screen-reader-text">%2$s</span><span class="author vcard"><a class="url fn n" href="%3$s">%4$s</a></span></span>',
    44                         /* translators: 1: SVG icon. 2: post author, only visible to screen readers. 3: author link. */
    4545                        twentynineteen_get_icon_svg( 'person', 16 ),
    4646                        __( 'Posted by', 'twentynineteen' ),
     
    8686                        $categories_list = get_the_category_list( __( ', ', 'twentynineteen' ) );
    8787                        if ( $categories_list ) {
    88                                 /* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of categories. */
    8988                                printf(
     89                                        /* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of categories. */
    9090                                        '<span class="cat-links">%1$s<span class="screen-reader-text">%2$s</span>%3$s</span>',
    9191                                        twentynineteen_get_icon_svg( 'archive', 16 ),
     
    9898                        $tags_list = get_the_tag_list( '', __( ', ', 'twentynineteen' ) );
    9999                        if ( $tags_list ) {
    100                                 /* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of tags. */
    101100                                printf(
     101                                        /* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of tags. */
    102102                                        '<span class="tags-links">%1$s<span class="screen-reader-text">%2$s </span>%3$s</span>',
    103103                                        twentynineteen_get_icon_svg( 'tag', 16 ),
  • trunk/src/wp-content/themes/twentynineteen/js/skip-link-focus-fix.js

    r43808 r44305  
    33 *
    44 * Helps with accessibility for keyboard only users.
     5 *
     6 * This is the source file for what is minified in the twentynineteen_skip_link_focus_fix() PHP function.
    57 *
    68 * Learn more: https://git.io/vWdr2
  • trunk/src/wp-content/themes/twentynineteen/readme.txt

    r44279 r44305  
    1 # Twenty Nineteen
     1=== Twenty Nineteen ===
     2Contributors: the WordPress team
     3Tags: one-column, flexible-header, accessibility-ready, custom-colors, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready
     4Requires at least: 4.9.6
     5Tested up to: 5.0
     6Stable tag: 1.0
     7License: GPLv2 or later
     8License URI: http://www.gnu.org/licenses/gpl-2.0.html
    29
    3 [![Build Status](https://travis-ci.org/WordPress/twentynineteen.svg?branch=master)](https://travis-ci.org/WordPress/twentynineteen)
     10Our 2019 default theme is designed to show off the power of the block editor.
    411
    5 **Contributors:** the WordPress team 
    6 **Requires at least:** WordPress 4.9.6 
    7 **Tested up to:** WordPress 4.9.8 
    8 **Version:** 1.0 
    9 **License:** GPLv2 or later 
    10 **License URI:** http://www.gnu.org/licenses/gpl-2.0.html 
    11 **Tags:** one-column, flexible-header, accessibility-ready, custom-colors, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready
     12== Description ==
     13Our 2019 default theme is designed to show off the power of the block editor. It features custom styles for all the default blocks, and is built so that what you see in the editor looks like what you'll see on your website. Twenty Nineteen is designed to be adaptable to a wide range of websites, whether you’re running a photo blog, launching a new business, or supporting a non-profit. Featuring ample whitespace and modern sans-serif headlines paired with classic serif body text, it's built to be beautiful on all screen sizes.
    1214
    13 ## Description
     15== Changelog ==
    1416
    15 Twenty Nineteen is a Gutenberg-ready theme for WordPress.
     17= 1.0 =
     18* Initial Release
    1619
    17 ## Installation
    18 
    19 1. In your admin panel, go to Appearance -> Themes and click the 'Add New' button.
    20 2. Type in Twenty Nineteen in the search form and press the 'Enter' key on your keyboard.
    21 3. Click on the 'Activate' button to use your new theme right away.
    22 4. Go to https://codex.wordpress.org/Twenty_Nineteen for a guide on how to customize this theme.
    23 5. Navigate to Appearance > Customize in your admin panel and customize to taste.
    24 
    25 ## Copyright
    26 
    27 Twenty Nineteen WordPress Theme, Copyright 2018 WordPress.org
    28 Twenty Nineteen is distributed under the terms of the GNU GPL.
    29 
    30 This program is free software: you can redistribute it and/or modify
    31 it under the terms of the GNU General Public License as published by
    32 the Free Software Foundation, either version 2 of the License, or
    33 (at your option) any later version.
    34 
    35 This program is distributed in the hope that it will be useful,
    36 but WITHOUT ANY WARRANTY; without even the implied warranty of
    37 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    38 GNU General Public License for more details.
    39 
    40 Twenty Nineteen bundles the following third-party resources:
    41 
    42 _s, Copyright 2015-2018 Automattic, Inc.
    43 **License:** GPLv2 or later
    44 Source: https://github.com/Automattic/_s/
    45 
    46 normalize.css, Copyright 2012-2016 Nicolas Gallagher and Jonathan Neal
    47 **License:** MIT
    48 Source: https://necolas.github.io/normalize.css/
    49 
    50 Bundled header image 1, Copyright XXXXX XXXXX
    51 **License:** CC0 1.0 Universal (CC0 1.0)
    52 Source: https://pexels.com/xxxxxxxxxx
    53 
    54 Bundled header image 2, Copyright XXXXX XXXXX
    55 **License:** CC0 1.0 Universal (CC0 1.0)
    56 Source: https://pexels.com/xxxxxxxxxx
    57 
    58 ## Changelog
    59 
    60 ### 1.0
    61 
    62 * Released: December 6, 2018
    63 
    64 Initial release
     20== Resources ==
     21* normalize.css, © 2012-2018 Nicolas Gallagher and Jonathan Neal, MIT
     22* Underscores, © 2012-2018 Automattic, Inc., GNU GPL v2 or later
  • trunk/src/wp-content/themes/twentynineteen/sass/blocks/_blocks.scss

    r44302 r44305  
    325325                        margin-bottom: calc(4.33 * #{ $size__spacing-unit});
    326326                        margin-right: 0;
     327                        padding-left: 0;
    327328                }
    328329
     
    363364
    364365                        blockquote {
    365                                 margin-left: 0;
     366                                margin: $size__spacing-unit 0;
    366367                                padding: 0;
    367368                                text-align: left;
    368369                                max-width: 100%;
     370
     371                                p:first-child {
     372                                        margin-top: 0;
     373                                }
    369374                        }
    370375                }
     
    400405
    401406                        blockquote {
    402                                 max-width: calc(100% - (2 * #{$size__spacing-unit}));
     407                                max-width: 100%;
    403408                                color: $color__background-body;
    404409                                padding-left: 0;
    405410                                margin-left: $size__spacing-unit;
     411                                margin-right: $size__spacing-unit;
    406412
    407413                                &.has-text-color p,
     
    418424                                        margin-left: 0;
    419425                                        margin-right: 0;
     426                                }
     427                        }
     428
     429                        &.alignright,
     430                        &.alignleft {
     431
     432                                @include media(tablet) {
     433                                        padding: $size__spacing-unit calc(2 * #{$size__spacing-unit});
    420434                                }
    421435                        }
     
    529543                        padding: 0;
    530544                        color: #fff;
    531                         -ms-hyphens: auto;
    532                         -moz-hyphens: auto;
    533                         -webkit-hyphens: auto;
    534                         hyphens: auto;
    535545
    536546                        @include media(tablet) {
     
    545555
    546556                        @include media(tablet) {
    547                                 padding: $size__spacing-unit;
     557                                padding: $size__spacing-unit calc(2 * #{$size__spacing-unit});
    548558                        }
    549559                }
     
    578588                .blocks-gallery-item:last-child {
    579589                        margin-bottom: 16px;
     590                }
     591
     592                figcaption a {
     593                        color: #fff;
    580594                }
    581595        }
  • trunk/src/wp-content/themes/twentynineteen/single.php

    r44149 r44305  
    2828                                        the_post_navigation(
    2929                                                array(
    30                                                         'prev_text' => _x( '<span class="meta-nav">Published in</span><br/><span class="post-title">%title</span>', 'Parent post link', 'twentynineteen' ),
     30                                                        /* translators: %s: parent post link */
     31                                                        'prev_text' => sprintf( __( '<span class="meta-nav">Published in</span><span class="post-title">%s</span>', 'twentynineteen' ), '%title' ),
    3132                                                )
    3233                                        );
  • trunk/src/wp-content/themes/twentynineteen/style-editor.css

    r44302 r44305  
    333333  width: 100%;
    334334  max-width: 100%;
     335  padding: calc(1.375 * 1rem);
     336}
     337
     338.wp-block[data-type="core/cover"][data-align="left"] .wp-block-cover p,
     339.wp-block[data-type="core/cover"][data-align="right"] .wp-block-cover p {
     340  padding-left: 0;
     341  padding-right: 0;
    335342}
    336343
     
    338345  .wp-block[data-type="core/cover"][data-align="left"] .wp-block-cover,
    339346  .wp-block[data-type="core/cover"][data-align="right"] .wp-block-cover {
    340     padding: 1rem;
     347    padding: calc(2.75 * 1rem) calc(2.75 * 1rem) calc(3.125 * 1rem);
    341348  }
    342349}
     
    761768/* Make sure our non-latin font overrides don't overwrite the iconfont used in the classic editor toolbar */
    762769.wp-block[data-type="core/freeform"] .mce-btn i {
    763         font-family: dashicons !important;
    764 }
     770  font-family: dashicons !important;
     771}
  • trunk/src/wp-content/themes/twentynineteen/style-editor.scss

    r44302 r44305  
    295295                width: 100%;
    296296                max-width: 100%;
    297         }
    298 
    299         @include media(tablet) {
    300 
    301                 .wp-block-cover {
    302                         padding: $size__spacing-unit;
     297                padding: calc(1.375 * #{$size__spacing-unit});
     298
     299                p {
     300                        padding-left: 0;
     301                        padding-right: 0;
     302                }
     303
     304                @include media(tablet) {
     305                        padding: calc(2.75 * #{$size__spacing-unit}) calc(2.75 * #{$size__spacing-unit}) calc(3.125 * #{$size__spacing-unit});
    303306                }
    304307        }
  • trunk/src/wp-content/themes/twentynineteen/style-rtl.css

    r44302 r44305  
    37663766  margin-bottom: calc(4.33 * 1rem);
    37673767  margin-left: 0;
     3768  padding-right: 0;
    37683769}
    37693770
     
    38053806
    38063807.entry .entry-content .wp-block-pullquote.alignleft blockquote, .entry .entry-content .wp-block-pullquote.alignright blockquote {
    3807   margin-right: 0;
     3808  margin: 1rem 0;
    38083809  padding: 0;
    38093810  text-align: right;
    38103811  max-width: 100%;
     3812}
     3813
     3814.entry .entry-content .wp-block-pullquote.alignleft blockquote p:first-child, .entry .entry-content .wp-block-pullquote.alignright blockquote p:first-child {
     3815  margin-top: 0;
    38113816}
    38123817
     
    38463851
    38473852.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote {
    3848   max-width: calc(100% - (2 * 1rem));
     3853  max-width: 100%;
    38493854  color: #fff;
    38503855  padding-right: 0;
    38513856  margin-right: 1rem;
     3857  margin-left: 1rem;
    38523858}
    38533859
     
    38613867    margin-right: 0;
    38623868    margin-left: 0;
     3869  }
     3870}
     3871
     3872@media only screen and (min-width: 768px) {
     3873  .entry .entry-content .wp-block-pullquote.is-style-solid-color.alignright, .entry .entry-content .wp-block-pullquote.is-style-solid-color.alignleft {
     3874    padding: 1rem calc(2 * 1rem);
    38633875  }
    38643876}
     
    39683980  padding: 0;
    39693981  color: #fff;
    3970   -ms-hyphens: auto;
    3971   -moz-hyphens: auto;
    3972   -webkit-hyphens: auto;
    3973   hyphens: auto;
    39743982}
    39753983
     
    39964004  .entry .entry-content .wp-block-cover.alignleft,
    39974005  .entry .entry-content .wp-block-cover.alignright {
    3998     padding: 1rem;
     4006    padding: 1rem calc(2 * 1rem);
    39994007  }
    40004008}
     
    40464054.entry .entry-content .wp-block-gallery .blocks-gallery-item:last-child {
    40474055  margin-bottom: 16px;
     4056}
     4057
     4058.entry .entry-content .wp-block-gallery figcaption a {
     4059  color: #fff;
    40484060}
    40494061
  • trunk/src/wp-content/themes/twentynineteen/style.css

    r44302 r44305  
    37783778  margin-bottom: calc(4.33 * 1rem);
    37793779  margin-right: 0;
     3780  padding-left: 0;
    37803781}
    37813782
     
    38173818
    38183819.entry .entry-content .wp-block-pullquote.alignleft blockquote, .entry .entry-content .wp-block-pullquote.alignright blockquote {
    3819   margin-left: 0;
     3820  margin: 1rem 0;
    38203821  padding: 0;
    38213822  text-align: left;
    38223823  max-width: 100%;
     3824}
     3825
     3826.entry .entry-content .wp-block-pullquote.alignleft blockquote p:first-child, .entry .entry-content .wp-block-pullquote.alignright blockquote p:first-child {
     3827  margin-top: 0;
    38233828}
    38243829
     
    38583863
    38593864.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote {
    3860   max-width: calc(100% - (2 * 1rem));
     3865  max-width: 100%;
    38613866  color: #fff;
    38623867  padding-left: 0;
    38633868  margin-left: 1rem;
     3869  margin-right: 1rem;
    38643870}
    38653871
     
    38733879    margin-left: 0;
    38743880    margin-right: 0;
     3881  }
     3882}
     3883
     3884@media only screen and (min-width: 768px) {
     3885  .entry .entry-content .wp-block-pullquote.is-style-solid-color.alignright, .entry .entry-content .wp-block-pullquote.is-style-solid-color.alignleft {
     3886    padding: 1rem calc(2 * 1rem);
    38753887  }
    38763888}
     
    39803992  padding: 0;
    39813993  color: #fff;
    3982   -ms-hyphens: auto;
    3983   -moz-hyphens: auto;
    3984   -webkit-hyphens: auto;
    3985   hyphens: auto;
    39863994}
    39873995
     
    40084016  .entry .entry-content .wp-block-cover.alignleft,
    40094017  .entry .entry-content .wp-block-cover.alignright {
    4010     padding: 1rem;
     4018    padding: 1rem calc(2 * 1rem);
    40114019  }
    40124020}
     
    40584066.entry .entry-content .wp-block-gallery .blocks-gallery-item:last-child {
    40594067  margin-bottom: 16px;
     4068}
     4069
     4070.entry .entry-content .wp-block-gallery figcaption a {
     4071  color: #fff;
    40604072}
    40614073
  • trunk/src/wp-content/themes/twentynineteen/template-parts/post/author-bio.php

    r44149 r44305  
    1111<div class="author-bio">
    1212        <h2 class="author-title">
    13                 <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>
    1422        </h2>
    1523        <p class="author-description">
  • trunk/src/wp-content/themes/twentynineteen/template-parts/post/discussion-meta.php

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