Skip to content

Commit 88ac85d

Browse files
authored
Add parameter to twentyseventeen_edit_link()
1 parent e9b452a commit 88ac85d

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

src/wp-content/themes/twentyseventeen/inc/template-tags.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,22 +110,20 @@ function twentyseventeen_entry_footer() {
110110

111111
if ( ! function_exists( 'twentyseventeen_edit_link' ) ) :
112112
/**
113-
* Returns an accessibility-friendly link to edit a post or page.
113+
* Displays an accessibility-friendly link to edit a post or page.
114114
*
115-
* This also gives a little context about what exactly we're editing
116-
* (post or page?) so that users understand a bit more where they are in terms
117-
* of the template hierarchy and their content. Helpful when/if the single-page
118-
* layout with multiple posts/pages shown gets confusing.
115+
* @param int $post_id Post ID. Default 0.
119116
*/
120-
function twentyseventeen_edit_link() {
117+
function twentyseventeen_edit_link( $post_id = 0 ) {
121118
edit_post_link(
122119
sprintf(
123120
/* translators: %s: Post title. Only visible to screen readers. */
124121
__( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),
125-
get_the_title()
122+
get_the_title( $post_id )
126123
),
127124
'<span class="edit-link">',
128-
'</span>'
125+
'</span>',
126+
$post_id
129127
);
130128
}
131129
endif;

0 commit comments

Comments
 (0)