Make WordPress Core


Ignore:
Timestamp:
02/12/2006 07:53:23 AM (19 years ago)
Author:
ryan
Message:

Death to trailing tabs. Props Mark J. fixes #2405

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-db.php

    r3350 r3517  
    1515
    1616    $editable = get_editable_user_ids( $user_id );
    17    
     17
    1818    if( !$editable ) {
    1919        $other_drafts = '';
     
    4343function get_editable_user_ids( $user_id, $exclude_zeros = true ) {
    4444    global $wpdb;
    45    
     45
    4646    $user = new WP_User( $user_id );
    47    
     47
    4848    if ( ! $user->has_cap('edit_others_posts') ) {
    4949        if ( $user->has_cap('edit_posts') || $exclude_zeros == false )
     
    5858    if ( $exclude_zeros )
    5959        $query .= " AND meta_value != '0'";
    60        
     60
    6161    return $wpdb->get_col( $query );
    6262}
     
    112112        $wpdb->query ("UPDATE $wpdb->categories SET cat_name = '$cat_name', category_nicename = '$category_nicename', category_description = '$category_description', category_parent = '$category_parent' WHERE cat_ID = '$cat_ID'");
    113113    }
    114    
     114
    115115    if ( $category_nicename == '' ) {
    116116        $category_nicename = sanitize_title($cat_name, $cat_ID );
     
    243243function get_link($link_id, $output = OBJECT) {
    244244    global $wpdb;
    245    
     245
    246246    $link = $wpdb->get_row("SELECT * FROM $wpdb->links WHERE link_id = '$link_id'");
    247247
     
    259259function wp_insert_link($linkdata) {
    260260    global $wpdb, $current_user;
    261    
     261
    262262    extract($linkdata);
    263263
     
    267267
    268268    if ( empty($link_rating) )
    269         $link_rating = 0;   
     269        $link_rating = 0;
    270270
    271271    if ( empty($link_target) )
    272         $link_target = ''; 
     272        $link_target = '';
    273273
    274274    if ( empty($link_visible) )
    275275        $link_visible = 'Y';
    276        
     276
    277277    if ( empty($link_owner) )
    278278        $link_owner = $current_user->id;
     
    293293        $link_id = $wpdb->insert_id;
    294294    }
    295    
     295
    296296    if ( $update )
    297297        do_action('edit_link', $link_id);
     
    306306
    307307    $link_id = (int) $linkdata['link_id'];
    308    
     308
    309309    $link = get_link($link_id, ARRAY_A);
    310    
     310
    311311    // Escape data pulled from DB.
    312312    $link = add_magic_quotes($link);
    313    
     313
    314314    // Merge old and new fields with new fields overwriting old ones.
    315315    $linkdata = array_merge($link, $linkdata);
     
    322322
    323323    do_action('delete_link', $link_id);
    324     return $wpdb->query("DELETE FROM $wpdb->links WHERE link_id = '$link_id'"); 
     324    return $wpdb->query("DELETE FROM $wpdb->links WHERE link_id = '$link_id'");
    325325}
    326326
Note: See TracChangeset for help on using the changeset viewer.