BuddyDev

Search

[Resolved] Restrict Domain Plugin

  • Participant
    Level: Initiated
    Posts: 8
    Diane Conrad on #18099

    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() );
    		}
    	} 
  • Participant
    Level: Initiated
    Posts: 8
    Diane Conrad on #18100

    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

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #18101

    Thank you.
    That makes sense. I will add the support in next update.

    Best regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: resolved