如果目的只是为了禁用添加新用户的邮件通知,把下面的代码添加到主题或子主题的 function.php 底部,然后保存即可:
// To Disable Default Notification to Admin from New User Registration
remove_action( ‘register_new_user’, ‘wp_send_new_user_notifications’ );
remove_action( ‘edit_user_created_user’, ‘wp_send_new_user_notifications’, 10 );
add_action( ‘register_new_user’, ‘mytheme_wp_send_new_user_notifications’, 10, 2 );
add_action( ‘edit_user_created_user’, ‘mytheme_wp_send_new_user_notifications’, 10, 2 );
function mytheme_wp_send_new_user_notifications( $user_id, $notify = ‘user’ ) {
switch($notify) {
case ‘admin’:
$notify = ‘none’;
break;
case ‘both’:
$notify = ‘user’;
break;
}
wp_new_user_notification($user_id, null, $notify);
}
其他的先试试看吧,可以付费处理的,