# jetformbuilder/3.6.6/modules/validation/ssr/is-user-login-unique.php

JetFormBuilder — Dynamic Blocks Form Builder, version 3.6.6. 31 lines.

- Page: https://pluginprobe.com/plugins/jetformbuilder/3.6.6/code/modules/validation/ssr/is-user-login-unique.php
- Raw: https://pluginprobe.com/plugins/jetformbuilder/3.6.6/raw/modules/validation/ssr/is-user-login-unique.php
- Modified: 2024-02-01T14:15:50+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/jetformbuilder/3.6.6/code/modules/validation/ssr/is-user-login-unique.php#L10-L20`.

```php
<?php


namespace JFB_Modules\Validation\Ssr;

use Jet_Form_Builder\Request\Parser_Context;

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
	die;
}

class Is_User_Login_Unique extends Base_Validation_Callback {

	public function get_id(): string {
		return 'is_user_login_unique';
	}

	public function get_label(): string {
		return __( 'Is user login unique', 'jet-form-builder' );
	}

	public function is_valid( $value, Parser_Context $context ): bool {
		if ( ! is_string( $value ) ) {
			return false;
		}

		return ! (bool) username_exists( $value );
	}
}

```
