Make WordPress Core

Changeset 7627


Ignore:
Timestamp:
04/08/2008 01:55:26 AM (17 years ago)
Author:
ryan
Message:

Move category query to get category case of get_permalink to avoid unnecessary queries. Props mdawaffe. fixes #6638 for 2.5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.5/wp-includes/link-template.php

    r7589 r7627  
    8181            if ( $parent=$cats[0]->parent )
    8282                $category = get_category_parents($parent, FALSE, '/', TRUE) . $category;
    83         }
    84 
    85         // show default category in permalinks, without
    86         // having to assign it explicitly
    87         if ( empty($category) ) {
    88             $default_category = get_category( get_option( 'default_category' ) );
    89             $category = is_wp_error( $default_category)? '' : $default_category->slug;
     83
     84            // show default category in permalinks, without
     85            // having to assign it explicitly
     86            if ( empty($category) ) {
     87                $default_category = get_category( get_option( 'default_category' ) );
     88                $category = is_wp_error( $default_category ) ? '' : $default_category->slug;
     89            }
    9090        }
    9191
Note: See TracChangeset for help on using the changeset viewer.