'', 'show_option_none' => __('No categories'), '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, 'include'=>'', 'taxonomy' => 'category', 'selected'=>false, //array of term names 'type'=>false, //false|radio|checkbox 'walker'=>false ); $r = wp_parse_args( $args, $defaults ); $r['walker']=(bool)$r['type']; 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'] = ''; } if ( !isset( $r['class'] ) ) $r['class'] = ( 'category' == $r['taxonomy'] ) ? 'categories' : $r['taxonomy']; extract( $r ); if ( !is_taxonomy($taxonomy) ) return false; if ((oqp_is_multiste()) && ($blog_id)) { switch_to_blog($blog_id); $categories = get_categories( $r ); restore_current_blog(); }else { $categories = get_categories( $r ); } $output = ''; if ( $title_li && 'list' == $style ) $output = '
  • ' . $title_li . '
  • '; $output = apply_filters( 'wp_list_taxonomy_'.$taxonomy, $output ); if ( $echo ) echo $output; else return $output; } // // Helper functions // /** * Retrieve HTML list content for category list. * * @uses Walker_Category to create HTML list content. * @since 2.1.0 * @see Walker_Category::walk() for parameters and return description. */ function oqp_walk_category_tree() { $args = func_get_args(); // the user's options are the third parameter if ( empty($args[2]['walker']) || !is_a($args[2]['walker'], 'Walker') ) $walker = new Oqp_Walker_Term; else $walker = $args[2]['walker']; return call_user_func_array(array( &$walker, 'walk' ), $args ); } // // Category Checklists // /** * {@internal Missing Short Description}} * * @since unknown */ class Oqp_Walker_Term extends Walker { var $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); //TODO: decouple this function start_lvl(&$output, $depth, $args) { $indent = str_repeat("\t", $depth); $output .= "$indent\n"; } function start_el(&$output, $term, $depth, $args) { if (!$args['selected']) $args['selected']=array(); extract($args); if ( empty($taxonomy) ) $taxonomy = 'category'; if (!is_array($selected)) $selected=explode(', ',$selected); $output .= "\n".'
  • ' . ''; } function end_el(&$output, $term, $depth, $args) { $output .= "
  • \n"; } } ?>