Make WordPress Core

Changeset 873


Ignore:
Timestamp:
02/13/2004 04:14:36 PM (21 years ago)
Author:
saxmatt
Message:

Show categories nested by default. New wp_list_cats function that uses parse_str.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/index.php

    r786 r873  
    7373 <li id="categories">Categories:
    7474    <ul>
    75     <?php list_cats(0, 'All', 'name'); ?>
     75    <?php wp_list_cats(); ?>
    7676    </ul>
    7777 </li>
  • trunk/wp-includes/template-functions-category.php

    r836 r873  
    237237
    238238// out of the WordPress loop
    239 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) {
     239function wp_list_cats($args = '') {
     240    parse_str($args, $r);
     241    if (!$r['optionall']) $r['optionall'] = 1;
     242    if (!$r['all']) $r['all'] = 'All';
     243    if (!$r['sort_column']) $r['sort_column'] = 'ID';
     244    if (!$r['file']) $r['file'] = '';
     245    if (!$r['list']) $r['list'] = true;
     246    if (!$r['optiondates']) $r['optiondates'] = 0;
     247    if (!$r['hide_empty']) $r['hide_empty'] = 1;
     248    if (!$r['use_desc_for_title']) $r['use_desc_for_title'] = 1;
     249    if (!$r['children']) $r['children'] = true;
     250    if (!$r['child_of']) $r['child_of'] = 0;
     251    if (!$r['categories']) $r['categories'] = 0;
     252    if (!$r['recurse']) $r['recurse'] = 0;
     253    list_cats($r['optionall'], $r['all'], $r['sort_column'], $r['sort_order'], $r['file'],
     254    $r['list'], $r['optiondates'], $r['optioncount'], $r['hide_empty'], $r['use_desc_for_title'],
     255    $r['children'], $r['child_of'], $r['categories'], $r['recurse']);
     256}
     257
     258function 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) {
    240259    global $tablecategories, $tableposts, $tablepost2cat, $wpdb;
    241260    global $pagenow, $siteurl, $blogfilename;
Note: See TracChangeset for help on using the changeset viewer.