Skip to content

Commit

Permalink
Multiple themes Fixes theme screen reader including text inside card.
Browse files Browse the repository at this point in the history
The function twentysixteen_entry_meta included screen reader text inside the span property using the author mf class. This resolves that in both Twenty Sixteen and Twenty Fifteen. It should have the screen reader text inside the byline span but outside the author vcard span.

Props dshanske, laurelfulford, sabernhardt, shilu25.
Fixes #46233.


git-svn-id: https://develop.svn.wordpress.org/trunk@58771 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
karmatosed committed Jul 20, 2024
1 parent 60f9f87 commit 450de6b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentyfifteen/inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function twentyfifteen_entry_meta() {
if ( 'post' === get_post_type() ) {
if ( is_singular() || is_multi_author() ) {
printf(
'<span class="byline"><span class="author vcard"><span class="screen-reader-text">%1$s </span><a class="url fn n" href="%2$s">%3$s</a></span></span>',
'<span class="byline"><span class="screen-reader-text">%1$s </span><span class="author vcard"><a class="url fn n" href="%2$s">%3$s</a></span></span>',
/* translators: Hidden accessibility text. */
_x( 'Author', 'Used before post author name.', 'twentyfifteen' ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentysixteen/inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function twentysixteen_entry_meta() {
if ( 'post' === get_post_type() ) {
$author_avatar_size = apply_filters( 'twentysixteen_author_avatar_size', 49 );
printf(
'<span class="byline"><span class="author vcard">%1$s<span class="screen-reader-text">%2$s </span> <a class="url fn n" href="%3$s">%4$s</a></span></span>',
'<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>',
get_avatar( get_the_author_meta( 'user_email' ), $author_avatar_size ),
/* translators: Hidden accessibility text. */
_x( 'Author', 'Used before post author name.', 'twentysixteen' ),
Expand Down

0 comments on commit 450de6b

Please sign in to comment.