[wp-trac] [WordPress Trac] #42660: Single event scheduler
WordPress Trac
noreply at wordpress.org
Wed Nov 22 09:49:02 UTC 2017
#42660: Single event scheduler
-------------------------------+------------------------------
Reporter: skarabeq | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Cron API | Version: 4.9
Severity: normal | Resolution:
Keywords: reporter-feedback | Focuses:
-------------------------------+------------------------------
Changes (by ocean90):
* severity: major => normal
Comment:
That's expected behaviour when use `wp_schedule_single_event()` and
`time()`. You have to use a fixed time and/or register it only once to
schedule the event only once. You also might want to use
`wp_next_scheduled()`.
{{{#!php
<?php
if ( ! wp_next_scheduled( 'single_action' ) ) {
wp_schedule_single_event( strtotime( '2017-11-22 11:00' ),
'single_action' );
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42660#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list