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');