[wp-trac] [WordPress Trac] #53940: Reconsider return types for `_get_cron_array()`.

WordPress Trac noreply at wordpress.org
Fri Jul 29 03:33:13 UTC 2022

#53940: Reconsider return types for `_get_cron_array()`.
 Reporter:  peterwilsoncc                        |       Owner:
                                                 |  peterwilsoncc
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  6.1
Component:  Cron API                             |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  good-first-bug has-patch has-unit-   |     Focuses:
  tests                                          |
Changes (by peterwilsoncc):

 * owner:  (none) => peterwilsoncc
 * status:  new => closed
 * resolution:   => fixed


 In [changeset:"53791" 53791]:
 #!CommitTicketReference repository="" revision="53791"
 Cron API: Modify `_get_cron_array()` to always return an array.

 Change the return type of `_get_cron_array()` to an empty array if the
 `cron` option is either missing or of an
 unexpected type.

 This change ensures the return value for no registered events is
 consistently an empty array. Previously the return
 value could be either an empty array or `false`.

 Props thakkarhardik, jrf, costdev.
 Fixes #53940.

Ticket URL: <https://core.trac.wordpress.org/ticket/53940#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list