From 88ac85d240a318dc52a4056da3c7213cbedd5980 Mon Sep 17 00:00:00 2001 From: "Stephen A. Bernhardt" Date: Thu, 12 Mar 2026 16:12:31 -0500 Subject: [PATCH 1/2] Add parameter to `twentyseventeen_edit_link()` --- .../themes/twentyseventeen/inc/template-tags.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/wp-content/themes/twentyseventeen/inc/template-tags.php b/src/wp-content/themes/twentyseventeen/inc/template-tags.php index 6cdb6c6be5a53..49f5481d20f60 100644 --- a/src/wp-content/themes/twentyseventeen/inc/template-tags.php +++ b/src/wp-content/themes/twentyseventeen/inc/template-tags.php @@ -110,22 +110,20 @@ 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. + * @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 "%s"', 'twentyseventeen' ), - get_the_title() + get_the_title( $post_id ) ), '', - '' + '', + $post_id ); } endif; From 9bce81f1b7dbc32e82e2fd362428b6cadcbae51d Mon Sep 17 00:00:00 2001 From: "Stephen A. Bernhardt" Date: Thu, 12 Mar 2026 17:04:02 -0500 Subject: [PATCH 2/2] Add `@since` documentation --- src/wp-content/themes/twentyseventeen/inc/template-tags.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wp-content/themes/twentyseventeen/inc/template-tags.php b/src/wp-content/themes/twentyseventeen/inc/template-tags.php index 49f5481d20f60..0a543e16a4010 100644 --- a/src/wp-content/themes/twentyseventeen/inc/template-tags.php +++ b/src/wp-content/themes/twentyseventeen/inc/template-tags.php @@ -112,6 +112,9 @@ function twentyseventeen_entry_footer() { /** * Displays an accessibility-friendly link to edit a post or page. * + * @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( $post_id = 0 ) {