This file contains hidden or 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
add_action( 'um_before_new_user_register', 'require_whitelisted_email_for_signup' ); | |
function require_whitelisted_email_for_signup( $args ) { | |
foreach ( [ 'yahoo.com', 'gmail.com', 'hotmail.com' ] as $domain ) { | |
if ( str_ends_with( $args['user_email'], '@' . $domain ) ) { | |
return true; | |
} | |
} | |
exit( wp_safe_redirect( add_query_arg( 'err', 'blocked_domain' ) ) ); | |
} |
This file contains hidden or 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
add_action( 'um_before_new_user_register', 'require_whitelisted_email_for_signup' ); | |
function require_whitelisted_email_for_signup( $args ) { | |
$user_email = $args['user_email']; | |
$approved_domains = array( 'yahoo.com', 'gmail.com', 'hotmail.com' ); | |
$email_approved = false; | |
foreach ( $approved_domains as $domain ) { | |
$prefixed_domain = '@' . $domain; | |
if ( str_ends_with( $user_email, $prefixed_domain ) ) { | |
$email_approved = true; |
This file contains hidden or 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
/* TODO | |
Using the 'current_screen' hook means symlinks will be recreated *every time* a Codestyling Localization page is called. | |
A better solution would be to store themes' versions in a site_option and run this only when installed versions are higher than what we have in our site_option (i.e. an update has been made). See here: | |
http://make.wordpress.org/core/2010/10/27/plugin-activation-hooks-no-longer-fire-for-updates/ | |
*/ | |
add_action( 'current_screen' , 'uneq_cs_translations' ); | |
function uneq_cs_translations( $current_screen ) { | |
/* Re/Create symlinks when visiting Codestyling page */ |