Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/wp-content/themes/twentyseventeen/inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,22 +110,23 @@ function twentyseventeen_entry_footer() {

if ( ! function_exists( 'twentyseventeen_edit_link' ) ) :
/**
* Returns an accessibility-friendly link to edit a post or page.
* Displays an accessibility-friendly link to edit a post or page.
*
* This also gives a little context about what exactly we're editing
* (post or page?) so that users understand a bit more where they are in terms
* of the template hierarchy and their content. Helpful when/if the single-page
* layout with multiple posts/pages shown gets confusing.
* @since Twenty Seventeen 1.0
* @since Twenty Seventeen 4.1 Added `$post_id` parameter.
*
* @param int $post_id Post ID. Default 0.
*/
function twentyseventeen_edit_link() {
function twentyseventeen_edit_link( $post_id = 0 ) {
edit_post_link(
sprintf(
/* translators: %s: Post title. Only visible to screen readers. */
__( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),
get_the_title()
get_the_title( $post_id )
),
'<span class="edit-link">',
'</span>'
'</span>',
$post_id
);
}
endif;
Expand Down
Loading