Changeset 25161 for trunk/src/wp-includes/taxonomy.php
- Timestamp:
- 08/29/2013 03:18:08 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/taxonomy.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r25142 r25161 1384 1384 switch ( $fields ) { 1385 1385 case 'all': 1386 $selects = array( 't.*', 'tt.*');1386 $selects = array( 't.*', 'tt.*' ); 1387 1387 break; 1388 1388 case 'ids': 1389 1389 case 'id=>parent': 1390 $selects = array( 't.term_id', 'tt.parent', 'tt.count');1390 $selects = array( 't.term_id', 'tt.parent', 'tt.count' ); 1391 1391 break; 1392 1392 case 'names': 1393 $selects = array( 't.term_id', 'tt.parent', 'tt.count', 't.name');1393 $selects = array( 't.term_id', 'tt.parent', 'tt.count', 't.name' ); 1394 1394 break; 1395 1395 case 'count': 1396 1396 $orderby = ''; 1397 1397 $order = ''; 1398 $selects = array('COUNT(*)'); 1398 $selects = array( 'COUNT(*)' ); 1399 break; 1400 case 'id=>name': 1401 $selects = array( 't.term_id', 't.name' ); 1402 break; 1403 case 'id=>slug': 1404 $selects = array( 't.term_id', 't.slug' ); 1405 break; 1399 1406 } 1400 1407 … … 1455 1462 } 1456 1463 } 1457 reset ( $terms );1464 reset( $terms ); 1458 1465 1459 1466 $_terms = array(); 1460 1467 if ( 'id=>parent' == $fields ) { 1461 while ( $term = array_shift( $terms) )1468 while ( $term = array_shift( $terms ) ) 1462 1469 $_terms[$term->term_id] = $term->parent; 1470 } elseif ( 'ids' == $fields ) { 1471 while ( $term = array_shift( $terms ) ) 1472 $_terms[] = $term->term_id; 1473 } elseif ( 'names' == $fields ) { 1474 while ( $term = array_shift( $terms ) ) 1475 $_terms[] = $term->name; 1476 } elseif ( 'id=>name' == $fields ) { 1477 while ( $term = array_shift( $terms ) ) 1478 $_terms[$term->term_id] = $term->name; 1479 } elseif ( 'id=>slug' == $fields ) { 1480 while ( $term = array_shift( $terms ) ) 1481 $_terms[$term->term_id] = $term->slug; 1482 } 1483 1484 if ( ! empty( $_terms ) ) 1463 1485 $terms = $_terms; 1464 } elseif ( 'ids' == $fields ) {1465 while ( $term = array_shift($terms) )1466 $_terms[] = $term->term_id;1467 $terms = $_terms;1468 } elseif ( 'names' == $fields ) {1469 while ( $term = array_shift($terms) )1470 $_terms[] = $term->name;1471 $terms = $_terms;1472 }1473 1486 1474 1487 if ( $number && is_array( $terms ) && count( $terms ) > $number ) … … 1477 1490 wp_cache_add( $cache_key, $terms, 'terms', DAY_IN_SECONDS ); 1478 1491 1479 $terms = apply_filters( 'get_terms', $terms, $taxonomies, $args);1492 $terms = apply_filters( 'get_terms', $terms, $taxonomies, $args ); 1480 1493 return $terms; 1481 1494 }
Note: See TracChangeset
for help on using the changeset viewer.