Make WordPress Core

Changeset 44196


Ignore:
Timestamp:
12/14/2018 09:23:52 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 kjellr, allancole, dimadin, westonruter.

See #45424.

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

Legend:

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

    r43892 r44196  
    5252                                                         */
    5353                                                        if ( twentynineteen_is_comment_by_post_author( $comment ) ) {
    54                                                                 /* translators: %s: SVG Icon */
    5554                                                                printf( '<span class="post-author-badge" aria-hidden="true">%s</span>', twentynineteen_get_icon_svg( 'check', 24 ) );
    5655                                                        }
     
    111110                <?php
    112111        }
    113 
    114112}
  • branches/5.0/src/wp-content/themes/twentynineteen/functions.php

    r44187 r44196  
    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/**
  • branches/5.0/src/wp-content/themes/twentynineteen/inc/template-tags.php

    r44187 r44196  
    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 ),
  • branches/5.0/src/wp-content/themes/twentynineteen/js/skip-link-focus-fix.js

    r43808 r44196  
    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
  • branches/5.0/src/wp-content/themes/twentynineteen/sass/blocks/_blocks.scss

    r44193 r44196  
    325325                        margin-bottom: calc(4.33 * #{ $size__spacing-unit});
    326326                        margin-right: 0;
     327                        padding-left: 0;
    327328                }
    328329
     
    578579                .blocks-gallery-item:last-child {
    579580                        margin-bottom: 16px;
     581                }
     582
     583                figcaption a {
     584                        color: #fff;
    580585                }
    581586        }
  • branches/5.0/src/wp-content/themes/twentynineteen/single.php

    r43892 r44196  
    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                                        );
  • branches/5.0/src/wp-content/themes/twentynineteen/style-rtl.css

    r44193 r44196  
    37663766  margin-bottom: calc(4.33 * 1rem);
    37673767  margin-left: 0;
     3768  padding-right: 0;
    37683769}
    37693770
     
    40464047.entry .entry-content .wp-block-gallery .blocks-gallery-item:last-child {
    40474048  margin-bottom: 16px;
     4049}
     4050
     4051.entry .entry-content .wp-block-gallery figcaption a {
     4052  color: #fff;
    40484053}
    40494054
  • branches/5.0/src/wp-content/themes/twentynineteen/style.css

    r44193 r44196  
    37783778  margin-bottom: calc(4.33 * 1rem);
    37793779  margin-right: 0;
     3780  padding-left: 0;
    37803781}
    37813782
     
    40584059.entry .entry-content .wp-block-gallery .blocks-gallery-item:last-child {
    40594060  margin-bottom: 16px;
     4061}
     4062
     4063.entry .entry-content .wp-block-gallery figcaption a {
     4064  color: #fff;
    40604065}
    40614066
  • branches/5.0/src/wp-content/themes/twentynineteen/template-parts/post/author-bio.php

    r43860 r44196  
    1111<div class="author-bio">
    1212        <h2 class="author-title">
     13                <?php /* translators: %s: author name */ ?>
    1314                <span class="author-heading"><?php echo esc_html( sprintf( __( 'Published by %s', 'twentynineteen' ), get_the_author() ) ); ?></span>
    1415        </h2>
Note: See TracChangeset for help on using the changeset viewer.