Make WordPress Core


Ignore:
Timestamp:
12/06/2007 07:49:33 PM (19 years ago)
Author:
ryan
Message:

Remove unused vars. Props DD32. see #5418

File:
1 edited

Legend:

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

    r6351 r6364  
    2727
    2828function &get_children($args = '', $output = OBJECT) {
    29         global $wpdb;
    30 
    3129        if ( empty( $args ) ) {
    3230                if ( isset( $GLOBALS['post'] ) ) {
    … …  
    164162
    165163function get_post_type($post = false) {
    166         global $wpdb, $posts;
     164        global $posts;
    167165
    168166        if ( false === $post )
    … …  
    311309
    312310function get_post_meta($post_id, $key, $single = false) {
    313         global $wpdb;
    314 
    315311        $post_id = (int) $post_id;
    316312
    … …  
    343339        global $wpdb;
    344340
    345         $original_value = $meta_value;
    346341        $meta_value = maybe_serialize($meta_value);
    347 
    348         $original_prev = $prev_value;
    349342        $prev_value = maybe_serialize($prev_value);
    350343
    … …  
    379372
    380373function get_post_custom($post_id = 0) {
    381         global $id, $wpdb;
     374        global $id;
    382375
    383376        if ( !$post_id )
    … …  
    578571
    579572function wp_get_single_post($postid = 0, $mode = OBJECT) {
    580         global $wpdb;
    581 
    582573        $postid = (int) $postid;
    583574
    … …  
    598589
    599590function wp_insert_post($postarr = array()) {
    600         global $wpdb, $wp_rewrite, $allowedtags, $user_ID;
     591        global $wpdb, $wp_rewrite, $user_ID;
    601592
    602593        $defaults = array('post_status' => 'draft', 'post_type' => 'post', 'post_author' => $user_ID,
    … …  
    769760
    770761function wp_update_post($postarr = array()) {
    771         global $wpdb;
    772 
    773762        if ( is_object($postarr) )
    774763                $postarr = get_object_vars($postarr);
    … …  
    836825function wp_set_post_tags( $post_id = 0, $tags = '', $append = false ) {
    837826        /* $append - true = don't delete existing tags, just add on, false = replace the tags with the new tags */
    838         global $wpdb;
    839827
    840828        $post_id = (int) $post_id;
    … …  
    850838
    851839function wp_set_post_categories($post_ID = 0, $post_categories = array()) {
    852         global $wpdb;
    853 
    854840        $post_ID = (int) $post_ID;
    855841        // If $post_categories isn't already an array, make it one:
    … …  
    891877
    892878function get_enclosed($post_id) { // Get enclosures already enclosed for a post
    893         global $wpdb;
    894879        $custom_fields = get_post_custom( $post_id );
    895880        $pung = array();
    … …  
    12271212
    12281213        // expected_slashed ($post_name)
    1229         $post_name_check =
    1230                 $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM $wpdb->posts WHERE post_name = '$post_name' AND post_status = 'inherit' AND ID != %d LIMIT 1", $post_ID));
     1214        $post_name_check = $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM $wpdb->posts WHERE post_name = '$post_name' AND post_status = 'inherit' AND ID != %d LIMIT 1", $post_ID));
    12311215
    12321216        if ($post_name_check) {
    … …  
    15481532
    15491533function get_lastpostdate($timezone = 'server') {
    1550         global $cache_lastpostdate, $pagenow, $wpdb, $blog_id;
    1551         $add_seconds_blog = get_option('gmt_offset') * 3600;
     1534        global $cache_lastpostdate, $wpdb, $blog_id;
    15521535        $add_seconds_server = date('Z');
    15531536        if ( !isset($cache_lastpostdate[$blog_id][$timezone]) ) {
    … …  
    15711554
    15721555function get_lastpostmodified($timezone = 'server') {
    1573         global $cache_lastpostmodified, $pagenow, $wpdb, $blog_id;
    1574         $add_seconds_blog = get_option('gmt_offset') * 3600;
     1556        global $cache_lastpostmodified, $wpdb, $blog_id;
    15751557        $add_seconds_server = date('Z');
    15761558        if ( !isset($cache_lastpostmodified[$blog_id][$timezone]) ) {
    … …  
    16341616
    16351617function update_post_caches(&$posts) {
    1636         global $wpdb;
    1637 
    16381618        // No point in doing all this work if we didn't match any posts.
    16391619        if ( !$posts )
    … …  
    17391719                return;
    17401720
    1741         $post = get_post($post_id);
    1742 
    17431721        $data = array( 'post_id' => $post_id, 'meta_value' => '1' );
    17441722        if ( get_option('default_pingback_flag') )
Note: See TracChangeset for help on using the changeset viewer.