[wp-trac] [WordPress Trac] #57744: wp_schedule_event does not check $args for unicity

WordPress Trac noreply at wordpress.org
Fri Feb 17 13:14:52 UTC 2023


#57744: wp_schedule_event does not check $args for unicity
-------------------------------+------------------------------
 Reporter:  teraitane          |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Cron API           |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by johnbillion):

 * keywords:   => reporter-feedback
 * version:  6.1.1 =>


Comment:

 Thanks for the report @teraitane and welcome.

 Are you referring to `wp_schedule_single_event()`? `wp_schedule_event()`
 doesn't perform a duplicate check.

 The duplicate check inside `wp_schedule_single_event()` includes the args
 in the key that's used to store the list of events for a given hook, so
 the args are taken into account. You can verify this by scheduling two
 posts to be published within ten minutes of one another and then verifying
 that a cron event is scheduled for both. If the args weren't taken into
 account, this wouldn't work.

 Do you think the documentation needs clarifying?

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


More information about the wp-trac mailing list