Changeset 16114
- Timestamp:
- 10/31/2010 11:02:17 AM (14 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/admin-bar.php
r16098 r16114 174 174 */ 175 175 function wp_admin_bar_edit_menu () { 176 global $wp_admin_bar , $wp_query;177 178 $current_object = $wp_query->get_queried_object();176 global $wp_admin_bar; 177 178 $current_object = get_queried_object(); 179 179 180 180 if ( empty($current_object) ) -
trunk/wp-includes/category-template.php
r16100 r16114 466 466 } 467 467 } else { 468 global $wp_query;469 470 468 if( !empty( $show_option_all ) ) 471 469 if ( 'list' == $style ) … … 475 473 476 474 if ( empty( $r['current_category'] ) && ( is_category() || is_tax() ) ) 477 $r['current_category'] = $wp_query->get_queried_object_id();475 $r['current_category'] = get_queried_object_id(); 478 476 479 477 if ( $hierarchical ) … … 1026 1024 function term_description( $term = 0, $taxonomy = 'post_tag' ) { 1027 1025 if ( !$term && ( is_tax() || is_tag() || is_category() ) ) { 1028 global $wp_query; 1029 $term = $wp_query->get_queried_object(); 1026 $term = get_queried_object(); 1030 1027 $taxonomy = $term->taxonomy; 1031 1028 $term = $term->term_id; -
trunk/wp-includes/general-template.php
r16066 r16114 527 527 */ 528 528 function wp_title($sep = '»', $display = true, $seplocation = '') { 529 global $wpdb, $wp_locale , $wp_query;529 global $wpdb, $wp_locale; 530 530 531 531 $m = get_query_var('m'); … … 556 556 // If there's an author 557 557 if ( is_author() ) { 558 $author = $wp_query->get_queried_object();558 $author = get_queried_object(); 559 559 $title = $author->display_name; 560 560 } … … 634 634 */ 635 635 function single_post_title($prefix = '', $display = true) { 636 global $ wp_query, $post;636 global $post; 637 637 638 638 if ( ! $post ) 639 $_post = $wp_query->get_queried_object();639 $_post = get_queried_object(); 640 640 else 641 641 $_post = $post; … … 737 737 */ 738 738 function single_term_title( $prefix = '', $display = true ) { 739 global $wp_query; 740 741 $term = $wp_query->get_queried_object(); 739 $term = get_queried_object(); 742 740 743 741 if ( !$term ) … … 1631 1629 */ 1632 1630 function feed_links_extra( $args = array() ) { 1633 global $wp_query;1634 1635 1631 $defaults = array( 1636 1632 /* translators: Separator between blog name and feed type in feed links */ … … 1658 1654 } 1659 1655 } elseif ( is_category() ) { 1660 $term = $wp_query->get_queried_object();1656 $term = get_queried_object(); 1661 1657 1662 1658 $title = esc_attr(sprintf( $args['cattitle'], get_bloginfo('name'), $args['separator'], $term->name )); 1663 1659 $href = get_category_feed_link( $term->term_id ); 1664 1660 } elseif ( is_tag() ) { 1665 $term = $wp_query->get_queried_object();1661 $term = get_queried_object(); 1666 1662 1667 1663 $title = esc_attr(sprintf( $args['tagtitle'], get_bloginfo('name'), $args['separator'], $term->name )); -
trunk/wp-includes/link-template.php
r16083 r16114 717 717 function edit_term_link( $link = '', $before = '', $after = '', $term = null, $echo = true ) { 718 718 if ( is_null( $term ) ) { 719 global $wp_query; 720 $term = $wp_query->get_queried_object(); 719 $term = get_queried_object(); 721 720 } 722 721 -
trunk/wp-includes/theme.php
r16029 r16114 856 856 */ 857 857 function get_tag_template() { 858 global $wp_query; 859 860 $tag = $wp_query->get_queried_object(); 858 $tag = get_queried_object(); 861 859 $tag_name = $tag->slug; 862 860 $tag_id = $tag->term_id; … … 962 960 */ 963 961 function get_page_template() { 964 global $wp_query; 965 966 $id = (int) $wp_query->get_queried_object_id(); 962 $id = get_queried_object_id(); 967 963 $template = get_post_meta($id, '_wp_page_template', true); 968 964 $pagename = get_query_var('pagename'); … … 970 966 if ( !$pagename && $id > 0 ) { 971 967 // If a static page is set as the front page, $pagename will not be set. Retrieve it from the queried object 972 $post = $wp_query->get_queried_object();968 $post = get_queried_object(); 973 969 $pagename = $post->post_name; 974 970 } … … 1019 1015 */ 1020 1016 function get_single_template() { 1021 global $wp_query; 1022 1023 $object = $wp_query->get_queried_object(); 1017 $object = get_queried_object(); 1024 1018 $templates = array('single-' . $object->post_type . '.php', 'single.php'); 1025 1019
Note: See TracChangeset
for help on using the changeset viewer.