[wp-trac] [WordPress Trac] #40006: $response var in comments not an array but an object

WordPress Trac noreply at wordpress.org
Fri Nov 19 21:49:31 UTC 2021


#40006: $response var in comments not an array but an object
-----------------------------+-----------------------
 Reporter:  davidmosterd     |       Owner:  audrasjb
     Type:  enhancement      |      Status:  reopened
 Priority:  normal           |   Milestone:  5.9
Component:  Upgrade/Install  |     Version:  3.8
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:  docs
-----------------------------+-----------------------
Changes (by SergeyBiryukov):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 It looks like [52212] accidentally reverts [51733], will commit a fix
 shortly.

 Replying to [comment:14 costdev]:
 >   @type string $requires    Required WordPress version.
 >   @type string $tested      Higher WordPress version the plugin has been
 tested with.
 >
 > For consistency with another docblock in core (see `src/wp-
 admin/includes/plugin.php:33`), I suggest:
 >
 >   @type string $requires    Specify the minimum required WordPress
 version.
 >   @type string $tested      Specify the latest version of WordPress that
 the plugin has been tested with.

 Thanks! Consistency is great, but that DocBlock is an example of plugin
 headers, which is why it says "specify". Since we're dealing with a
 `do_action()` call here, this is not the place to specify these values, we
 can only work with whatever values are already passed in the `$response`
 object. So I think in this case it would be better to follow the DocBlock
 for the return result of `get_plugin_data()`, or  the DocBlock for the
 `update_plugins_{$hostname}` filter, which documents pretty much the same
 values.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/40006#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list