PHP在wordpress上删除cronjob
我在child theme function.php中手动添加了以下代码:清除“w3 total cache”的缓存。 现在,尽管按照同一个程序员的建议添加了应该停止这个过程的代码,它仍然在继续 如何停止并删除该cron?因为它甚至不像想象的那样每天都在工作,但从几天开始它每秒钟都在发送垃圾邮件 这是添加mf cron的代码:PHP在wordpress上删除cronjob,php,wordpress,cron,w3-total-cache,Php,Wordpress,Cron,W3 Total Cache,我在child theme function.php中手动添加了以下代码:清除“w3 total cache”的缓存。 现在,尽管按照同一个程序员的建议添加了应该停止这个过程的代码,它仍然在继续 如何停止并删除该cron?因为它甚至不像想象的那样每天都在工作,但从几天开始它每秒钟都在发送垃圾邮件 这是添加mf cron的代码: // Flush W3TC Cache function tj_flush_w3tc_cache() { $w3_plugin_totalcache->fl
// Flush W3TC Cache
function tj_flush_w3tc_cache() {
$w3_plugin_totalcache->flush_all();
}
// Schedule Cron Job Event
function tj_flush_cache_event() {
if ( ! wp_next_scheduled( 'tj_flush_cache_event' ) ) {
wp_schedule_event( current_time( 'timestamp' ), 'daily', 'tj_flush_w3tc_cache' );
}
}
add_action( 'wp', 'tj_flush_cache_event' );
这是代码应该停止它,但不起作用:
function tj_disable_auto_flush_cache() {
wp_clear_scheduled_hook('tj_flush_cache_event');
}
add_action('wp', 'tj_disable_auto_flush_cache');
我在function.php中使用了它
update_option('cron', '');
现在它只显示列表中正确的cron(我正在使用一个插件来控制wordpress上的cron)