最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

wp cron - daily wp_schedule_event hook works after reload any page

programmeradmin0浏览0评论

I've put this code to my wordpress functions.php file. But this code works after any page reload on my site and sends sms. what is the problem? How can I understand daily scheduled event is set or not?

if (!wp_next_scheduled('daily_send_sms_hook')) {
    wp_schedule_event(time(), 'daily', 'daily_send_sms_hook');
}
add_action('daily_send_sms_hook', 'daily_send_sms');

function daily_send_sms() {
    // send sms code
}
发布评论

评论列表(0)

  1. 暂无评论