Ticket #5607: remove_admin_notices2.diff
File remove_admin_notices2.diff, 1.6 KB (added by , 17 years ago) |
---|
-
wp-includes/taxonomy.php
506 506 */ 507 507 function &get_terms($taxonomies, $args = '') { 508 508 global $wpdb; 509 $empty_array = array(); 509 510 510 511 $single_taxonomy = false; 511 512 if ( !is_array($taxonomies) ) { … … 545 546 if ( $child_of ) { 546 547 $hierarchy = _get_term_hierarchy($taxonomies[0]); 547 548 if ( !isset($hierarchy[$child_of]) ) 548 return array();549 return $empty_array; 549 550 } 550 551 551 552 if ( $parent ) { 552 553 $hierarchy = _get_term_hierarchy($taxonomies[0]); 553 554 if ( !isset($hierarchy[$parent]) ) 554 return array();555 return $empty_array; 555 556 } 556 557 557 558 $key = md5( serialize( $args ) . serialize( $taxonomies ) ); … … 1581 1582 * @return bool|array Empty array if $terms found, but not $taxonomy. False if nothing is in cache for $taxonomy and $id. 1582 1583 */ 1583 1584 function &get_object_term_cache($id, $taxonomy) { 1584 return wp_cache_get($id, "{$taxonomy}_relationships"); 1585 $cache = wp_cache_get($id, "{$taxonomy}_relationships"); 1586 return $cache; 1585 1587 } 1586 1588 1587 1589 /** … … 1727 1729 * @return array Empty if $terms is empty else returns full list of child terms. 1728 1730 */ 1729 1731 function &_get_term_children($term_id, $terms, $taxonomy) { 1732 $empty_array = array(); 1730 1733 if ( empty($terms) ) 1731 return array();1734 return $empty_array; 1732 1735 1733 1736 $term_list = array(); 1734 1737 $has_children = _get_term_hierarchy($taxonomy); 1735 1738 1736 1739 if ( ( 0 != $term_id ) && ! isset($has_children[$term_id]) ) 1737 return array();1740 return $empty_array; 1738 1741 1739 1742 foreach ( $terms as $term ) { 1740 1743 $use_id = false; … … 1850 1853 } 1851 1854 } 1852 1855