Replies
Here are the screenshots of the fields in ultimate member if you want to add support for it at some point: https://docs.google.com/document/d/1t-gHlByQc6_AyCVEZ0V3UT3oNrxQuzj6m-bphymGXaw/edit?usp=sharing
I figured it out! Ultimate member allows you to use a field for user name or email as well as the standard fields user name and email fields. That is what I am using because we want the username to be the same as the email address. So in your code I replaced email with username and it worked:
public function ban_um( $args ) { $email = isset( $args['username'] ) ? trim( $args['username'] ) : ''; if ( empty( $email ) ) { return ; } if ( ! $this->is_allowed( $email ) ) { UM()->form()->add_error( 'username', $this->settings->get_error_message() ); } }
I put in a list of emails that I wanted to be allowed to register. Anybody else I want to block. I entered one address per line without commas using lowercase letters.
Correct – it is not restricting user registration for ultimate member. Should have written: However, after properly entering the email addresses under settings it is NOT restricting registration to those emails.
- This reply was modified 6 years, 3 months ago by Diane Conrad.