NF_Fields_ListState

Class NF_Fields_ListState.

Defined (1)

The class is defined in the following location(s).

/includes/Fields/ListState.php  
  1. class NF_Fields_ListState extends NF_Abstracts_List 
  2. protected $_name = 'liststate'; 
  3.  
  4. protected $_type = 'liststate'; 
  5.  
  6. protected $_nicename = 'US States'; 
  7.  
  8. protected $_section = 'userinfo'; 
  9.  
  10. protected $_icon = 'map-marker'; 
  11.  
  12. protected $_templates = array( 'liststate', 'listselect' ); 
  13.  
  14. protected $_old_classname = 'list-select'; 
  15.  
  16. public function __construct() 
  17. parent::__construct(); 
  18.  
  19. $this->_nicename = __( 'US States', 'ninja-forms' ); 
  20.  
  21. $this->_settings[ 'options' ][ 'value' ] = $this->get_options(); 
  22.  
  23. private function get_options() 
  24. $order = 0; 
  25. $options = array(); 
  26. foreach( Ninja_Forms()->config( 'StateList' ) as $label => $value ) { 
  27. $options[] = array( 
  28. 'label' => $label,  
  29. 'value' => $value,  
  30. 'calc' => '',  
  31. 'selected' => 0,  
  32. 'order' => $order 
  33. ); 
  34.  
  35. $order++; 
  36.  
  37. return $options;