# sellkit/1.2.2/includes/contact-segmentation/conditions/user-role.php

SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster, version 1.2.2. 73 lines.

- Page: https://pluginprobe.com/plugins/sellkit/1.2.2/code/includes/contact-segmentation/conditions/user-role.php
- Raw: https://pluginprobe.com/plugins/sellkit/1.2.2/raw/includes/contact-segmentation/conditions/user-role.php
- Modified: 2022-05-26T11:44:04+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/sellkit/1.2.2/code/includes/contact-segmentation/conditions/user-role.php#L10-L20`.

```php
<?php

namespace Sellkit\Contact_Segmentation\Conditions;

use Sellkit\Contact_Segmentation\Conditions\Condition_Base;

defined( 'ABSPATH' ) || die();

/**
 * Class User_Role_Condition
 *
 * @package Sellkit\Contact_Segmentation\Conditions
 * @since 1.1.0
 */
class User_Role extends Condition_Base {

	/**
	 * Condition name.
	 *
	 * @since 1.1.0
	 */
	public function get_name() {
		return 'user-role';
	}

	/**
	 * Condition title.
	 *
	 * @since 1.1.0
	 */
	public function get_title() {
		return __( 'User Role', 'sellkit' );
	}

	/**
	 * Condition type.
	 *
	 * @since 1.1.0
	 */
	public function get_type() {
		return self::SELLKIT_MULTISELECT_CONDITION_VALUE;
	}

	/**
	 * Get the options
	 *
	 * @since 1.1.0
	 * @return string[]
	 */
	public function get_options() {
		global $wp_roles;

		$neat_roles = [];

		$all_roles = $wp_roles->roles;

		foreach ( $all_roles as $role_key => $role ) {
			$neat_roles[ $role_key ] = $role['name'];
		}

		return $neat_roles;
	}

	/**
	 * It is pro feature or not.
	 *
	 * @since 1.1.0
	 */
	public function is_pro() {
		return false;
	}
}

```
