Ticket #7427: 7427.2.diff

File 7427.2.diff, 803 bytes (added by DD32, 4 years ago)
  • wp-includes/category.php

     
    3737 * @return array List of categories. 
    3838 */ 
    3939function &get_categories( $args = '' ) { 
    40         $defaults = array( 'type' => 'category' ); 
     40        $defaults = array( 'type' => 'category', 'taxonomy' => 'category' ); 
    4141        $args = wp_parse_args( $args, $defaults ); 
    4242 
    43         $taxonomy = 'category'; 
    4443        if ( 'link' == $args['type'] ) 
    45                 $taxonomy = 'link_category'; 
    46         $categories = (array) get_terms( $taxonomy, $args ); 
     44                $args['taxonomy'] = 'link_category'; 
    4745 
     46        $categories = (array) get_terms( $args['taxonomy'], $args ); 
     47 
    4848        foreach ( array_keys( $categories ) as $k ) 
    4949                _make_cat_compat( $categories[$k] ); 
    5050