Add post title to edit_post_link
This improves the accessibility of these links, and gives more context for screen reader users. Now, they know exactly where the link goes. Escaped output with `esc_html_x` and `wp_kses`. Resolves: #774
This commit is contained in:
parent
5bb0534358
commit
c60811bf94
2 changed files with 18 additions and 2 deletions
|
@ -23,7 +23,16 @@
|
|||
</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(
|
||||
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() ) ) )
|
||||
),
|
||||
'<span class="edit-link">',
|
||||
'</span>'
|
||||
);
|
||||
?>
|
||||
</footer><!-- .entry-footer -->
|
||||
</article><!-- #post-## -->
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue