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
- Fixes some minor code quality issues. https://github.com/WordPress/twentynineteen/pull/237
- Fix PHP Warning: Parameter must be an array or an object that implements Countable. https://github
.com/WordPress/twentynineteen/pull/661
- Add missing text domain and escaping to comment author text. https://github.com/WordPress/twentynineteen/pull/274
- Remove hyphens rule for cover image text. https://github.com/WordPress/twentynineteen/pull/691
- Fix left/right-aligned pullquote spacing. https://github.com/WordPress/twentynineteen/pull/695
- Improve `readme.txt` to follow the correct standards for themes. https://github.com/WordPress/twentynineteen/issues/689

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

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

Fixes #45424.
Built from https://develop.svn.wordpress.org/trunk@44305


git-svn-id: http://core.svn.wordpress.org/trunk@44135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2018-12-19 03:24:11 +00:00
parent 7cbba801e2
commit a2845863e5
15 changed files with 155 additions and 111 deletions

View File

@ -33,10 +33,10 @@ class TwentyNineteen_Walker_Comment extends Walker_Comment {
<footer class="comment-meta">
<div class="comment-author vcard">
<?php
$comment_author_link = get_comment_author_link( $comment );
$comment_author_url = get_comment_author_url( $comment );
$comment_author = get_comment_author( $comment );
$avatar = get_avatar( $comment, $args['avatar_size'] );
$comment_author_link = get_comment_author_link( $comment );
$comment_author_url = get_comment_author_url( $comment );
$comment_author = get_comment_author( $comment );
$avatar = get_avatar( $comment, $args['avatar_size'] );
if ( 0 != $args['avatar_size'] ) {
if ( empty( $comment_author_url ) ) {
echo $avatar;
@ -45,21 +45,34 @@ class TwentyNineteen_Walker_Comment extends Walker_Comment {
echo $avatar;
}
}
/*
* Using the `check` icon instead of `check_circle`, since we can't add a
* fill color to the inner check shape when in circle form.
*/
/*
* Using the `check` icon instead of `check_circle`, since we can't add a
* 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 ) );
}
printf(
/* translators: %s: comment author link */
/*
* Using the `check` icon instead of `check_circle`, since we can't add a
* fill color to the inner check shape when in circle form.
*/
if ( twentynineteen_is_comment_by_post_author( $comment ) ) {
printf( '<span class="post-author-badge" aria-hidden="true">%s</span>', twentynineteen_get_icon_svg( 'check', 24 ) );
}
printf(
/* translators: %s: comment author link */
wp_kses(
__( '%s <span class="screen-reader-text says">says:</span>', 'twentynineteen' ),
sprintf( '<span class="fn">%s</span>', $comment_author )
);
array(
'span' => array(
'class' => array(),
),
)
),
'<b class="fn">' . get_comment_author_link( $comment ) . '</b>'
);
if ( ! empty( $comment_author_url ) ) {
echo '</a>';
@ -110,5 +123,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

@ -37,7 +37,7 @@
$discussion = ! is_page() && twentynineteen_can_show_post_thumbnail() ? twentynineteen_get_discussion_data() : null;
$classes = 'entry-header';
if ( ! empty( $discussion ) && count( $discussion->responses ) > 0 ) {
if ( ! empty( $discussion ) && absint( $discussion->responses ) > 0 ) {
$classes = 'entry-header has-discussion';
}
?>

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

@ -1,64 +1,22 @@
# Twenty Nineteen
=== Twenty Nineteen ===
Contributors: the WordPress team
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
Requires at least: 4.9.6
Tested up to: 5.0
Stable tag: 1.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
[![Build Status](https://travis-ci.org/WordPress/twentynineteen.svg?branch=master)](https://travis-ci.org/WordPress/twentynineteen)
Our 2019 default theme is designed to show off the power of the block editor.
**Contributors:** the WordPress team
**Requires at least:** WordPress 4.9.6
**Tested up to:** WordPress 4.9.8
**Version:** 1.0
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
**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
== Description ==
Our 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 youre 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.
## Description
== Changelog ==
Twenty Nineteen is a Gutenberg-ready theme for WordPress.
= 1.0 =
* Initial Release
## Installation
1. In your admin panel, go to Appearance -> Themes and click the 'Add New' button.
2. Type in Twenty Nineteen in the search form and press the 'Enter' key on your keyboard.
3. Click on the 'Activate' button to use your new theme right away.
4. Go to https://codex.wordpress.org/Twenty_Nineteen for a guide on how to customize this theme.
5. Navigate to Appearance > Customize in your admin panel and customize to taste.
## Copyright
Twenty Nineteen WordPress Theme, Copyright 2018 WordPress.org
Twenty Nineteen is distributed under the terms of the GNU GPL.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Twenty Nineteen bundles the following third-party resources:
_s, Copyright 2015-2018 Automattic, Inc.
**License:** GPLv2 or later
Source: https://github.com/Automattic/_s/
normalize.css, Copyright 2012-2016 Nicolas Gallagher and Jonathan Neal
**License:** MIT
Source: https://necolas.github.io/normalize.css/
Bundled header image 1, Copyright XXXXX XXXXX
**License:** CC0 1.0 Universal (CC0 1.0)
Source: https://pexels.com/xxxxxxxxxx
Bundled header image 2, Copyright XXXXX XXXXX
**License:** CC0 1.0 Universal (CC0 1.0)
Source: https://pexels.com/xxxxxxxxxx
## Changelog
### 1.0
* Released: December 6, 2018
Initial release
== Resources ==
* normalize.css, © 2012-2018 Nicolas Gallagher and Jonathan Neal, MIT
* Underscores, © 2012-2018 Automattic, Inc., GNU GPL v2 or later

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 {
@ -362,10 +363,14 @@
padding: 0;
blockquote {
margin-left: 0;
margin: $size__spacing-unit 0;
padding: 0;
text-align: left;
max-width: 100%;
p:first-child {
margin-top: 0;
}
}
}
@ -399,10 +404,11 @@
}
blockquote {
max-width: calc(100% - (2 * #{$size__spacing-unit}));
max-width: 100%;
color: $color__background-body;
padding-left: 0;
margin-left: $size__spacing-unit;
margin-right: $size__spacing-unit;
&.has-text-color p,
&.has-text-color a,
@ -420,6 +426,14 @@
}
}
&.alignright,
&.alignleft {
@include media(tablet) {
padding: $size__spacing-unit calc(2 * #{$size__spacing-unit});
}
}
&.alignfull {
@include media(tablet) {
@ -528,10 +542,6 @@
line-height: 1.25;
padding: 0;
color: #fff;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
hyphens: auto;
@include media(tablet) {
font-size: $font__size-xl;
@ -544,7 +554,7 @@
width: 100%;
@include media(tablet) {
padding: $size__spacing-unit;
padding: $size__spacing-unit calc(2 * #{$size__spacing-unit});
}
}
@ -578,6 +588,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

@ -332,12 +332,19 @@ figcaption,
.wp-block[data-type="core/cover"][data-align="right"] .wp-block-cover {
width: 100%;
max-width: 100%;
padding: calc(1.375 * 1rem);
}
.wp-block[data-type="core/cover"][data-align="left"] .wp-block-cover p,
.wp-block[data-type="core/cover"][data-align="right"] .wp-block-cover p {
padding-left: 0;
padding-right: 0;
}
@media only screen and (min-width: 768px) {
.wp-block[data-type="core/cover"][data-align="left"] .wp-block-cover,
.wp-block[data-type="core/cover"][data-align="right"] .wp-block-cover {
padding: 1rem;
padding: calc(2.75 * 1rem) calc(2.75 * 1rem) calc(3.125 * 1rem);
}
}
@ -760,5 +767,5 @@ ul.wp-block-archives li ul,
/* Make sure our non-latin font overrides don't overwrite the iconfont used in the classic editor toolbar */
.wp-block[data-type="core/freeform"] .mce-btn i {
font-family: dashicons !important;
font-family: dashicons !important;
}

View File

@ -294,12 +294,15 @@ figcaption,
.wp-block-cover {
width: 100%;
max-width: 100%;
}
padding: calc(1.375 * #{$size__spacing-unit});
@include media(tablet) {
p {
padding-left: 0;
padding-right: 0;
}
.wp-block-cover {
padding: $size__spacing-unit;
@include media(tablet) {
padding: calc(2.75 * #{$size__spacing-unit}) calc(2.75 * #{$size__spacing-unit}) calc(3.125 * #{$size__spacing-unit});
}
}
}

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 {
@ -3804,12 +3805,16 @@ body.page .main-navigation {
}
.entry .entry-content .wp-block-pullquote.alignleft blockquote, .entry .entry-content .wp-block-pullquote.alignright blockquote {
margin-right: 0;
margin: 1rem 0;
padding: 0;
text-align: right;
max-width: 100%;
}
.entry .entry-content .wp-block-pullquote.alignleft blockquote p:first-child, .entry .entry-content .wp-block-pullquote.alignright blockquote p:first-child {
margin-top: 0;
}
.entry .entry-content .wp-block-pullquote.is-style-solid-color {
background-color: #0073aa;
padding-right: 0;
@ -3845,10 +3850,11 @@ body.page .main-navigation {
}
.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote {
max-width: calc(100% - (2 * 1rem));
max-width: 100%;
color: #fff;
padding-right: 0;
margin-right: 1rem;
margin-left: 1rem;
}
.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-text-color p,
@ -3863,6 +3869,12 @@ body.page .main-navigation {
}
}
@media only screen and (min-width: 768px) {
.entry .entry-content .wp-block-pullquote.is-style-solid-color.alignright, .entry .entry-content .wp-block-pullquote.is-style-solid-color.alignleft {
padding: 1rem calc(2 * 1rem);
}
}
@media only screen and (min-width: 768px) {
.entry .entry-content .wp-block-pullquote.is-style-solid-color.alignfull {
padding-right: calc(10% + 58px + (2 * 1rem));
@ -3967,10 +3979,6 @@ body.page .main-navigation {
line-height: 1.25;
padding: 0;
color: #fff;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
hyphens: auto;
}
@media only screen and (min-width: 768px) {
@ -3995,7 +4003,7 @@ body.page .main-navigation {
.entry .entry-content .wp-block-cover-image.alignleft, .entry .entry-content .wp-block-cover-image.alignright,
.entry .entry-content .wp-block-cover.alignleft,
.entry .entry-content .wp-block-cover.alignright {
padding: 1rem;
padding: 1rem calc(2 * 1rem);
}
}
@ -4047,6 +4055,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 {
@ -3816,12 +3817,16 @@ body.page .main-navigation {
}
.entry .entry-content .wp-block-pullquote.alignleft blockquote, .entry .entry-content .wp-block-pullquote.alignright blockquote {
margin-left: 0;
margin: 1rem 0;
padding: 0;
text-align: left;
max-width: 100%;
}
.entry .entry-content .wp-block-pullquote.alignleft blockquote p:first-child, .entry .entry-content .wp-block-pullquote.alignright blockquote p:first-child {
margin-top: 0;
}
.entry .entry-content .wp-block-pullquote.is-style-solid-color {
background-color: #0073aa;
padding-left: 0;
@ -3857,10 +3862,11 @@ body.page .main-navigation {
}
.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote {
max-width: calc(100% - (2 * 1rem));
max-width: 100%;
color: #fff;
padding-left: 0;
margin-left: 1rem;
margin-right: 1rem;
}
.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-text-color p,
@ -3875,6 +3881,12 @@ body.page .main-navigation {
}
}
@media only screen and (min-width: 768px) {
.entry .entry-content .wp-block-pullquote.is-style-solid-color.alignright, .entry .entry-content .wp-block-pullquote.is-style-solid-color.alignleft {
padding: 1rem calc(2 * 1rem);
}
}
@media only screen and (min-width: 768px) {
.entry .entry-content .wp-block-pullquote.is-style-solid-color.alignfull {
padding-left: calc(10% + 58px + (2 * 1rem));
@ -3979,10 +3991,6 @@ body.page .main-navigation {
line-height: 1.25;
padding: 0;
color: #fff;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
hyphens: auto;
}
@media only screen and (min-width: 768px) {
@ -4007,7 +4015,7 @@ body.page .main-navigation {
.entry .entry-content .wp-block-cover-image.alignleft, .entry .entry-content .wp-block-cover-image.alignright,
.entry .entry-content .wp-block-cover.alignleft,
.entry .entry-content .wp-block-cover.alignright {
padding: 1rem;
padding: 1rem calc(2 * 1rem);
}
}
@ -4059,6 +4067,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,7 +10,15 @@
if ( (bool) get_the_author_meta( 'description' ) ) : ?>
<div class="author-bio">
<h2 class="author-title">
<span class="author-heading"><?php echo esc_html( sprintf( __( 'Published by %s', 'twentynineteen' ), get_the_author() ) ); ?></span>
<span class="author-heading">
<?php
printf(
/* translators: %s: post author */
__( 'Published by %s', 'twentynineteen' ),
esc_html( get_the_author() )
);
?>
</span>
</h2>
<p class="author-description">
<?php the_author_meta( 'description' ); ?>

View File

@ -17,7 +17,6 @@ if ( $has_responses ) {
} else {
$meta_label = __( 'No comments', 'twentynineteen' );
}
?>
<div class="discussion-meta">

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.1-alpha-44304';
$wp_version = '5.1-alpha-44305';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.