Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save champsupertramp/b06ba37410394b8f7a74a487f049d5cb to your computer and use it in GitHub Desktop.
Save champsupertramp/b06ba37410394b8f7a74a487f049d5cb to your computer and use it in GitHub Desktop.
Ultimate Member - Exclude specific emails from blocked email domains
function um_020123_submit_form_errors_hook__exclude_blockedemails( $args ) {
$emails = UM()->options()->get( 'blocked_emails' );
if ( ! $emails ) {
return;
}
$arr_excluded_emails = array(
"test1@gmail.com",
"test2@gmail.com",
);
if ( isset( $args['user_email'] ) && is_email( $args['user_email'] ) && in_array( $args['user_email'], $arr_excluded_emails ) ) {
// Disable blocking
remove_action( 'um_submit_form_errors_hook__blockedemails', 'um_submit_form_errors_hook__blockedemails', 10 );
}
}
add_action( 'um_submit_form_errors_hook__blockedemails', 'um_020123_submit_form_errors_hook__exclude_blockedemails', 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment