<?php

class Intense_Field_Role extends Intense_Field_Dropdown {
	private function set_default_options() {
		global $wp_roles;
     	$roles = $wp_roles->get_names();

		if ( empty( $this->args['options'] ) ) {
			$this->args['options'] = array();

			$roles = $wp_roles->get_names();

			foreach ( $roles as $role ) {
				$this->args['options'][ $role->key ] = $role->name;
			}
		}
	}

	protected function render() {
		$this->set_default_options();

		$this->args['multiple'] = true;

		return parent::render();
	}

	public function render_value_script() {
		$this->args['multiple'] = true;

		return parent::render_value_script();
	}

	public function map_visual_composer() {
		// $this->set_default_options();
		
		// return parent::map_visual_composer();
		return null;
	}
}
