Ticket #10614: get_category_template.patch

File get_category_template.patch, 711 bytes (added by scribu, 4 years ago)
  • wp-includes/theme.php

     
    600600 * @return string 
    601601 */ 
    602602function get_category_template() { 
    603         $template = locate_template(array("category-" . absint( get_query_var('cat') ) . '.php', 'category.php')); 
     603        $cat_ID = absint( get_query_var('cat') ); 
     604 
     605        $category = get_category( $cat_ID ); 
     606        if ( is_wp_error( $category ) ) 
     607                return false; 
     608 
     609        $template = locate_template(array( 
     610                "category-" . $category->slug . '.php', 
     611                "category-" . $cat_ID . '.php', 
     612                'category.php' 
     613        )); 
     614 
    604615        return apply_filters('category_template', $template); 
    605616} 
    606617