1
我一直在尝试使用cPanel cronJobs创建一个合适的cronjob。在WordPress中创建真正的cron作业?
对此我一直在关注tutorial。
到目前为止我的cronjob似乎正在运行,因为我收到一封电子邮件说它正在运行。
我对cron的代码是:
wget -O /dev/null http://my-domain.co.uk/wp-cron.php?doing_wp_cron
希望运行的功能不来似乎运行,虽然。我不确定它是如何工作的,真的很难设置一个WP Cron。
// Cron Jobs -> Email Notifications
add_action('schedule-emailNotifications', 'update_db_hourly');
function my_activation() {
if (!wp_next_scheduled('schedule-emailNotifications')) {
wp_schedule_event(current_time('timestamp'), 'hourly', 'schedule-emailNotifications');
}
}
add_action('wp', 'my_activation');
// Scheduled FUNCTION
function update_db_hourly()
{
testEmail();
} // end update_csv_hourly
所以我相信cron运行正常,但它似乎并没有运行我的测试脚本。
任何帮助,将不胜感激!