Last active
December 19, 2015 19:28
-
-
Save WerdsWords/6005975 to your computer and use it in GitHub Desktop.
#3: wpmu_signup_user_notification
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Disable email confirmation emails for Gmail users | |
* | |
* @see wpmu_signup_user_notification() | |
* | |
* @param string $user The user's login name. | |
* @param string $user_email The user's email address. | |
* @param string $key The activation key from wp_signup_user(). | |
* @param array $meta An array of meta, default is an empty array. | |
* @return bool The value of $user if non-gmail, false if gmail. | |
*/ | |
function wpdocs_disable_confirmation_email( $user, $user_email, $key, $meta ) { | |
if ( ! strpos( strtolower( $user_email ), 'gmail' ) // Non-gmail emails | |
return $user; | |
else // Gmail emails | |
return false; | |
} | |
add_filter( 'wpmu_signup_user_confirmation', 'wpdocs_disable_confirmation_email', 10, 4 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://fotd.werdswords.com/wpmu_signup_user_notification/