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 41 42 43
<?php
class CMB2_Type_Taxonomy_Multicheck_Hierarchical extends CMB2_Type_Taxonomy_Multicheck {
protected $parent = 0;
public function render() {
return $this->rendered(
$this->types->radio( array(
'class' => $this->get_wrapper_classes(),
'options' => $this->get_term_options(),
), 'taxonomy_multicheck_hierarchical' )
);
}
protected function list_term_input( $term, $saved_terms ) {
$options = parent::list_term_input( $term, $saved_terms );
$children = $this->build_children( $term, $saved_terms );
if ( ! empty( $children ) ) {
$options .= $children;
}
return $options;
}
}