Support Forum » User Profile

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Backend validation for registration form #11049
    HaroldHarold
    Participant

    This is the code so far. How do I echo a warning if the invitation code from the registration form is incorrect?

    
    // Validation for metabox registration form
    add_filter( 'rwmb_profile_validate', function( $is_valid, $config ) {
        if ( 'invitation_verification' === $config['id'] ) {
            if ( '123' !== $_POST['invitation_code'] ) {
                // do NOT register new user and echo "Incorrect invitation code" on the registration form
            }
        }
        return $is_valid;
    }, 10, 2 );
    
Viewing 1 post (of 1 total)