[wp-trac] [WordPress Trac] #52448: wp_scheduled_delete WP-Cron Job Cannot Be Unscheduled

WordPress Trac noreply at wordpress.org
Thu Feb 4 22:36:48 UTC 2021


#52448: wp_scheduled_delete WP-Cron Job Cannot Be Unscheduled
----------------------------+------------------------------
 Reporter:  daleharrison    |       Owner:  (none)
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Administration  |     Version:  4.9
 Severity:  normal          |  Resolution:
 Keywords:  2nd-opinion     |     Focuses:
----------------------------+------------------------------
Changes (by peterwilsoncc):

 * keywords:   => 2nd-opinion


Comment:

 Thanks for the report.

 For now, I would recommend `remove_action( 'wp_scheduled_delete',
 'wp_scheduled_delete' );` after the default hooks have been added
 (probably wait until `init, 5`). Otherwise you could use
 `pre_schedule_event` or `schedule_event` hook to prevent the cron job from
 been scheduled.

 I'm inclined to leave the above options as the best approach for this as
 never emptying the trash is an unusual use case and it's possible to do
 already in code.. I'll keep this open for now and get a second opinion.

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


More information about the wp-trac mailing list