function wp_list_categories_blaat( $args = '' ) { $defaults = array( 'show_option_all' => '', 'orderby' => 'name', 'order' => 'ASC', 'show_last_update' => 0, 'style' => 'list', 'show_count' => 0, 'hide_empty' => 1, 'use_desc_for_title' => 1, 'child_of' => 0, 'feed' => '', 'feed_type' => '', 'feed_image' => '', 'exclude' => '', 'exclude_tree' => '', 'current_category' => 0, 'hierarchical' => true, 'title_li' => __( 'Categories' ), 'echo' => 1, 'depth' => 0 ); $r = wp_parse_args( $args, $defaults ); if ( !isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) { $r['pad_counts'] = true; } if ( isset( $r['show_date'] ) ) { $r['include_last_update_time'] = $r['show_date']; } if ( true == $r['hierarchical'] ) { $r['exclude_tree'] = $r['exclude']; $r['exclude'] = ''; } extract( $r ); $categories = get_categories( $r ); $output = ''; global $wp_query; if( !empty( $show_option_all ) ) if ( 'list' == $style ) $output .= '
  • ' . $show_option_all . '
  • '; else $output .= '' . $show_option_all . ''; if ( empty( $r['current_category'] ) && is_category() ) $r['current_category'] = $wp_query->get_queried_object_id(); if ( $hierarchical ) $depth = $r['depth']; else $depth = -1; // Flat. $output .= walk_category_tree( $categories, $depth, $r ); $output = apply_filters( 'wp_list_categories_blaat', $output ); if ( $echo ) echo $output; else return $output; }