Ticket #7427: 7427.diff

File 7427.diff, 759 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'] ) 
    4544                $taxonomy = 'link_category'; 
    46         $categories = (array) get_terms( $taxonomy, $args ); 
     45        $categories = (array) get_terms( $args['taxonomy'], $args ); 
    4746 
    4847        foreach ( array_keys( $categories ) as $k ) 
    4948                _make_cat_compat( $categories[$k] );