1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
<?php
class CMB2_Type_Multicheck extends CMB2_Type_Radio {
public $type = 'checkbox';
public function render( $args = array() ) {
$classes = false === $this->field->args( 'select_all_button' )
? 'cmb2-checkbox-list no-select-all cmb2-list'
: 'cmb2-checkbox-list cmb2-list';
$args = $this->parse_args( $this->type, array(
'class' => $classes,
'options' => $this->concat_items( array(
'name' => $this->_name() . '[]',
'method' => 'list_input_checkbox',
) ),
'desc' => $this->_desc( true ),
) );
return $this->rendered( $this->ul( $args ) );
}
}