Skip to content

Commit

Permalink
Merge pull request #775 from davidakennedy/editlinkposttitle
Browse files Browse the repository at this point in the history
Add post title to `edit_post_link`
  • Loading branch information
sarahmonster committed Sep 16, 2015
2 parents 8cd7903 + 78147d4 commit b1b13f5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
10 changes: 9 additions & 1 deletion inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
12 changes: 11 additions & 1 deletion template-parts/content-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.