WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/31/2010 11:02:17 AM (9 years ago)
Author:
scribu
Message:

use get_queried_object() wrappers throughout. See #14015

File:
1 edited

Legend:

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

    r16066 r16114  
    527527 */
    528528function wp_title($sep = '»', $display = true, $seplocation = '') {
    529     global $wpdb, $wp_locale, $wp_query;
     529    global $wpdb, $wp_locale;
    530530
    531531    $m = get_query_var('m');
     
    556556    // If there's an author
    557557    if ( is_author() ) {
    558         $author = $wp_query->get_queried_object();
     558        $author = get_queried_object();
    559559        $title = $author->display_name;
    560560    }
     
    634634 */
    635635function single_post_title($prefix = '', $display = true) {
    636     global $wp_query, $post;
     636    global $post;
    637637
    638638    if ( ! $post )
    639         $_post = $wp_query->get_queried_object();
     639        $_post = get_queried_object();
    640640    else
    641641        $_post = $post;
     
    737737 */
    738738function single_term_title( $prefix = '', $display = true ) {
    739     global $wp_query;
    740 
    741     $term = $wp_query->get_queried_object();
     739    $term = get_queried_object();
    742740
    743741    if ( !$term )
     
    16311629 */
    16321630function feed_links_extra( $args = array() ) {
    1633     global $wp_query;
    1634 
    16351631    $defaults = array(
    16361632        /* translators: Separator between blog name and feed type in feed links */
     
    16581654        }
    16591655    } elseif ( is_category() ) {
    1660         $term = $wp_query->get_queried_object();
     1656        $term = get_queried_object();
    16611657
    16621658        $title = esc_attr(sprintf( $args['cattitle'], get_bloginfo('name'), $args['separator'], $term->name ));
    16631659        $href = get_category_feed_link( $term->term_id );
    16641660    } elseif ( is_tag() ) {
    1665         $term = $wp_query->get_queried_object();
     1661        $term = get_queried_object();
    16661662
    16671663        $title = esc_attr(sprintf( $args['tagtitle'], get_bloginfo('name'), $args['separator'], $term->name ));
Note: See TracChangeset for help on using the changeset viewer.