Twenty Nineteen: Fixes and improvements.
This commit brings over several changes that occurred upstream in the theme’s GitHub repository into core. - 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 Props khleomix, grapplerulrich, iCaleb, kjellr, allancole. See #45424. Built from https://develop.svn.wordpress.org/branches/5.0@44199 git-svn-id: http://core.svn.wordpress.org/branches/5.0@44029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6cbfcdd7e4
commit
76cff5acd0
|
@ -33,36 +33,42 @@ 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'] );
|
||||
if ( 0 != $args['avatar_size'] ) {
|
||||
if ( empty( $comment_author_url ) ) {
|
||||
echo $avatar;
|
||||
} else {
|
||||
printf( '<a href="%s" rel="external nofollow" class="url">', $comment_author_url );
|
||||
echo $avatar;
|
||||
}
|
||||
$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;
|
||||
} else {
|
||||
printf( '<a href="%s" rel="external nofollow" class="url">', $comment_author_url );
|
||||
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.
|
||||
*/
|
||||
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 ) );
|
||||
}
|
||||
|
||||
/*
|
||||
* 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 */
|
||||
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>';
|
||||
}
|
||||
if ( ! empty( $comment_author_url ) ) {
|
||||
echo '</a>';
|
||||
}
|
||||
?>
|
||||
</div><!-- .comment-author -->
|
||||
|
||||
|
|
|
@ -28,38 +28,38 @@ $discussion = twentynineteen_get_discussion_data();
|
|||
<div class="<?php echo $discussion->responses > 0 ? 'comments-title-wrap' : 'comments-title-wrap no-responses'; ?>">
|
||||
<h2 class="comments-title">
|
||||
<?php
|
||||
if ( comments_open() ) {
|
||||
if ( have_comments() ) {
|
||||
_e( 'Join the Conversation', 'twentynineteen' );
|
||||
} else {
|
||||
_e( 'Leave a comment', 'twentynineteen' );
|
||||
}
|
||||
if ( comments_open() ) {
|
||||
if ( have_comments() ) {
|
||||
_e( 'Join the Conversation', 'twentynineteen' );
|
||||
} else {
|
||||
if ( '1' == $discussion->responses ) {
|
||||
/* translators: %s: post title */
|
||||
printf( _x( 'One reply on “%s”', 'comments title', 'twentynineteen' ), get_the_title() );
|
||||
} else {
|
||||
printf(
|
||||
/* translators: 1: number of comments, 2: post title */
|
||||
_nx(
|
||||
'%1$s reply on “%2$s”',
|
||||
'%1$s replies on “%2$s”',
|
||||
$discussion->responses,
|
||||
'comments title',
|
||||
'twentynineteen'
|
||||
),
|
||||
number_format_i18n( $discussion->responses ),
|
||||
get_the_title()
|
||||
);
|
||||
}
|
||||
_e( 'Leave a comment', 'twentynineteen' );
|
||||
}
|
||||
} else {
|
||||
if ( '1' == $discussion->responses ) {
|
||||
/* translators: %s: post title */
|
||||
printf( _x( 'One reply on “%s”', 'comments title', 'twentynineteen' ), get_the_title() );
|
||||
} else {
|
||||
printf(
|
||||
/* translators: 1: number of comments, 2: post title */
|
||||
_nx(
|
||||
'%1$s reply on “%2$s”',
|
||||
'%1$s replies on “%2$s”',
|
||||
$discussion->responses,
|
||||
'comments title',
|
||||
'twentynineteen'
|
||||
),
|
||||
number_format_i18n( $discussion->responses ),
|
||||
get_the_title()
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
</h2><!-- .comments-title -->
|
||||
<?php
|
||||
// Only show discussion meta information when comments are open and available.
|
||||
if ( have_comments() && comments_open() ) {
|
||||
if ( have_comments() && comments_open() ) {
|
||||
get_template_part( 'template-parts/post/discussion', 'meta' );
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div><!-- .comments-title-flex -->
|
||||
<?php
|
||||
|
|
|
@ -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';
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -529,10 +529,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;
|
||||
|
|
|
@ -3968,10 +3968,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) {
|
||||
|
|
|
@ -3980,10 +3980,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) {
|
||||
|
|
|
@ -10,8 +10,15 @@
|
|||
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>
|
||||
<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' ); ?>
|
||||
|
|
|
@ -17,7 +17,6 @@ if ( $has_responses ) {
|
|||
} else {
|
||||
$meta_label = __( 'No comments', 'twentynineteen' );
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="discussion-meta">
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.0.2-alpha-44198';
|
||||
$wp_version = '5.0.2-alpha-44199';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue