CMB2_Type_Radio

CMB radio field type.

Defined (1)

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

/vendor/wordimpress/maps-builder-core/includes/libraries/metabox/includes/types/CMB2_Type_Radio.php  
  1. class CMB2_Type_Radio extends CMB2_Type_Multi_Base { 
  2.  
  3. /** 
  4. * The type of radio field 
  5. * @var string 
  6. */ 
  7. public $type = 'radio'; 
  8.  
  9. /** 
  10. * Constructor 
  11. * @since 2.2.2 
  12. * @param CMB2_Types $types 
  13. * @param array $args 
  14. */ 
  15. public function __construct( CMB2_Types $types, $args = array(), $type = '' ) { 
  16. parent::__construct( $types, $args ); 
  17. $this->type = $type ? $type : $this->type; 
  18.  
  19. public function render() { 
  20. $args = $this->parse_args( $this->type, array( 
  21. 'class' => 'cmb2-radio-list cmb2-list',  
  22. 'options' => $this->concat_items( array( 
  23. 'label' => 'test',  
  24. 'method' => 'list_input' 
  25. ) ),  
  26. 'desc' => $this->_desc( true ),  
  27. ) ); 
  28.  
  29. return $this->rendered( $this->ul( $args ) ); 
  30.  
  31. protected function ul( $a ) { 
  32. return sprintf( '<ul class="%s">%s</ul>%s', $a['class'], $a['options'], $a['desc'] ); 
  33.