Changeset 5567
- Timestamp:
- 05/28/2007 12:51:24 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/taxonomy.php
r5563 r5567 1 1 <?php 2 2 3 $wp_taxonomies = 4 array('category' => array('object_type' => 'post', 'hierarchical' => true, 'update_count_callback' => '_update_post_term_count'), 5 'post_tag' => array('object_type' => 'post', 'hierarchical' => false, 'update_count_callback' => '_update_post_term_count'), 6 'link_category' => array('object_type' => 'link', 'hierarchical' => false)); 7 3 $wp_taxonomies = array(); 4 $wp_taxonomies['category'] = (object) array('name' => 'category', 'object_type' => 'post', 'hierarchical' => true, 'update_count_callback' => '_update_post_term_count'); 5 $wp_taxonomies['post_tag'] = (object) array('name' => 'post_tag', 'object_type' => 'post', 'hierarchical' => false, 'update_count_callback' => '_update_post_term_count'); 6 $wp_taxonomies['link_category'] = (object) array('name' => 'link_category', 'object_type' => 'link', 'hierarchical' => false); 7 8 //error_log(var_export($wp_taxonomies, true), 0); 8 9 function is_taxonomy( $taxonomy ) { 9 10 global $wp_taxonomies; … … 26 27 27 28 $taxonomy = get_taxonomy($taxonomy); 28 return $taxonomy ['hierarchical'];29 return $taxonomy->hierarchical; 29 30 } 30 31 … … 32 33 global $wp_taxonomies; 33 34 35 $defaults = array('hierarchical' => false, 'update_count_callback' => ''); 36 $args = wp_parse_args($args, $defaults); 37 38 $args['name'] = $taxonomy; 34 39 $args['object_type'] = $object_type; 35 $wp_taxonomies[$taxonomy] = $args;40 $wp_taxonomies[$taxonomy] = (object) $args; 36 41 } 37 42 … … 260 265 261 266 $taxonomy = get_taxonomy($taxonomy); 262 if ( isset($taxonomy ['update_count_callback']) )263 return call_user_func($taxonomy ['update_count_callback'], $terms);267 if ( isset($taxonomy->update_count_callback) ) 268 return call_user_func($taxonomy->update_count_callback, $terms); 264 269 265 270 // Default count updater … … 338 343 $id = $id['term_taxonomy_id']; 339 344 $tt_ids[] = $id; 345 340 346 if ( $wpdb->get_var("SELECT term_taxonomy_id FROM $wpdb->term_relationships WHERE object_id = '$object_id' AND term_taxonomy_id = '$id'") ) 341 347 continue; … … 401 407 $taxonomy_data = $wpdb->get_col($query); 402 408 else if ( 'tt_ids' == $fields ) 403 $taxonomy_data = $wpdb->get_col("SELECT t erm_taxonomy_id FROM $wpdb->term_relationships WHERE object_id IN ($object_ids) ORDER BYterm_taxonomy_id $order");409 $taxonomy_data = $wpdb->get_col("SELECT tr.term_taxonomy_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tr.object_id IN ($object_ids) AND tt.taxonomy IN ($taxonomies) ORDER BY tr.term_taxonomy_id $order"); 404 410 405 411 if ( ! $taxonomy_data )
Note: See TracChangeset
for help on using the changeset viewer.