Permalink
Browse files

Merge pull request #775 from davidakennedy/editlinkposttitle

Add post title to `edit_post_link`
  • Loading branch information...
sarahmonster committed Sep 16, 2015
2 parents 8cd7903 + 78147d4 commit b1b13f58d8ad90b293beb474ca83766be2a51ff2
Showing with 20 additions and 2 deletions.
  1. +9 −1 inc/template-tags.php
  2. +11 −1 template-parts/content-page.php
View
@@ -65,7 +65,15 @@ function _s_entry_footer() {
echo '</span>';
}
- edit_post_link( esc_html__( 'Edit', '_s' ), '<span class="edit-link">', '</span>' );
+ edit_post_link(
+ sprintf(
+ /* 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>'
+ );
}
endif;
@@ -25,7 +25,17 @@
</div><!-- .entry-content -->
<footer class="entry-footer">
- <?php edit_post_link( esc_html__( 'Edit', '_s' ), '<span class="edit-link">', '</span>' ); ?>
+ <?php
+ edit_post_link(
+ sprintf(
+ /* 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>'
+ );
+ ?>
</footer><!-- .entry-footer -->
</article><!-- #post-## -->

0 comments on commit b1b13f5

Please sign in to comment.