Skip to content
Permalink
Browse files

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. WordPress/twentynineteen#237
- Fix PHP Warning: Parameter must be an array or an object that implements Countable. WordPress/twentynineteen#661
- Add missing text domain and escaping to comment author text. WordPress/twentynineteen#274
- Remove hyphens rule for cover image text. WordPress/twentynineteen#691

Props khleomix, grapplerulrich, iCaleb, kjellr, allancole.

See #45424.

git-svn-id: https://develop.svn.wordpress.org/branches/5.0@44199 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
desrosj committed Dec 14, 2018
1 parent 6ae98f3 commit 73894e612eb533b3ced3d9cb021203a35f3ba11a
@@ -33,36 +33,42 @@ protected function html5_comment( $comment, $depth, $args ) {
<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 @@
<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 {
_e( 'Leave a comment', 'twentynineteen' );
}
} else {
if ( '1' == $discussion->responses ) {
/* translators: %s: post title */
printf( _x( 'One reply on &ldquo;%s&rdquo;', 'comments title', 'twentynineteen' ), get_the_title() );
} else {
if ( '1' == $discussion->responses ) {
/* translators: %s: post title */
printf( _x( 'One reply on &ldquo;%s&rdquo;', 'comments title', 'twentynineteen' ), get_the_title() );
} else {
printf(
/* translators: 1: number of comments, 2: post title */
_nx(
'%1$s reply on &ldquo;%2$s&rdquo;',
'%1$s replies on &ldquo;%2$s&rdquo;',
$discussion->responses,
'comments title',
'twentynineteen'
),
number_format_i18n( $discussion->responses ),
get_the_title()
);
}
printf(
/* translators: 1: number of comments, 2: post title */
_nx(
'%1$s reply on &ldquo;%2$s&rdquo;',
'%1$s replies on &ldquo;%2$s&rdquo;',
$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 @@
} else {
$meta_label = __( 'No comments', 'twentynineteen' );
}
?>

<div class="discussion-meta">

0 comments on commit 73894e6

Please sign in to comment.
You can’t perform that action at this time.