Blacklist of domains for registration form

Support MB User Profile Blacklist of domains for registration formResolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #27014
    Roman VaderRoman Vader
    Participant

    Hi!

    How to add blacklist domains for registration form: @domain1.com, @domain2.com, @domain3.com
    A very useful function for MB User Profile

    Thank you

    #27022
    Long NguyenLong Nguyen
    Moderator

    Hi Roman Vader,

    Thank you for reaching out.

    You can use the form filters to validate any user field before creating a new user. For example, the user name abc123 will not be created/updated.

    add_filter( 'rwmb_profile_validate', function( $is_valid, $config ) {
        if( $_POST['user_login'] == 'abc123' ) {
            $is_valid = false;
        }
        return $is_valid;
    }, 99, 2 );

    Get more details on this documentation https://docs.metabox.io/extensions/mb-user-profile/#form-fitlers.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.