Ticket #6647: 6647.2.diff
| File 6647.2.diff, 13.5 KB (added by , 17 years ago) |
|---|
-
wp-includes/category.php
15 15 */ 16 16 function get_all_category_ids() { 17 17 if ( ! $cat_ids = wp_cache_get( 'all_category_ids', 'category' ) ) { 18 $cat_ids = get_terms( 'category', 'fields=ids&get=all');18 $cat_ids = get_terms( 'category', array('fields' => 'ids', 'get' => 'all') ); 19 19 wp_cache_add( 'all_category_ids', $cat_ids, 'category' ); 20 20 } 21 21 … … 113 113 foreach ( (array) $category_paths as $pathdir ) 114 114 $full_path .= ( $pathdir != '' ? '/' : '' ) . sanitize_title( $pathdir ); 115 115 116 $categories = get_terms( 'category', "get=all&slug=$leaf_path");116 $categories = get_terms( 'category', array('get' => 'all', 'slug' => $leaf_path) ); 117 117 118 118 if ( empty( $categories ) ) 119 119 return null; -
wp-includes/taxonomy.php
1076 1076 $taxonomies = array($taxonomies); 1077 1077 1078 1078 foreach ( (array) $taxonomies as $taxonomy ) { 1079 $tt_ids = wp_get_object_terms($object_id, $taxonomy, 'fields=tt_ids');1079 $tt_ids = wp_get_object_terms($object_id, $taxonomy, array('fields' => 'tt_ids')); 1080 1080 $in_tt_ids = "'" . implode("', '", $tt_ids) . "'"; 1081 1081 $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id IN ($in_tt_ids)", $object_id) ); 1082 1082 wp_update_term_count($tt_ids, $taxonomy); … … 1492 1492 if ( ! $append && isset($t->sort) && $t->sort ) { 1493 1493 $values = array(); 1494 1494 $term_order = 0; 1495 $final_tt_ids = wp_get_object_terms($object_id, $taxonomy, 'fields=tt_ids');1495 $final_tt_ids = wp_get_object_terms($object_id, $taxonomy, array('fields' => 'tt_ids')); 1496 1496 foreach ( $tt_ids as $tt_id ) 1497 1497 if ( in_array($tt_id, $final_tt_ids) ) 1498 1498 $values[] = $wpdb->prepare( "(%d, %d, %d)", $object_id, $tt_id, ++$term_order); … … 1931 1931 if ( empty( $ids ) ) 1932 1932 return false; 1933 1933 1934 $terms = wp_get_object_terms($ids, $taxonomies, 'fields=all_with_object_id');1934 $terms = wp_get_object_terms($ids, $taxonomies, array('fields' => 'all_with_object_id')); 1935 1935 1936 1936 $object_terms = array(); 1937 1937 foreach ( (array) $terms as $term ) … … 2002 2002 return $children; 2003 2003 2004 2004 $children = array(); 2005 $terms = get_terms($taxonomy, 'get=all');2005 $terms = get_terms($taxonomy, array('get' => 'all')); 2006 2006 foreach ( $terms as $term ) { 2007 2007 if ( $term->parent > 0 ) 2008 2008 $children[$term->parent][] = $term->term_id; -
wp-includes/post.php
1684 1684 1685 1685 // Update counts for the post's terms. 1686 1686 foreach ( (array) get_object_taxonomies('post') as $taxonomy ) { 1687 $tt_ids = wp_get_object_terms($post_id, $taxonomy, 'fields=tt_ids');1687 $tt_ids = wp_get_object_terms($post_id, $taxonomy, array('fields' => 'tt_ids')); 1688 1688 wp_update_term_count($tt_ids, $taxonomy); 1689 1689 } 1690 1690 -
wp-includes/bookmark.php
33 33 $_bookmark = & $GLOBALS['link']; 34 34 } elseif ( ! $_bookmark = wp_cache_get($bookmark, 'bookmark') ) { 35 35 $_bookmark = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->links WHERE link_id = %d LIMIT 1", $bookmark)); 36 $_bookmark->link_category = array_unique( wp_get_object_terms($_bookmark->link_id, 'link_category', 'fields=ids') );36 $_bookmark->link_category = array_unique( wp_get_object_terms($_bookmark->link_id, 'link_category', array('fields' => 'ids')) ); 37 37 wp_cache_add($_bookmark->link_id, $_bookmark, 'bookmark'); 38 38 } 39 39 } -
wp-includes/link-template.php
876 876 $join = " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id INNER JOIN $wpdb->term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id"; 877 877 878 878 if ( $in_same_cat ) { 879 $cat_array = wp_get_object_terms($post->ID, 'category', 'fields=ids');879 $cat_array = wp_get_object_terms($post->ID, 'category', array('fields' => 'ids')); 880 880 $join .= " AND tt.taxonomy = 'category' AND tt.term_id IN (" . implode(',', $cat_array) . ")"; 881 881 } 882 882 … … 1018 1018 $excluded_categories = array(); 1019 1019 if ( !empty($in_same_cat) || !empty($excluded_categories) ) { 1020 1020 if ( !empty($in_same_cat) ) { 1021 $cat_array = wp_get_object_terms($post->ID, 'category', 'fields=ids');1021 $cat_array = wp_get_object_terms($post->ID, 'category', array('fields' => 'ids')); 1022 1022 } 1023 1023 1024 1024 if ( !empty($excluded_categories) ) { -
wp-includes/deprecated.php
986 986 if ( $category == -1 ) //get_bookmarks uses '' to signify all categories 987 987 $category = ''; 988 988 989 $results = get_bookmarks( "category=$category&orderby=$orderby&order=$order&show_updated=$show_updated&limit=$limit");989 $results = get_bookmarks(array('category' => $category, 'orderby' => $orderby, 'order' => $order, 'show_updated' => $show_updated, 'limit' => $limit)); 990 990 991 991 if ( !$results ) 992 992 return; … … 1083 1083 if ( !isset($direction) ) 1084 1084 $direction = ''; 1085 1085 1086 $cats = get_categories( "type=link&orderby=$order&order=$direction&hierarchical=0");1086 $cats = get_categories(array('type' => 'link', 'orderby' => $order, 'order' => $direction, 'hierarchical' => 0)); 1087 1087 1088 1088 // Display each category 1089 1089 if ( $cats ) { -
wp-app.php
395 395 $home = esc_attr(get_bloginfo_rss('home')); 396 396 397 397 $categories = ""; 398 $cats = get_categories( "hierarchical=0&hide_empty=0");398 $cats = get_categories(array('hierarchical' => 0, 'hide_empty' => 0)); 399 399 foreach ((array) $cats as $cat) { 400 400 $categories .= " <category term=\"" . esc_attr($cat->name) . "\" />\n"; 401 401 } -
xmlrpc.php
2783 2783 2784 2784 $categories_struct = array(); 2785 2785 2786 if ( $cats = get_categories( 'get=all') ) {2786 if ( $cats = get_categories(array('get' => 'all') ) { 2787 2787 foreach ( $cats as $cat ) { 2788 2788 $struct['categoryId'] = $cat->term_id; 2789 2789 $struct['parentId'] = $cat->parent; … … 2970 2970 2971 2971 $categories_struct = array(); 2972 2972 2973 if ( $cats = get_categories( 'hide_empty=0&hierarchical=0') ) {2973 if ( $cats = get_categories(array('hide_empty' => 0, 'hierarchical' => 0)) ) { 2974 2974 foreach ($cats as $cat) { 2975 2975 $struct['categoryId'] = $cat->term_id; 2976 2976 $struct['categoryName'] = $cat->name; -
wp-links-opml.php
36 36 <?php 37 37 38 38 if (empty ($link_cat)) 39 $cats = get_categories( "type=link&hierarchical=0");39 $cats = get_categories(array('type' => 'link', 'hierarchical' => 0)); 40 40 else 41 $cats = get_categories( 'type=link&hierarchical=0&include='.$link_cat);41 $cats = get_categories(array('type' => 'link', 'hierarchical' => 0, 'include' => $link_cat)); 42 42 43 43 foreach ((array) $cats as $cat) { 44 44 $catname = apply_filters('link_category', $cat->name); … … 47 47 <outline type="category" title="<?php echo esc_attr($catname); ?>"> 48 48 <?php 49 49 50 $bookmarks = get_bookmarks( "category={$cat->term_id}");50 $bookmarks = get_bookmarks(array("category" => $cat->term_id)); 51 51 foreach ((array) $bookmarks as $bookmark) { 52 52 $title = esc_attr(apply_filters('link_title', $bookmark->link_name)); 53 53 ?> -
wp-admin/includes/bookmark.php
102 102 */ 103 103 function wp_get_link_cats( $link_id = 0 ) { 104 104 105 $cats = wp_get_object_terms( $link_id, 'link_category', 'fields=ids');105 $cats = wp_get_object_terms( $link_id, 'link_category', array('fields' => 'ids') ); 106 106 107 107 return array_unique( $cats ); 108 108 } -
wp-admin/includes/template.php
508 508 $args['popular_cats'] = get_terms( 'category', array( 'fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) ); 509 509 510 510 if ( $descendants_and_self ) { 511 $categories = get_categories( "child_of=$descendants_and_self&hierarchical=0&hide_empty=0");511 $categories = get_categories(array('child_of' => $descendants_and_self, 'hierarchical' => 0, 'hide_empty' => 0)); 512 512 $self = get_category( $descendants_and_self ); 513 513 array_unshift( $categories, $self ); 514 514 } else { 515 $categories = get_categories( 'get=all');515 $categories = get_categories(array('get' => 'all'); 516 516 } 517 517 518 518 // Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache) … … 607 607 $checked_categories[] = $default; 608 608 } 609 609 610 $categories = get_terms('link_category', 'orderby=count&hide_empty=0');610 $categories = get_terms('link_category', array('orderby' => 'count', 'hide_empty' => 0)); 611 611 612 612 if ( empty($categories) ) 613 613 return; -
wp-admin/includes/export.php
43 43 // grab a snapshot of post IDs, just in case it changes during the export 44 44 $post_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts $where ORDER BY post_date_gmt ASC"); 45 45 46 $categories = (array) get_categories( 'get=all');47 $tags = (array) get_tags( 'get=all');46 $categories = (array) get_categories(array('get' => 'all'); 47 $tags = (array) get_tags(array('get' => 'all')); 48 48 49 49 /** 50 50 * {@internal Missing Short Description}} … … 69 69 } 70 70 71 71 while ( $parents = wxr_missing_parents($categories) ) { 72 $found_parents = get_categories( "include=" . join(', ', $parents));72 $found_parents = get_categories(array('include' => join(', ', $parents))); 73 73 if ( is_array($found_parents) && count($found_parents) ) 74 74 $categories = array_merge($categories, $found_parents); 75 75 else -
wp-admin/import/opml.php
55 55 <p style="clear: both; margin-top: 1em;"><label for="cat_id"><?php _e('Now select a category you want to put these links in.') ?></label><br /> 56 56 <?php _e('Category:') ?> <select name="cat_id" id="cat_id"> 57 57 <?php 58 $categories = get_terms('link_category', 'get=all');58 $categories = get_terms('link_category', array('get' => 'all')); 59 59 foreach ($categories as $category) { 60 60 ?> 61 61 <option value="<?php echo $category->term_id; ?>"><?php echo esc_html(apply_filters('link_category', $category->name)); ?></option> -
wp-admin/import/wp-cat2tag.php
39 39 40 40 function populate_cats() { 41 41 42 $categories = get_categories( 'get=all');42 $categories = get_categories(array('get' => 'all'); 43 43 foreach ( $categories as $category ) { 44 44 $this->all_categories[] = $category; 45 45 if ( is_term( $category->slug, 'post_tag' ) ) … … 49 49 50 50 function populate_tags() { 51 51 52 $tags = get_terms( array('post_tag'), 'get=all');52 $tags = get_terms( array('post_tag'), array('get' => 'all') ); 53 53 foreach ( $tags as $tag ) { 54 54 $this->all_tags[] = $tag; 55 55 if ( is_term( $tag->slug, 'category' ) ) -
wp-admin/import/wordpress.php
290 290 function process_categories() { 291 291 global $wpdb; 292 292 293 $cat_names = (array) get_terms('category', 'fields=names');293 $cat_names = (array) get_terms('category', array('fields' => 'names')); 294 294 295 295 while ( $c = array_shift($this->categories) ) { 296 296 $cat_name = trim($this->get_tag( $c, 'wp:cat_name' )); … … 320 320 function process_tags() { 321 321 global $wpdb; 322 322 323 $tag_names = (array) get_terms('post_tag', 'fields=names');323 $tag_names = (array) get_terms('post_tag', array('fields' => 'names')); 324 324 325 325 while ( $c = array_shift($this->tags) ) { 326 326 $tag_name = trim($this->get_tag( $c, 'wp:tag_name' )); -
wp-admin/link-manager.php
106 106 <input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" /> 107 107 108 108 <?php 109 $categories = get_terms('link_category', "hide_empty=1");109 $categories = get_terms('link_category', array("hide_empty" => 1)); 110 110 $select_cat = "<select name=\"cat_id\">\n"; 111 111 $select_cat .= '<option value="all"' . (($cat_id == 'all') ? " selected='selected'" : '') . '>' . __('View all Categories') . "</option>\n"; 112 112 foreach ((array) $categories as $cat)