[ad_1]
I wrote following code to only allow new registrations from domain1.com email. Now i wish to allow new registrations from two domains domain1.com and domain2.com emails. How can i achieve this?
add_action('um_submit_form_errors_hook_','um_custom_validate_username', 999, 1);
function um_custom_validate_username( $args ) {
if ( strpos( $args['user_email'], 'domain1.com') === false) {
UM()->form()->add_error( 'user_email', 'Only official email address is allowed.' );
}
}Thanks
