[wp-trac] [WordPress Trac] #40006: $response var in comments not an array but an object
WordPress Trac
noreply at wordpress.org
Fri Jun 18 10:05:56 UTC 2021
#40006: $response var in comments not an array but an object
-------------------------------------+-----------------------------
Reporter: davidmosterd | Owner: SergeyBiryukov
Type: enhancement | Status: reviewing
Priority: normal | Milestone: 5.9
Component: Upgrade/Install | Version: 3.8
Severity: normal | Resolution:
Keywords: has-patch needs-testing | Focuses: docs
-------------------------------------+-----------------------------
Changes (by SergeyBiryukov):
* owner: (none) => SergeyBiryukov
* status: new => reviewing
* version: => 3.8
* milestone: Awaiting Review => 5.9
Comment:
Hi there, welcome to WordPress Trac!
Thanks for the ticket, sorry it took so long for someone to get back to
you.
Setting the version to 3.8, as the documentation was added in [26540] /
#26252.
The `in_plugin_update_message-{$file}` action itself was added in [11193]
/ #9553.
A corresponding `in_theme_update_message-{$theme_key}` action for themes
was added in [16141] / #14897.
It looks like the `$response` parameter here is an object for plugins, but
is indeed an array for themes. I think it's worth discussing whether we
want to make it consistent for both, i.e. make it an array for plugins
too, to match the documented value.
On second thought, since the action was added more than 12 years ago,
changing the parameter type now would break any custom code relying on it
being an object, so perhaps we should just accept the inconsistency and
correct the documentation as suggested in [attachment:"40006.diff"]. A
brief [https://wpdirectory.net/search/01F8F93779ATV137P7FVYH4H5J search in
the Plugin Directory] shows that the action is used in quite a few
plugins.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40006#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list