我正在运行WordPress 3.6,多站点。我有一个激活了此内容的插件(已简化):
function prefix_delete_user() {
$some_option = get_site_option( \'some_option\' ); // at this point it works
wpmu_delete_user( 2 ); // at this point it doesn\'t
return;
}
add_action( \'delete_user_daily\', \'prefix_delete_user\' );
function setup_schedule() {
if ( ! wp_next_scheduled( \'delete_user_daily\' ) ) {
wp_schedule_event( time(), \'daily\', \'delete_user_daily\');
}
}
add_action( \'wp\', \'setup_schedule\' );
每天都会注册一个ID为2的新博客,每天我都想删除它,但我遇到以下错误:
PHP Fatal error: Call to undefined function wpmu_delete_user() in /home/example/ftp/example.com/wp-content/plugins/expiration/expiration.php on line 96
我想知道为什么会这样?
当我打电话的时候do_action( \'delete_user_daily\' );
手动,它可以工作。。。