Skip to content
This repository has been archived by the owner on May 23, 2018. It is now read-only.

Commit

Permalink
Move Screen Reader Text Span Inside the Translation String for Edit Link
Browse files Browse the repository at this point in the history
  • Loading branch information
iamtakashi committed Nov 19, 2015
1 parent 4d57bac commit cdee602
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions image.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@
edit_post_link(
sprintf(
/* translators: %s: Name of current post */
__( 'Edit %s', 'twentysixteen' ),
the_title( '<span class="screen-reader-text">', '</span>', false )
__( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ),
the_title( '', '', false )
),
'<span class="edit-link">',
'</span>'
Expand Down
4 changes: 2 additions & 2 deletions template-parts/content-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
edit_post_link(
sprintf(
/* translators: %s: Name of current post */
__( 'Edit %s', 'twentysixteen' ),
the_title( '<span class="screen-reader-text">', '</span>', false )
__( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ),
the_title( '', '', false )
),
'<footer class="entry-footer"><span class="edit-link">',
'</span></footer><!-- .entry-footer -->'
Expand Down
8 changes: 4 additions & 4 deletions template-parts/content-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
edit_post_link(
sprintf(
/* translators: %s: Name of current post */
__( 'Edit %s', 'twentysixteen' ),
the_title( '<span class="screen-reader-text">"', '"</span>', false )
__( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ),
the_title( '', '', false )
),
'<span class="edit-link">',
'</span>'
Expand All @@ -40,8 +40,8 @@
edit_post_link(
sprintf(
/* translators: %s: Name of current post */
__( 'Edit %s', 'twentysixteen' ),
the_title( '<span class="screen-reader-text">', '</span>', false )
__( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ),
the_title( '', '', false )
),
'<footer class="entry-footer"><span class="edit-link">',
'</span></footer><!-- .entry-footer -->'
Expand Down
4 changes: 2 additions & 2 deletions template-parts/content-single.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
edit_post_link(
sprintf(
/* translators: %s: Name of current post */
__( 'Edit %s', 'twentysixteen' ),
the_title( '<span class="screen-reader-text">', '</span>', false )
__( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ),
the_title( '', '', false )
),
'<span class="edit-link">',
'</span>'
Expand Down
8 changes: 4 additions & 4 deletions template-parts/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
<?php
/* translators: %s: Name of current post */
the_content( sprintf(
__( 'Continue reading %s', 'twentysixteen' ),
the_title( '<span class="screen-reader-text">"', '"</span>', false )
__( 'Continue reading<span class="screen-reader-text"> %s</span>', 'twentysixteen' ),
the_title( '', '', false )
) );

wp_link_pages( array(
Expand All @@ -46,8 +46,8 @@
edit_post_link(
sprintf(
/* translators: %s: Name of current post */
__( 'Edit %s', 'twentysixteen' ),
the_title( '<span class="screen-reader-text">', '</span>', false )
__( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ),
the_title( '', '', false )
),
'<span class="edit-link">',
'</span>'
Expand Down

4 comments on commit cdee602

@mtomas7
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iamtakashi Hi, I'm using default themes to learn and in this particular instance I don't know for sure what was the benefit of this change as in Underscores it is the old way. Could you explain it in few words?

I could guess that it allows translator to alter the class name if there is a need?

Thank you!

@DannyCooper
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mtomas7 @iamtakashi I'm also interested in finding out why this was done this way for learning purposes.

@mtomas7
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DannyCooper please see: #383

@DannyCooper
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @mtomas7, I appreciate your response.

Please sign in to comment.