Changeset 5560
- Timestamp:
- 05/27/2007 05:21:04 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/bookmark.php
r5556 r5560 54 54 function wp_get_link_cats($link_id = 0) { 55 55 56 $cats = get_object_terms($link_id, 'link_category', ' get=ids');56 $cats = get_object_terms($link_id, 'link_category', 'fields=ids'); 57 57 58 58 return array_unique($cats); -
trunk/wp-includes/bookmark-template.php
r5530 r5560 334 334 if ( $categorize ) { 335 335 //Split the bookmarks into ul's for each category 336 $cats = get_ categories("type=link&category_name=$category_name&include=$category&orderby=$category_orderby&order=$category_order&hierarchical=0");336 $cats = get_terms('link_category', "category_name=$category_name&include=$category&orderby=$category_orderby&order=$category_order&hierarchical=0"); 337 337 338 338 foreach ( (array) $cats as $cat ) { -
trunk/wp-includes/bookmark.php
r5444 r5560 77 77 78 78 if ( ! empty($category_name) ) { 79 if ( $cat _id = $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE cat_name='$category_name' LIMIT 1") )80 $category = $cat _id;79 if ( $category = get_term_by('name', $category_name, 'link_category') ); 80 $category = $category->term_id; 81 81 } 82 82 … … 88 88 foreach ( $incategories as $incat ) { 89 89 if (empty($category_query)) 90 $category_query = ' AND ( category_id = ' . intval($incat) . ' ';90 $category_query = ' AND ( tt.term_id = ' . intval($incat) . ' '; 91 91 else 92 $category_query .= ' OR category_id = ' . intval($incat) . ' ';92 $category_query .= ' OR tt.term_id = ' . intval($incat) . ' '; 93 93 } 94 94 } 95 95 } 96 96 if (!empty($category_query)) { 97 $category_query .= ')';98 $join = " LEFT JOIN $wpdb-> link2cat ON ($wpdb->links.link_id = $wpdb->link2cat.link_id)";97 $category_query .= ") AND taxonomy = 'link_category'"; 98 $join = " LEFT JOIN $wpdb->term_relationships AS tr ON ($wpdb->links.link_id = tr.object_id) LEFT JOIN $wpdb->term_taxonomy as tt ON tt.term_taxonomy_id = tr.term_taxonomy_id"; 99 99 } 100 100 -
trunk/wp-includes/category.php
r5555 r5560 14 14 function &get_categories($args = '') { 15 15 // TODO Add back compat fields into each object. 16 // Set taxonomy to link_category if type=link 16 17 return get_terms('category', $args); 17 18 } -
trunk/wp-includes/taxonomy.php
r5559 r5560 243 243 244 244 function wp_update_term_count( $terms, $taxonomy ) { 245 global $wpdb; 246 245 247 if ( empty($terms) ) 246 248 return false;
Note: See TracChangeset
for help on using the changeset viewer.