WordPress.org

Make WordPress Core

Ticket #4384: wp-taxonomy-svn-2007-06-01.diff

File wp-taxonomy-svn-2007-06-01.diff, 1.5 KB (added by rejon, 14 years ago)

This is the patch which does what I say.

  • wp-includes/taxonomy.php

     
    466466function &get_terms($taxonomies, $args = '') {
    467467        global $wpdb;
    468468
     469        $defaults = array('orderby' => 'name', 'order' => 'ASC',
     470                'hide_empty' => true, 'exclude' => '', 'include' => '',
     471                'number' => '', 'fields' => 'all', 'slug' => '', 'parent' => '',
     472                'hierarchical' => true, 'child_of' => 0, 'get' => '');
     473        $args = wp_parse_args( $args, $defaults );
     474
     475    if ( !empty($args['type']) )
     476        $taxonomies = $args['type'];
     477
    469478        $single_taxonomy = false;
    470479        if ( !is_array($taxonomies) ) {
    471480                $single_taxonomy = true;
     
    473482        }
    474483
    475484        $in_taxonomies = "'" . implode("', '", $taxonomies) . "'";
    476 
    477         $defaults = array('orderby' => 'name', 'order' => 'ASC',
    478                 'hide_empty' => true, 'exclude' => '', 'include' => '',
    479                 'number' => '', 'fields' => 'all', 'slug' => '', 'parent' => '',
    480                 'hierarchical' => true, 'child_of' => 0, 'get' => '');
    481         $args = wp_parse_args( $args, $defaults );
     485   
    482486        $args['number'] = (int) $args['number'];
    483487        if ( !$single_taxonomy || !is_taxonomy_hierarchical($taxonomies[0]) ||
    484488                '' != $args['parent'] ) {
     
    493497        }
    494498        extract($args);
    495499
     500
    496501        if ( $child_of ) {
    497502                $hierarchy = _get_term_hierarchy($taxonomies[0]);
    498503                if ( !isset($hierarchy[$child_of]) )
     
    862867        }
    863868}
    864869
    865 ?>
    866  No newline at end of file
     870?>