*/ class BestWP_Customize_Category_Control extends WP_Customize_Control { public $type = 'bestwp-dropdown-category'; protected $dropdown_args = false; protected function render_content() { $input_id = '_customize-input-' . $this->id; $description_id = '_customize-description-' . $this->id; $describedby_attr = ( ! empty( $this->description ) ) ? ' aria-describedby="' . esc_attr( $description_id ) . '" ' : ''; if ( ! empty( $this->label ) ) : ?>description ) ) : ?>description ); ?>dropdown_args, array( 'show_option_all' => '', 'show_option_none' => '', 'option_none_value' => 0, 'orderby' => 'id', 'order' => 'ASC', 'show_count' => 1, 'hide_empty' => 1, 'child_of' => 0, 'exclude' => '', 'selected' => $this->value(), 'hierarchical' => 1, 'name' => '', 'id' => esc_attr( $input_id ), 'depth' => 0, 'tab_index' => 0, 'taxonomy' => 'category', 'hide_if_empty' => false, 'value_field' => 'term_id', ) ); $dropdown_args['echo'] = false; $dropdown = wp_dropdown_categories( $dropdown_args ); $dropdown = str_replace( 'get_link() . ' ' . $describedby_attr, $dropdown ); echo wp_kses( $dropdown, array( 'select' => array( 'class' => array(), 'id' => array(), 'name' => array(), 'value' => array(), 'type' => array(), 'data-customize-setting-link' => array(), 'aria-describedby' => array() ), 'option' => array( 'class' => array(), 'id' => array(), 'name' => array(), 'value' => array(), 'type' => array(), 'selected' => array() ), ) ); } }