Make WordPress Core


Ignore:
Timestamp:
11/19/2006 07:56:05 AM (19 years ago)
Author:
ryan
Message:

Remove trailing spaces and convert spaces to tabs. Props Nazgul. fixes #986

File:
1 edited

Legend:

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

    r4425 r4495  
    167167    if ( !empty($include) ) {
    168168        $offset = 0;    //ignore offset, category, exclude, meta_key, and meta_value params if using include
    169         $category = ''; 
    170         $exclude = ''; 
     169        $category = '';
     170        $exclude = '';
    171171        $meta_key = '';
    172172        $meta_value = '';
     
    182182        }
    183183    }
    184     if (!empty($inclusions)) 
    185         $inclusions .= ')'; 
     184    if (!empty($inclusions))
     185        $inclusions .= ')';
    186186
    187187    $exclusions = '';
     
    197197        }
    198198    }
    199     if (!empty($exclusions)) 
     199    if (!empty($exclusions))
    200200        $exclusions .= ')';
    201201
    202202    $query ="SELECT DISTINCT * FROM $wpdb->posts " ;
    203     $query .= ( empty( $category ) ? "" : ", $wpdb->post2cat " ) ; 
    204     $query .= ( empty( $meta_key ) ? "" : ", $wpdb->postmeta " ) ; 
     203    $query .= ( empty( $category ) ? "" : ", $wpdb->post2cat " ) ;
     204    $query .= ( empty( $meta_key ) ? "" : ", $wpdb->postmeta " ) ;
    205205    $query .= " WHERE (post_type = 'post' AND post_status = 'publish') $exclusions $inclusions " ;
    206206    $query .= ( empty( $category ) ? "" : "AND ($wpdb->posts.ID = $wpdb->post2cat.post_id AND $wpdb->post2cat.category_id = " . $category. ") " ) ;
     
    401401    $post_ID = (int) $post_ID;
    402402
    403     $sql = "SELECT category_id 
    404         FROM $wpdb->post2cat 
    405         WHERE post_id = '$post_ID' 
     403    $sql = "SELECT category_id
     404        FROM $wpdb->post2cat
     405        WHERE post_id = '$post_ID'
    406406        ORDER BY category_id";
    407407
     
    436436    if($mode == OBJECT) {
    437437        $post->post_category = wp_get_post_categories($postid);
    438     } 
     438    }
    439439    else {
    440440        $post['post_category'] = wp_get_post_categories($postid);
     
    636636            if ( $post_pingback )
    637637                $result = $wpdb->query("
    638                     INSERT INTO $wpdb->postmeta 
    639                     (post_id,meta_key,meta_value) 
     638                    INSERT INTO $wpdb->postmeta
     639                    (post_id,meta_key,meta_value)
    640640                    VALUES ('$post_ID','_pingme','1')
    641641                ");
    642642            $result = $wpdb->query("
    643                 INSERT INTO $wpdb->postmeta 
    644                 (post_id,meta_key,meta_value) 
     643                INSERT INTO $wpdb->postmeta
     644                (post_id,meta_key,meta_value)
    645645                VALUES ('$post_ID','_encloseme','1')
    646646            ");
     
    654654            if ( ! update_post_meta($post_ID, '_wp_page_template',  $page_template))
    655655                add_post_meta($post_ID, '_wp_page_template',  $page_template, true);
    656                
     656
    657657        if ( $post_status == 'publish' )
    658658            do_action('publish_page', $post_ID);
     
    685685
    686686    // Passed post category list overwrites existing category list if not empty.
    687     if ( isset($postarr['post_category']) && is_array($postarr['post_category'])
     687    if ( isset($postarr['post_category']) && is_array($postarr['post_category'])
    688688             && 0 != count($postarr['post_category']) )
    689         $post_cats = $postarr['post_category'];
    690     else
    691         $post_cats = $post['post_category'];
     689        $post_cats = $postarr['post_category'];
     690    else
     691        $post_cats = $post['post_category'];
    692692
    693693    // Drafts shouldn't be assigned a date unless explicitly done so by the user
    694     if ( 'draft' == $post['post_status'] && empty($postarr['edit_date']) && empty($postarr['post_date']) && 
    695         ('0000-00-00 00:00:00' == $post['post_date']) )
     694    if ( 'draft' == $post['post_status'] && empty($postarr['edit_date']) && empty($postarr['post_date']) &&
     695            ('0000-00-00 00:00:00' == $post['post_date']) )
    696696        $clear_date = true;
    697697    else
    698698        $clear_date = false;
    699699
    700     // Merge old and new fields with new fields overwriting old ones.
    701     $postarr = array_merge($post, $postarr);
    702     $postarr['post_category'] = $post_cats;
     700    // Merge old and new fields with new fields overwriting old ones.
     701    $postarr = array_merge($post, $postarr);
     702    $postarr['post_category'] = $post_cats;
    703703    if ( $clear_date ) {
    704704        $postarr['post_date'] = '';
     
    734734    // First the old categories
    735735    $old_categories = $wpdb->get_col("
    736         SELECT category_id 
    737         FROM $wpdb->post2cat 
     736        SELECT category_id
     737        FROM $wpdb->post2cat
    738738        WHERE post_id = $post_ID");
    739739
     
    750750        foreach ($delete_cats as $del) {
    751751            $wpdb->query("
    752                 DELETE FROM $wpdb->post2cat 
    753                 WHERE category_id = $del 
    754                     AND post_id = $post_ID 
     752                DELETE FROM $wpdb->post2cat
     753                WHERE category_id = $del
     754                    AND post_id = $post_ID
    755755                ");
    756756        }
     
    849849        $trackback_urls = explode(',', $tb_list);
    850850        foreach($trackback_urls as $tb_url) {
    851             $tb_url = trim($tb_url);
    852             trackback($tb_url, stripslashes($post_title), $excerpt, $post_id);
    853         }
    854     }
     851                $tb_url = trim($tb_url);
     852                trackback($tb_url, stripslashes($post_title), $excerpt, $post_id);
     853        }
     854        }
    855855}
    856856
     
    929929    $pages = $wpdb->get_results("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_name = '$leaf_path' AND post_type='page'");
    930930
    931     if ( empty($pages) ) 
     931    if ( empty($pages) )
    932932        return NULL;
    933933
     
    10191019    $inclusions = '';
    10201020    if ( !empty($include) ) {
    1021         $child_of = 0; //ignore child_of, exclude, meta_key, and meta_value params if using include 
    1022         $exclude = ''; 
     1021        $child_of = 0; //ignore child_of, exclude, meta_key, and meta_value params if using include
     1022        $exclude = '';
    10231023        $meta_key = '';
    10241024        $meta_value = '';
     
    10331033        }
    10341034    }
    1035     if (!empty($inclusions)) 
    1036         $inclusions .= ')'; 
     1035    if (!empty($inclusions))
     1036        $inclusions .= ')';
    10371037
    10381038    $exclusions = '';
     
    11971197    if (empty($post_date))
    11981198        $post_date = current_time('mysql');
    1199     if (empty($post_date_gmt)) 
     1199    if (empty($post_date_gmt))
    12001200        $post_date_gmt = current_time('mysql', 1);
    12011201
Note: See TracChangeset for help on using the changeset viewer.