Show categories nested by default. New wp_list_cats function that uses parse_str.
git-svn-id: https://develop.svn.wordpress.org/trunk@873 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
2c0ff17b55
commit
ee730aea98
@ -72,7 +72,7 @@ require('wp-blog-header.php');
|
||||
<?php get_links_list(); ?>
|
||||
<li id="categories">Categories:
|
||||
<ul>
|
||||
<?php list_cats(0, 'All', 'name'); ?>
|
||||
<?php wp_list_cats(); ?>
|
||||
</ul>
|
||||
</li>
|
||||
<li id="search">Search:
|
||||
|
@ -236,7 +236,26 @@ function dropdown_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_
|
||||
}
|
||||
|
||||
// out of the WordPress loop
|
||||
function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0, $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 0, $children=FALSE, $child_of=0, $categories=0, $recurse=0) {
|
||||
function wp_list_cats($args = '') {
|
||||
parse_str($args, $r);
|
||||
if (!$r['optionall']) $r['optionall'] = 1;
|
||||
if (!$r['all']) $r['all'] = 'All';
|
||||
if (!$r['sort_column']) $r['sort_column'] = 'ID';
|
||||
if (!$r['file']) $r['file'] = '';
|
||||
if (!$r['list']) $r['list'] = true;
|
||||
if (!$r['optiondates']) $r['optiondates'] = 0;
|
||||
if (!$r['hide_empty']) $r['hide_empty'] = 1;
|
||||
if (!$r['use_desc_for_title']) $r['use_desc_for_title'] = 1;
|
||||
if (!$r['children']) $r['children'] = true;
|
||||
if (!$r['child_of']) $r['child_of'] = 0;
|
||||
if (!$r['categories']) $r['categories'] = 0;
|
||||
if (!$r['recurse']) $r['recurse'] = 0;
|
||||
list_cats($r['optionall'], $r['all'], $r['sort_column'], $r['sort_order'], $r['file'],
|
||||
$r['list'], $r['optiondates'], $r['optioncount'], $r['hide_empty'], $r['use_desc_for_title'],
|
||||
$r['children'], $r['child_of'], $r['categories'], $r['recurse']);
|
||||
}
|
||||
|
||||
function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0, $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=FALSE, $child_of=0, $categories=0, $recurse=0) {
|
||||
global $tablecategories, $tableposts, $tablepost2cat, $wpdb;
|
||||
global $pagenow, $siteurl, $blogfilename;
|
||||
global $querystring_start, $querystring_equal, $querystring_separator;
|
||||
|
Loading…
Reference in New Issue
Block a user