Changeset 3658
- Timestamp:
- 03/24/2006 07:22:22 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/template-functions-bookmarks.php
r3655 r3658 78 78 $orderby = substr($orderby, 1); 79 79 } 80 81 if ($category == -1) { //get_bookmarks uses '' to signify all categories 82 $category = ''; 83 } 80 84 81 85 $results = get_bookmarks("category=$category&orderby=$orderby&order=$order&show_updated=$show_updated&limit=$limit"); … … 235 239 if (!isset($direction)) $direction = ''; 236 240 237 $cats = get_categories("type=link&orderby=$order&order=$direction ");241 $cats = get_categories("type=link&orderby=$order&order=$direction&hierarchical=0"); 238 242 239 243 // Display each category … … 283 287 parse_str($args, $r); 284 288 285 $defaults = array('orderby' => 'name', 'order' => 'ASC', 'limit' => -1, 'category' => -1,289 $defaults = array('orderby' => 'name', 'order' => 'ASC', 'limit' => -1, 'category' => '', 286 290 'category_name' => '', 'hide_invisible' => 1, 'show_updated' => 0, 'include' => '', 'exclude' => ''); 287 291 $r = array_merge($defaults, $r); … … 291 295 if ( !empty($include) ) { 292 296 $exclude = ''; //ignore exclude, category, and category_name params if using include 293 $category = -1;297 $category = ''; 294 298 $category_name = ''; 295 299 $inclinks = preg_split('/[\s,]+/',$include); … … 328 332 $category_query = ''; 329 333 $join = ''; 330 if ( $category != -1 && !empty($category) ) { 334 if ( !empty($category) ) { 335 $incategories = preg_split('/[\s,]+/',$category); 336 if ( count($incategories) ) { 337 foreach ( $incategories as $incat ) { 338 if (empty($category_query)) 339 $category_query = ' AND ( category_id = ' . intval($incat) . ' '; 340 else 341 $category_query .= ' OR category_id = ' . intval($incat) . ' '; 342 } 343 } 344 } 345 if (!empty($category_query)) { 346 $category_query .= ')'; 331 347 $join = " LEFT JOIN $wpdb->link2cat ON ($wpdb->links.link_id = $wpdb->link2cat.link_id) "; 332 333 $category_query = " AND category_id = $category ";334 348 } 335 349
Note: See TracChangeset
for help on using the changeset viewer.