Skip to content

Commit

Permalink
Add post title to edit_post_link
Browse files Browse the repository at this point in the history
* Use `__()` instead of `_x()`
* Add translator comment, remove context modifier.
* Remove escaping on `the_title()`; it's trusted data.

Resolves: Automattic#774
  • Loading branch information
davidakennedy committed Jul 2, 2015
1 parent c60811b commit 0a0e5c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@ function _s_entry_footer() {

edit_post_link(
sprintf(
esc_html_x( 'Edit %s', 'name of current post', '_s' ),
wp_kses( the_title( '<span class="screen-reader-text">"', '"</span>', false ), array( 'span' => array( 'class' => array() ) ) )
/* translators: %s: Name of current post */
esc_html__( 'Edit %s', '_s' ),
the_title( '<span class="screen-reader-text">"', '"</span>', false )
),
'<span class="edit-link">',
'</span>'
Expand Down
5 changes: 3 additions & 2 deletions template-parts/content-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
<?php
edit_post_link(
sprintf(
esc_html_x( 'Edit %s', 'name of current post', '_s' ),
wp_kses( the_title( '<span class="screen-reader-text">"', '"</span>', false ), array( 'span' => array( 'class' => array() ) ) )
/* translators: %s: Name of current post */
esc_html__( 'Edit %s', '_s' ),
the_title( '<span class="screen-reader-text">"', '"</span>', false )
),
'<span class="edit-link">',
'</span>'
Expand Down

0 comments on commit 0a0e5c6

Please sign in to comment.