Make WordPress Core


Ignore:
Timestamp:
09/13/2010 04:44:14 PM (14 years ago)
Author:
scribu
Message:

Clean up taxonomy queries in WP_Query. See #12891

File:
1 edited

Legend:

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

    r15599 r15613  
    15901590 */
    15911591function feed_links_extra( $args = array() ) {
     1592    global $wp_query;
     1593
    15921594    $defaults = array(
    15931595        /* translators: Separator between blog name and feed type in feed links */
     
    16151617        }
    16161618    } elseif ( is_category() ) {
    1617         $cat_id = intval( get_query_var('cat') );
    1618 
    1619         $title = esc_attr(sprintf( $args['cattitle'], get_bloginfo('name'), $args['separator'], get_cat_name( $cat_id ) ));
    1620         $href = get_category_feed_link( $cat_id );
     1619        $term = $wp_query->get_queried_object();
     1620
     1621        $title = esc_attr(sprintf( $args['cattitle'], get_bloginfo('name'), $args['separator'], $term->name ));
     1622        $href = get_category_feed_link( $term->term_id );
    16211623    } elseif ( is_tag() ) {
    1622         $tag_id = intval( get_query_var('tag_id') );
    1623         $tag = get_tag( $tag_id );
    1624 
    1625         $title = esc_attr(sprintf( $args['tagtitle'], get_bloginfo('name'), $args['separator'], $tag->name ));
    1626         $href = get_tag_feed_link( $tag_id );
     1624        $term = $wp_query->get_queried_object();
     1625
     1626        $title = esc_attr(sprintf( $args['tagtitle'], get_bloginfo('name'), $args['separator'], $term->name ));
     1627        $href = get_tag_feed_link( $term->term_id );
    16271628    } elseif ( is_author() ) {
    16281629        $author_id = intval( get_query_var('author') );
Note: See TracChangeset for help on using the changeset viewer.