| | |
| | | } |
| | | |
| | | // Check if role is valid and can register |
| | | $role_config = JVB_USER[$user_select] ?? null; |
| | | $registrar = Registrar::getInstance($user_select); |
| | | |
| | | if (!$role_config) { |
| | | if (!$registrar) { |
| | | return new WP_Error('invalid_role', 'Invalid role selected.'); |
| | | } |
| | | |
| | | if (!($role_config['can_register'] ?? false)) { |
| | | if (!($registrar->hasFeature('can_register') ?? false)) { |
| | | return new WP_Error('role_not_allowed', 'This role cannot be selected during registration.'); |
| | | } |
| | | |
| | | return BASE . $user_select; |
| | | return $registrar->getBased(); |
| | | } |
| | | |
| | | /** |