如何禁用默认WordPress电子邮件通知



在不使用插件的情况下,如何使用functions.php文件禁用以下WordPress默认电子邮件通知?

'wp_new_user_notification_to_user' 
'wp_new_user_notification_to_admin' 
'wp_notify_postauthor'
'wp_notify_moderator'
'wp_password_change_notification'
'send_password_change_email'
'send_email_change_email'

将此代码添加到functions.php文件中。

add_filter( 'send_password_change_email', '__return_false' );
add_filter( 'send_email_change_email', '__return_false' );
// DISABLE BOTH default WordPress new user notification emails
if ( ! function_exists( 'wp_new_user_notification' ) ) :
function wp_new_user_notification( $user_id, $deprecated = null, $notify = '' ) {
return;
}
endif;

相关内容

最新更新