WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/28/2010 11:57:28 AM (9 years ago)
Author:
scribu
Message:

Don't use the global anymore. Fixes #11624

File:
1 edited

Legend:

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

    r15264 r15549  
    1313 *
    1414 * @since 0.71
    15  * @uses $id
    1615 */
    1716function the_ID() {
    18     global $id;
    19     echo $id;
     17    echo get_the_ID();
    2018}
    2119
     
    2422 *
    2523 * @since 2.1.0
    26  * @uses $id
    27  *
    28  * @return unknown
     24 * @uses $post
     25 *
     26 * @return int
    2927 */
    3028function get_the_ID() {
    31     global $id;
    32     return $id;
     29    global $post;
     30    return $post->ID;
    3331}
    3432
     
    182180 */
    183181function 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;
    185183
    186184    if ( null === $more_link_text )
     
    217215    if ( count($content) > 1 ) {
    218216        if ( $more ) {
    219             $output .= '<span id="more-' . $id . '"></span>' . $content[1];
     217            $output .= '<span id="more-' . $post->ID . '"></span>' . $content[1];
    220218        } else {
    221219            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 );
    223221            $output = force_balance_tags($output);
    224222        }
Note: See TracChangeset for help on using the changeset viewer.