type ) return; do_action( '__before_setting_control' , $this -> id ); $dropdown = $this -> hu_get_dropdown_multipicker(); if ( empty( $dropdown ) ) return; $dropdown = str_replace( 'get_link(), $dropdown ); //start rendering if (!empty( $this->title)) : ?>

title); ?>

id ); } //to define in the extended classes abstract public function hu_get_dropdown_multipicker(); }//end class endif; if ( ! class_exists( 'HU_Customize_Multipicker_Categories_Control' ) ) : class HU_Customize_Multipicker_Categories_Control extends HU_Customize_Multipicker_Control { public function hu_get_dropdown_multipicker() { $cats_dropdown = wp_dropdown_categories( array( 'name' => '_customize-'.$this->type, 'id' => $this -> id, //hide empty, set it to false to avoid complains 'hide_empty' => 0 , 'echo' => 0 , 'walker' => new HU_Walker_CategoryDropdown_Multipicker(), 'hierarchical' => 1, 'class' => 'czrSelect2 no-selecter-js '.$this->type, 'selected' => implode(',', $this->value() ) ) ); return $cats_dropdown; } } endif; /** * @ dropdown multi-select walker * Create HTML dropdown list of Categories. * * @package WordPress * @since 2.1.0 * @uses Walker * * we need to allow more than one "selected" attribute */ if ( ! class_exists( 'HU_Walker_CategoryDropdown_Multipicker' ) ) : class HU_Walker_CategoryDropdown_Multipicker extends Walker_CategoryDropdown { /** * Start the element output. * * @Override * * @see Walker::start_el() * * @param string $output Passed by reference. Used to append additional content. * @param object $category Category data object. * @param int $depth Depth of category. Used for padding. * @param array $args Uses 'selected', 'show_count', and 'value_field' keys, if they exist. * See {@see wp_dropdown_categories()}. */ public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { $pad = str_repeat('—', $depth ); /** This filter is documented in wp-includes/category-template.php */ $cat_name = apply_filters( 'list_cats', $category->name, $category ); $value_field = 'term_id'; $output .= "\t\n"; } } endif;