Make WordPress Core

Changeset 62000


Ignore:
Timestamp:
03/13/2026 01:36:00 AM (4 months ago)
Author:
westonruter
Message:

Twenty Seventeen: Restore $post_id parameter to twentyseventeen_edit_link() which is being passed in some templates.

This addresses arguments.count errors identified by PHPStan at rule level 1.

Developed in https://github.com/WordPress/wordpress-develop/pull/11242

Follow-up to WordPress/twentyseventeen commits: 1afb73c, 7dd3025, 6948288.

Props sabernhardt, westonruter.
See #64680.
Fixes #64825.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyseventeen/inc/template-tags.php

    r61302 r62000  
    111111if ( ! function_exists( 'twentyseventeen_edit_link' ) ) :
    112112        /**
    113          * Returns an accessibility-friendly link to edit a post or page.
    114          *
    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.
    119          */
    120         function twentyseventeen_edit_link() {
     113         * Displays an accessibility-friendly link to edit a post or page.
     114         *
     115         * @since Twenty Seventeen 1.0
     116         * @since Twenty Seventeen 4.1 Added `$post_id` parameter.
     117         *
     118         * @param int $post_id Post ID. Default 0.
     119         */
     120        function twentyseventeen_edit_link( $post_id = 0 ) {
    121121                edit_post_link(
    122122                        sprintf(
    123123                                /* translators: %s: Post title. Only visible to screen readers. */
    124124                                __( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),
    125                                 get_the_title()
     125                                get_the_title( $post_id )
    126126                        ),
    127127                        '<span class="edit-link">',
    128                         '</span>'
     128                        '</span>',
     129                        $post_id
    129130                );
    130131        }
Note: See TracChangeset for help on using the changeset viewer.