Changeset 5553 for trunk/wp-includes/taxonomy.php
- Timestamp:
- 05/26/2007 06:54:16 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/taxonomy.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/taxonomy.php
r5552 r5553 137 137 138 138 foreach ( (array) $objects as $object ) { 139 $terms = get_object_terms($object, $taxonomy, ' get=ids');139 $terms = get_object_terms($object, $taxonomy, 'fields=ids'); 140 140 if ( 1 == count($terms) && isset($default) ) 141 141 $terms = array($default); … … 320 320 $object_ids = ($single_object = !is_array($object_id)) ? array($object_id) : $object_id; 321 321 322 $defaults = array('orderby' => 'name', 'order' => 'ASC', ' get' => 'everything');322 $defaults = array('orderby' => 'name', 'order' => 'ASC', 'fields' => 'all'); 323 323 $args = wp_parse_args( $args, $defaults ); 324 324 extract($args); … … 332 332 $object_ids = implode(', ', $object_ids); 333 333 334 if ( ' everything' == $get)334 if ( 'all' == $fields ) 335 335 $select_this = 't.*'; 336 else if ( 'ids' == $ get)336 else if ( 'ids' == $fields ) 337 337 $select_this = 't.term_id'; 338 338 339 339 $query = "SELECT $select_this FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN $wpdb->term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ($taxonomies) AND tr.object_id IN ($object_ids) ORDER BY $orderby $order"; 340 340 341 if ( ' everything' == $get)341 if ( 'all' == $fields ) 342 342 $taxonomy_data = $wpdb->get_results($query); 343 else if ( 'ids' == $ get)343 else if ( 'ids' == $fields ) 344 344 $taxonomy_data = $wpdb->get_col($query); 345 345 … … 380 380 $defaults = array('orderby' => 'name', 'order' => 'ASC', 381 381 'hide_empty' => true, 'exclude' => '', 'include' => '', 382 'number' => '', ' get' => 'everything', 'slug' => '', 'parent' => '',383 'hierarchical' => true, 'child_of' => 0 );382 'number' => '', 'fields' => 'all', 'slug' => '', 'parent' => '', 383 'hierarchical' => true, 'child_of' => 0, 'get' => ''); 384 384 $args = wp_parse_args( $args, $defaults ); 385 385 $args['number'] = (int) $args['number']; … … 387 387 $args['child_of'] = 0; 388 388 $args['hierarchical'] = false; 389 } else { 390 $tax = get_taxonomy($taxonomy); 391 if ( !$tax['hierarchical'] ) { 392 $args['child_of'] = 0; 393 $args['hierarchical'] = false; 394 } 389 } else if ( !is_taxonomy_hierarchical($taxonomies[0]) ) { 390 $args['child_of'] = 0; 391 $args['hierarchical'] = false; 392 } 393 if ( 'all' == $args['get'] ) { 394 $args['child_of'] = 0; 395 $args['hide_empty'] = 0; 396 $args['hierarchical'] = false; 395 397 } 396 398 extract($args); … … 464 466 $number = ''; 465 467 466 if ( ' everything' == $get)468 if ( 'all' == $fields ) 467 469 $select_this = 't.*, tt.*'; 468 else if ( 'ids' == $ get)470 else if ( 'ids' == $fields ) 469 471 $select_this = 't.term_id'; 470 472 471 473 $query = "SELECT $select_this FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ($in_taxonomies) $where ORDER BY $orderby $order $number"; 472 474 473 if ( ' everything' == $get)475 if ( 'all' == $fields ) 474 476 $terms = $wpdb->get_results($query); 475 else if ( 'ids' == $ get)477 else if ( 'ids' == $fields ) 476 478 $terms = $wpdb->get_col($query); 477 479
Note: See TracChangeset
for help on using the changeset viewer.