Make WordPress Core


Ignore:
Timestamp:
11/19/2006 07:56:05 AM (18 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-admin/admin-db.php

    r4490 r4495  
    4949        if ( $user->has_cap('edit_posts') || $exclude_zeros == false )
    5050            return array($user->id);
    51         else 
     51        else
    5252            return false;
    5353    }
     
    9797
    9898    $cat_name = apply_filters('pre_category_name', $cat_name);
    99    
     99
    100100    if (empty ($category_nicename))
    101101        $category_nicename = sanitize_title($cat_name);
     
    199199        else
    200200            $cats = array_diff($cats, array($cat_ID));
    201         wp_set_post_categories($post_id, $cats); 
     201        wp_set_post_categories($post_id, $cats);
    202202    }
    203203
     
    210210        else
    211211            $cats = array_diff($cats, array($cat_ID));
    212         wp_set_link_cats($link_id, $cats); 
    213     }
    214    
     212        wp_set_link_cats($link_id, $cats);
     213    }
     214
    215215    wp_cache_delete($cat_ID, 'category');
    216216    wp_cache_delete('all_category_ids', 'category');
     
    286286function wp_revoke_user($id) {
    287287    $id = (int) $id;
    288    
     288
    289289    $user = new WP_User($id);
    290     $user->remove_all_caps();   
     290    $user->remove_all_caps();
    291291}
    292292
     
    386386
    387387    // Passed link category list overwrites existing category list if not empty.
    388     if ( isset($linkdata['link_category']) && is_array($linkdata['link_category'])
     388    if ( isset($linkdata['link_category']) && is_array($linkdata['link_category'])
    389389             && 0 != count($linkdata['link_category']) )
    390         $link_cats = $linkdata['link_category'];
    391     else
    392         $link_cats = $link['link_category'];
     390        $link_cats = $linkdata['link_category'];
     391    else
     392        $link_cats = $link['link_category'];
    393393
    394394    // Merge old and new fields with new fields overwriting old ones.
    395395    $linkdata = array_merge($link, $linkdata);
    396     $linkdata['link_category'] = $link_cats;
     396    $linkdata['link_category'] = $link_cats;
    397397
    398398    return wp_insert_link($linkdata);
     
    403403
    404404    do_action('delete_link', $link_id);
    405    
     405
    406406    $categories = wp_get_link_cats($link_id);
    407407    if( is_array( $categories ) ) {
     
    419419    global $wpdb;
    420420
    421     $sql = "SELECT category_id 
    422         FROM $wpdb->link2cat 
    423         WHERE link_id = $link_ID 
     421    $sql = "SELECT category_id
     422        FROM $wpdb->link2cat
     423        WHERE link_id = $link_ID
    424424        ORDER BY category_id";
    425425
     
    442442    // First the old categories
    443443    $old_categories = $wpdb->get_col("
    444         SELECT category_id 
    445         FROM $wpdb->link2cat 
     444        SELECT category_id
     445        FROM $wpdb->link2cat
    446446        WHERE link_id = $link_ID");
    447447
     
    458458        foreach ($delete_cats as $del) {
    459459            $wpdb->query("
    460                 DELETE FROM $wpdb->link2cat 
    461                 WHERE category_id = $del 
    462                     AND link_id = $link_ID 
     460                DELETE FROM $wpdb->link2cat
     461                WHERE category_id = $del
     462                    AND link_id = $link_ID
    463463                ");
    464464        }
     
    471471        foreach ($add_cats as $new_cat) {
    472472            $wpdb->query("
    473                 INSERT INTO $wpdb->link2cat (link_id, category_id) 
     473                INSERT INTO $wpdb->link2cat (link_id, category_id)
    474474                VALUES ($link_ID, $new_cat)");
    475475        }
    476476    }
    477    
     477
    478478    // Update category counts.
    479479    $all_affected_cats = array_unique(array_merge($link_categories, $old_categories));
Note: See TracChangeset for help on using the changeset viewer.