0

This is a wp-cron I defined in function.php file, but I don't get any result in the error log, the event is in the cron list but if I launch it nothing happens.

Does anybody know what am I doing wrong?

function cron_daily_whatever() {
  if (!wp_next_scheduled('check_daily_event')) {
    wp_schedule_event(time(),'daily','check_daily_event');
  }
}

function my_do_this_daily() {
    error_log('check');
}

add_action('wp','cron_daily_whatever');
add_action('check_daily_event','my_do_this_daily');
-1
    
function cron_daily_whatever() {
  if (!wp_next_scheduled('check_daily_event')) {
    wp_schedule_event(time(),'daily','check_daily_event');
  }
}

function check_daily_event() {
    error_log('check');
}

add_action('wp','cron_daily_whatever');
add_action('check_daily_event','check_daily_event');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.