change_radiolist = $change_radiolist; $this->checklist_no_top = $checklist_no_top; } function category_has_children( $term_id = 0, $taxonomy = 'category' ) { $children = get_terms( $taxonomy, array( 'child_of' => $term_id ) ); return ( $children ); } public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { if ( empty( $args['taxonomy'] ) ) { $taxonomy = 'category'; } else { $taxonomy = $args['taxonomy']; } if ( $taxonomy == 'category' ) { $name = 'post_category'; } else { $name = 'tax_input[' . $taxonomy . ']'; } $args['popular_cats'] = empty( $args['popular_cats'] ) ? array() : $args['popular_cats']; $class = in_array( $category->term_id, $args['popular_cats'] ) ? ' class="popular-category"' : ''; $args['selected_cats'] = empty( $args['selected_cats'] ) ? array() : $args['selected_cats']; if ( ! empty( $args['list_only'] ) ) { $aria_cheched = 'false'; $inner_class = 'category'; if ( in_array( $category->term_id, $args['selected_cats'] ) ) { $inner_class .= ' selected'; $aria_cheched = 'true'; } /** This filter is documented in wp-includes/category-template.php */ $output .= "\n" . '