Changeset 4263
- Timestamp:
- 10/02/2006 06:01:07 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/bookmark-template.php
r4256 r4263 317 317 parse_str($args, $r); 318 318 319 $defaults = array('orderby' => 'name', 'order' => 'ASC', 'limit' => -1, 'category' => 0,319 $defaults = array('orderby' => 'name', 'order' => 'ASC', 'limit' => -1, 'category' => '', 320 320 'category_name' => '', 'hide_invisible' => 1, 'show_updated' => 0, 'echo' => 1, 321 321 'categorize' => 1, 'title_li' => __('Bookmarks'), 'title_before' => '<h2>', 'title_after' => '</h2>', … … 324 324 extract($r); 325 325 326 // TODO: The rest of it.327 // If $categorize, group links by category with the category name being the328 // title of each li, otherwise just list them with title_li as the li title.329 // If $categorize and $category or $category_name, list links for the given category330 // with the category name as the title li. If not $categorize, use title_li.331 // When using each category's name as a title li, use before and after args for specifying332 // any markup. We don't want to hardcode h2.333 334 326 $output = ''; 335 327 336 328 if ( $categorize ) { 337 $cats = get_categories("type=link&orderby=$category_orderby&order=$category_order&hierarchical=0"); 329 //Split the bookmarks into ul's for each category 330 $cats = get_categories("type=link&category_name=$category_name&include=$category&orderby=$category_orderby&order=$category_order&hierarchical=0"); 331 338 332 foreach ( (array) $cats as $cat ) { 339 $r['category'] = $cat->cat_ID; 340 $bookmarks = get_bookmarks($r); 333 $bookmarks = get_bookmarks("limit=$limit&category={$cat->cat_ID}&show_updated=$show_updated&orderby=$orderby&order=$order&hide_invisible=$hide_inivisible&show_updated=$show_updated"); 341 334 if ( empty($bookmarks) ) 342 335 continue; … … 345 338 $output .= "\n\t</ul>\n</li>\n"; 346 339 } 340 } else { 341 //output one single list using title_li for the title 342 $bookmarks = get_bookmarks("limit=$limit&category=$category&show_updated=$show_updated&orderby=$orderby&order=$order&hide_invisible=$hide_inivisible&show_updated=$show_updated"); 343 344 if ( !empty($bookmarks) ) { 345 $output .= "<li id='linkuncat' class='linkcat'>$title_before$title_li$title_after\n\t<ul>\n"; 346 $output .= _walk_bookmarks($bookmarks, $r); 347 $output .= "\n\t</ul>\n</li>\n"; 348 } 347 349 } 348 350
Note: See TracChangeset
for help on using the changeset viewer.