Twenty Nineteen: Fixes and improvements.

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

- Fix the gallery caption link color. https://github.com/WordPress/twentynineteen/pull/687
- Remove left padding from pullquote blocks. https://github.com/WordPress/twentynineteen/pull/690
- Print `skip-link-focus-fix` inline instead of enqueueing as blocking script. https://github.com/WordPress/twentynineteen/pull/47
- Fix and improve some strings with placeholders. https://github.com/WordPress/twentynineteen/pull/217

Props kjellr, allancole, dimadin, westonruter.

See #45424.
Built from https://develop.svn.wordpress.org/branches/5.0@44196


git-svn-id: http://core.svn.wordpress.org/branches/5.0@44026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2018-12-15 11:09:56 +00:00
parent d3c1b8f08c
commit 08befd9763
10 changed files with 42 additions and 9 deletions

View File

@ -51,7 +51,6 @@ class TwentyNineteen_Walker_Comment extends Walker_Comment {
* fill color to the inner check shape when in circle form.
*/
if ( twentynineteen_is_comment_by_post_author( $comment ) ) {
/* translators: %s: SVG Icon */
printf( '<span class="post-author-badge" aria-hidden="true">%s</span>', twentynineteen_get_icon_svg( 'check', 24 ) );
}
@ -110,5 +109,4 @@ class TwentyNineteen_Walker_Comment extends Walker_Comment {
?>
<?php
}
}

View File

@ -221,8 +221,6 @@ function twentynineteen_scripts() {
wp_style_add_data( 'twentynineteen-style', 'rtl', 'replace' );
wp_enqueue_script( 'twentynineteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20151215', true );
if ( has_nav_menu( 'menu-1' ) ) {
wp_enqueue_script( 'twentynineteen-priority-menu', get_theme_file_uri( '/js/priority-menu.js' ), array(), '1.0', true );
wp_enqueue_script( 'twentynineteen-touch-navigation', get_theme_file_uri( '/js/touch-keyboard-navigation.js' ), array(), '1.0', true );
@ -236,6 +234,24 @@ function twentynineteen_scripts() {
}
add_action( 'wp_enqueue_scripts', 'twentynineteen_scripts' );
/**
* Fix skip link focus in IE11.
*
* This does not enqueue the script because it is tiny and because it is only for IE11,
* thus it does not warrant having an entire dedicated blocking script being loaded.
*
* @link https://git.io/vWdr2
*/
function twentynineteen_skip_link_focus_fix() {
// The following is minified via `terser --compress --mangle -- js/skip-link-focus-fix.js`.
?>
<script>
/(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);
</script>
<?php
}
add_action( 'wp_print_footer_scripts', 'twentynineteen_skip_link_focus_fix' );
/**
* Enqueue supplemental block editor styles.
*/

View File

@ -40,8 +40,8 @@ if ( ! function_exists( 'twentynineteen_posted_by' ) ) :
*/
function twentynineteen_posted_by() {
printf(
'<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>',
/* translators: 1: SVG icon. 2: post author, only visible to screen readers. 3: author link. */
'<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>',
twentynineteen_get_icon_svg( 'person', 16 ),
__( 'Posted by', 'twentynineteen' ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
@ -85,8 +85,8 @@ if ( ! function_exists( 'twentynineteen_entry_footer' ) ) :
/* translators: used between list items, there is a space after the comma. */
$categories_list = get_the_category_list( __( ', ', 'twentynineteen' ) );
if ( $categories_list ) {
/* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of categories. */
printf(
/* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of categories. */
'<span class="cat-links">%1$s<span class="screen-reader-text">%2$s</span>%3$s</span>',
twentynineteen_get_icon_svg( 'archive', 16 ),
__( 'Posted in', 'twentynineteen' ),
@ -97,8 +97,8 @@ if ( ! function_exists( 'twentynineteen_entry_footer' ) ) :
/* translators: used between list items, there is a space after the comma. */
$tags_list = get_the_tag_list( '', __( ', ', 'twentynineteen' ) );
if ( $tags_list ) {
/* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of tags. */
printf(
/* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of tags. */
'<span class="tags-links">%1$s<span class="screen-reader-text">%2$s </span>%3$s</span>',
twentynineteen_get_icon_svg( 'tag', 16 ),
__( 'Tags:', 'twentynineteen' ),

View File

@ -3,6 +3,8 @@
*
* Helps with accessibility for keyboard only users.
*
* This is the source file for what is minified in the twentynineteen_skip_link_focus_fix() PHP function.
*
* Learn more: https://git.io/vWdr2
*/
( function() {

View File

@ -324,6 +324,7 @@
margin-top: calc(4 * #{ $size__spacing-unit});
margin-bottom: calc(4.33 * #{ $size__spacing-unit});
margin-right: 0;
padding-left: 0;
}
p {
@ -578,6 +579,10 @@
.blocks-gallery-item:last-child {
margin-bottom: 16px;
}
figcaption a {
color: #fff;
}
}
//! Captions

View File

@ -27,7 +27,8 @@ get_header();
// Parent post navigation.
the_post_navigation(
array(
'prev_text' => _x( '<span class="meta-nav">Published in</span><br/><span class="post-title">%title</span>', 'Parent post link', 'twentynineteen' ),
/* translators: %s: parent post link */
'prev_text' => sprintf( __( '<span class="meta-nav">Published in</span><span class="post-title">%s</span>', 'twentynineteen' ), '%title' ),
)
);
} elseif ( is_singular( 'post' ) ) {

View File

@ -3765,6 +3765,7 @@ body.page .main-navigation {
margin-top: calc(4 * 1rem);
margin-bottom: calc(4.33 * 1rem);
margin-left: 0;
padding-right: 0;
}
.entry .entry-content .wp-block-pullquote p {
@ -4047,6 +4048,10 @@ body.page .main-navigation {
margin-bottom: 16px;
}
.entry .entry-content .wp-block-gallery figcaption a {
color: #fff;
}
.entry .entry-content .wp-block-audio figcaption,
.entry .entry-content .wp-block-video figcaption,
.entry .entry-content .wp-block-image figcaption,

View File

@ -3777,6 +3777,7 @@ body.page .main-navigation {
margin-top: calc(4 * 1rem);
margin-bottom: calc(4.33 * 1rem);
margin-right: 0;
padding-left: 0;
}
.entry .entry-content .wp-block-pullquote p {
@ -4059,6 +4060,10 @@ body.page .main-navigation {
margin-bottom: 16px;
}
.entry .entry-content .wp-block-gallery figcaption a {
color: #fff;
}
.entry .entry-content .wp-block-audio figcaption,
.entry .entry-content .wp-block-video figcaption,
.entry .entry-content .wp-block-image figcaption,

View File

@ -10,6 +10,7 @@
if ( (bool) get_the_author_meta( 'description' ) ) : ?>
<div class="author-bio">
<h2 class="author-title">
<?php /* translators: %s: author name */ ?>
<span class="author-heading"><?php echo esc_html( sprintf( __( 'Published by %s', 'twentynineteen' ), get_the_author() ) ); ?></span>
</h2>
<p class="author-description">

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0.2-alpha-44195';
$wp_version = '5.0.2-alpha-44196';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.