WordPress.org

Make WordPress Core

Changeset 7626


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

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

File:
1 edited

Legend:

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

    r7588 r7626  
    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.