Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am testing the wp_schedule_single_event function and it is currently not working on my upgraded version of wordpress.

It looks like the event is being scheduled but the code in my hook is never executed. Any help with this matter would be greatly appreciated

Here is example code I put in my themes function.php:

var_dump(get_option('test_action_option'));
if(isset($_GET['begintest'])){
    update_option('test_action_option', 'Scheduled: ' . $_GET['begintest']);
    wp_clear_scheduled_hook( 'event_test_action'); // clear anything else in the system
    wp_schedule_single_event( time() + 10, 'event_test_action');
}

add_action('event_test_action', 'event_test_action');
function event_test_action(){
    update_option('test_action_option', 'Ran');
}
share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.