Skip to content

Instantly share code, notes, and snippets.

@WerdsWords
Last active December 19, 2015 19:28
Show Gist options
  • Save WerdsWords/6005975 to your computer and use it in GitHub Desktop.
Save WerdsWords/6005975 to your computer and use it in GitHub Desktop.
#3: wpmu_signup_user_notification
<?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 );
@WerdsWords
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment