我在Wordpress中为接受数组作为参数的单个事件声明了一个操作:
$asins = array(); //I had to declare this since I\'m getting a notice of undefined variable if I don\'t
add_action(\'z_purge_products_cache\', array($this, \'purge_products_cache\', $asins));
我也尝试了这个,但它也不执行操作:add_action(\'z_purge_products_cache\', array($this, \'purge_products_cache\'));
然后我安排:wp_schedule_single_event(time() + 20, \'z_purge_products_cache\', $asins_r);
然后,wp cron执行操作后将调用以下函数:public function purge_products_cache($asins){
//send email here
}
有什么想法吗?