[wp-trac] [WordPress Trac] #14668: Check for scheduled event to prevent duplicates

WordPress Trac wp-trac at lists.automattic.com
Thu Dec 2 16:24:34 UTC 2010


#14668: Check for scheduled event to prevent duplicates
--------------------------+-------------------------------------------------
 Reporter:  markparolisi  |       Owner:                         
     Type:  defect (bug)  |      Status:  new                    
 Priority:  normal        |   Milestone:  3.1                    
Component:  Cron          |     Version:  3.0.1                  
 Severity:  normal        |    Keywords:  has-patch needs-testing
--------------------------+-------------------------------------------------

Comment(by scribu):

 The problem with 14668.2.diff is that it doesn't allow scheduling non-
 regular intervals.

 For example, if I want to schedule the same event to run twice daily, but
 on specific hours, I can currently do this:

 {{{
 if ( !wp_next_scheduled( 'my_event' ) ) {
   wp_schedule_event( strtotime( '10am' ), 'daily', 'my_event' );
   wp_schedule_event( strtotime( '12am' ), 'daily', 'my_event' );
 }
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14668#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list