Viewing 1 replies (of 1 total)
  • Here you go, I just wrote it myself:

    add_filter( 'registration_errors', 'select_user_role_error', 10, 3 );
    function select_user_role_error( $errors, $sanitized_user_login, $user_email ) {
      if(isset($_REQUEST['wp_rar_user_role']) && $_REQUEST['wp_rar_user_role'] == 'contributor') :
    
        $errors->add( 'policy_error', "<strong>ERROR</strong>: Please select an option." );
        return $errors;
      endif;
      return $errors;
    }

    Just change contributor to whatever your role is and should check if you have selected the right one.

Viewing 1 replies (of 1 total)
  • The topic ‘assign validation as required field’ is closed to new replies.