Can run cron event manually with WP-CLI but not with any plugin, unsure if it’s being scheduled

I have a cron event that I am able to manually run with

wp cron event run –all

When I go to my dashboard and go to WP-Crontrol OR Advanced Cron Manager, I can see my event listed and tell it to execute. But..I can tell that it doesn’t execute my script because I don’t see the updates that I want to see.

How can I make sure my event is actually being scheduled?

I have the following in my theme’s functions.php:

add_action(‘init’, ‘my_activation’);
add_action(‘update_user_hours’, ‘do_this_hourly’);

function do_this_hourly(){
my_update_function();
//update some stuff

}

function my_activation() {
if ( !wp_next_scheduled( ‘update_user_hours’ ) ) {
wp_schedule_event(time(), ‘hourly’, ‘update_user_hours’);
}
}

And I have the following in my wp-config.php:

define(‘ALTERNATE_WP_CRON’, true);

Interestingly enough, my_update_function shows up as a cron event. I had the function name where my hook should have been previously. And now, when I try to remove the my_update_function event on Advanced Cron Manager, I get a wp-nonce error and am not allowed to remove it.

Any advice is appreciated. Thanks!

Read more here:: Can run cron event manually with WP-CLI but not with any plugin, unsure if it’s being scheduled

Leave a Reply

Your email address will not be published. Required fields are marked *