[wp-trac] [WordPress Trac] #64825: Twenty Seventeen: twentyseventeen_edit_link() function passed
WordPress Trac
noreply at wordpress.org
Sat Mar 7 04:01:44 UTC 2026
#64825: Twenty Seventeen: twentyseventeen_edit_link() function passed
--------------------------+-------------------------
Reporter: westonruter | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 7.0
Component: Themes | Version: 4.7
Severity: minor | Keywords: needs-patch
Focuses: |
--------------------------+-------------------------
As part of #64680 to increase the PHPStan rule level to 1
([https://github.com/WordPress/wordpress-develop/pull/11151 PR]), PHPStan
identified that Twenty Seventeen is passing `get_the_ID()` into
`twentyseventeen_edit_link()`. Nevertheless, this function does not take
any parameters. I had [https://github.com/WordPress/wordpress-
develop/pull/11151/commits/680d165e5fc662f16ea2530cdf302053119f4c40
removed the argument from being passed], but I wondered if the fact that
it is a pluggable function could cause issues for child themes that may
have overridden that function //and// is doing something with the
parameter.
As [https://github.com/WordPress/wordpress-
develop/pull/11151#discussion_r2898835532 discovered] by @sabernhardt:
> I wondered why the function did not have a parameter and then found out
it had an `$id` parameter in the
[https://github.com/WordPress/twentyseventeen/blob/69482880b4ae2ec145f60df417423665581a5653/inc
/template-tags.php#L104-L128 initial commit]. But then the
[https://github.com/WordPress/twentyseventeen/commit/7dd302582df46f6bb6b79fd7bb6344cad0eff698
#diff-88ec0e9d51b04231a448a06c40ced21810e85361ced9481a9248f1075226c6aa
page/post context was removed], and the
[https://github.com/WordPress/twentyseventeen/commit/1afb73cbe99e6fd40fc6d2440500f197ccf92684
parameter was removed] before the function was ever pluggable (and before
version 1.0). Also, the [https://github.com/WordPress/wordpress-
develop/blob/58f200894cd6c6237a39e7a3fcdd7dfd7af9aabe/src/wp-
content/themes/twentyseventeen/inc/template-tags.php#L115-L118 comment
about context] does not seem appropriate.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64825>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list