Changeset 15549
- Timestamp:
- 08/28/2010 11:57:28 AM (13 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/comment-template.php
r15433 r15549 546 546 */ 547 547 function get_comments_number( $post_id = 0 ) { 548 global $id;549 $post_id = (int) $post_id;550 551 548 if ( !$post_id ) 552 $post_id = (int) $id; 549 $post_id = get_the_ID(); 550 551 $post_id = absint($post_id); 553 552 554 553 $post = get_post($post_id); … … 565 564 * 566 565 * @since 0.71 567 * @uses $id568 566 * @uses apply_filters() Calls the 'comments_number' hook on the output and number of comments respectively. 569 567 * … … 574 572 */ 575 573 function comments_number( $zero = false, $one = false, $more = false, $deprecated = '' ) { 576 global $id;577 578 574 if ( !empty( $deprecated ) ) 579 575 _deprecated_argument( __FUNCTION__, '1.3' ); 580 576 581 $number = get_comments_number( $id);577 $number = get_comments_number(get_the_ID()); 582 578 583 579 if ( $number > 1 ) … … 704 700 * @since 1.5.0 705 701 * @uses apply_filters() Calls 'trackback_url' on the resulting trackback URL 706 * @uses $id707 702 * 708 703 * @return string The trackback URL after being filtered 709 704 */ 710 705 function get_trackback_url() { 711 global $id;712 706 if ( '' != get_option('permalink_structure') ) { 713 707 $tb_url = trailingslashit(get_permalink()) . user_trailingslashit('trackback', 'single_trackback'); 714 708 } else { 715 $tb_url = get_option('siteurl') . '/wp-trackback.php?p=' . $id;709 $tb_url = get_option('siteurl') . '/wp-trackback.php?p=' . get_the_ID(); 716 710 } 717 711 return apply_filters('trackback_url', $tb_url); … … 845 839 * @global array $comment List of comment objects for the current post 846 840 * @uses $wpdb 847 * @uses $id848 841 * @uses $post 849 842 * @uses $withcomments Will not try to get the comments if the post has none. … … 962 955 * 963 956 * @since 0.71 964 * @uses $id965 957 * @uses $wpcommentspopupfile 966 958 * @uses $wpcommentsjavascript … … 975 967 */ 976 968 function comments_popup_link( $zero = false, $one = false, $more = false, $css_class = '', $none = false ) { 977 global $id, $wpcommentspopupfile, $wpcommentsjavascript; 969 global $wpcommentspopupfile, $wpcommentsjavascript; 970 971 $id = get_the_ID(); 978 972 979 973 if ( false === $zero ) $zero = __( 'No Comments' ); … … 1169 1163 */ 1170 1164 function get_comment_id_fields() { 1171 global $id;1165 $id = get_the_ID(); 1172 1166 1173 1167 $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0; -
trunk/wp-includes/link-template.php
r15481 r15549 463 463 */ 464 464 function get_post_comments_feed_link($post_id = '', $feed = '') { 465 global $id;466 467 if ( empty($post_id) ) 468 $post_id = (int) $id;465 if ( !$post_id ) 466 $post_id = get_the_ID(); 467 468 $post_id = absint($post_id); 469 469 470 470 if ( empty($feed) ) -
trunk/wp-includes/post-template.php
r15264 r15549 13 13 * 14 14 * @since 0.71 15 * @uses $id16 15 */ 17 16 function the_ID() { 18 global $id; 19 echo $id; 17 echo get_the_ID(); 20 18 } 21 19 … … 24 22 * 25 23 * @since 2.1.0 26 * @uses $ id27 * 28 * @return unknown24 * @uses $post 25 * 26 * @return int 29 27 */ 30 28 function get_the_ID() { 31 global $ id;32 return $ id;29 global $post; 30 return $post->ID; 33 31 } 34 32 … … 182 180 */ 183 181 function get_the_content($more_link_text = null, $stripteaser = 0) { 184 global $ id, $post, $more, $page, $pages, $multipage, $preview;182 global $post, $more, $page, $pages, $multipage, $preview; 185 183 186 184 if ( null === $more_link_text ) … … 217 215 if ( count($content) > 1 ) { 218 216 if ( $more ) { 219 $output .= '<span id="more-' . $ id. '"></span>' . $content[1];217 $output .= '<span id="more-' . $post->ID . '"></span>' . $content[1]; 220 218 } else { 221 219 if ( ! empty($more_link_text) ) 222 $output .= apply_filters( 'the_content_more_link', ' <a href="' . get_permalink() . "#more- $id\" class=\"more-link\">$more_link_text</a>", $more_link_text );220 $output .= apply_filters( 'the_content_more_link', ' <a href="' . get_permalink() . "#more-{$post->ID}\" class=\"more-link\">$more_link_text</a>", $more_link_text ); 223 221 $output = force_balance_tags($output); 224 222 } -
trunk/wp-includes/post-thumbnail-template.php
r15355 r15549 19 19 */ 20 20 function has_post_thumbnail( $post_id = NULL ) { 21 global $id; 22 $post_id = ( NULL === $post_id ) ? $id : $post_id; 21 $post_id = ( NULL === $post_id ) ? get_the_ID() : $post_id; 23 22 return !! get_post_thumbnail_id( $post_id ); 24 23 } … … 33 32 */ 34 33 function get_post_thumbnail_id( $post_id = NULL ) { 35 global $id; 36 $post_id = ( NULL === $post_id ) ? $id : $post_id; 34 $post_id = ( NULL === $post_id ) ? get_the_ID() : $post_id; 37 35 return get_post_meta( $post_id, '_thumbnail_id', true ); 38 36 } … … 60 58 */ 61 59 function get_the_post_thumbnail( $post_id = NULL, $size = 'post-thumbnail', $attr = '' ) { 62 global $id; 63 $post_id = ( NULL === $post_id ) ? $id : $post_id; 60 $post_id = ( NULL === $post_id ) ? get_the_ID() : $post_id; 64 61 $post_thumbnail_id = get_post_thumbnail_id( $post_id ); 65 62 $size = apply_filters( 'post_thumbnail_size', $size ); -
trunk/wp-includes/post.php
r15548 r15549 1269 1269 */ 1270 1270 function get_post_custom($post_id = 0) { 1271 global $id;1272 1273 1271 if ( !$post_id ) 1274 $post_id = (int) $id;1272 $post_id = get_the_ID(); 1275 1273 1276 1274 $post_id = (int) $post_id; … … 1337 1335 */ 1338 1336 function is_sticky($post_id = null) { 1339 global $id; 1337 if ( !$post_id ) 1338 $post_id = get_the_ID(); 1340 1339 1341 1340 $post_id = absint($post_id); 1342 1343 if ( !$post_id )1344 $post_id = absint($id);1345 1341 1346 1342 $stickies = get_option('sticky_posts');
Note: See TracChangeset
for help on using the changeset viewer.