我想使用wordpress cron作业,但这取决于进入站点的用户或管理员,我可以覆盖此操作并在wordpress上创建独立的cron吗?
现在,当管理员进入管理面板时,我使用了一个简单的计时器
if ( $nextUpdate < current_time(\'timestamp\') ){
等等。。
// check if first time update
if ( ($options[\'lastUpdate\'] == 0 ) ){
$today = getdate(current_time(\'timestamp\'));
$first_day = getdate(mktime(0,0,0,$today[\'mon\'],1,$today[\'year\']));
$nextUpdate = $first_day[0];
}
等等。。
$new_settings = array(
\'updatestatus\' => $updatestatus,
\'lastUpdate\' => $nextUpdate,
SO网友:vinrav
已尝试wordpress的插件cronjob plugins
Cronjob调度器和SetCron值得一试。。。
my personal favorite is Cronjob Scheduler..
使用cronjob调度程序
Running your cron tasks
Most shared providers offer a crontab manager, or you can speak to your shared
hosting provider about setting up our cron job. If you manage the server, you
can setup your cron using the crontab service. Make sure that wget is
installed befor doing this.
Creating Custom Action Example
function my_cronjob_action () {
// code to execute on cron run
} add_action(\'my_cronjob_action\', \'my_cronjob_action\');
courtesy wordpress plugins
regds。。