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
|
@ -123,7 +123,14 @@ function _s_entry_footer() {
|
|||
echo '</span>';
|
||||
}
|
||||
|
||||
edit_post_link( esc_html__( 'Edit', '_s' ), '<span class="edit-link">', '</span>' );
|
||||
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>'
|
||||
);
|
||||
}
|
||||
endif;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue