WordPress.org

Make WordPress Core

Changeset 12726


Ignore:
Timestamp:
01/15/2010 12:21:13 AM (10 years ago)
Author:
wpmuguru
Message:

merge multisite wp-admin/includes except schema, See #11644

Location:
trunk/wp-admin/includes
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/misc.php

    r12707 r12726  
    121121 */
    122122function save_mod_rewrite_rules() {
     123    if ( is_multisite() )
     124        return;
     125
    123126    global $wp_rewrite;
    124127
  • trunk/wp-admin/includes/template.php

    r12715 r12726  
    230230                <span class="input-text-wrap"><input type="text" name="name" class="ptitle" value="" /></span>
    231231            </label>
    232 
     232<?php if ( !is_multisite() ) { ?>
    233233            <label>
    234234                <span class="title"><?php _e( 'Slug' ); ?></span>
    235235                <span class="input-text-wrap"><input type="text" name="slug" class="ptitle" value="" /></span>
    236236            </label>
     237<?php } ?>
    237238
    238239<?php if ( 'category' == $type ) : ?>
  • trunk/wp-admin/includes/update.php

    r12673 r12726  
    8383
    8484function core_update_footer( $msg = '' ) {
     85    if( is_multisite() && !is_super_admin() )
     86        return false;
     87
    8588    if ( !current_user_can('manage_options') )
    8689        return sprintf( __( 'Version %s' ), $GLOBALS['wp_version'] );
     
    116119
    117120function update_nag() {
     121    if( is_multisite() && !is_super_admin() )
     122        return false;
     123
    118124    global $pagenow;
    119125
     
    137143// Called directly from dashboard
    138144function update_right_now_message() {
     145    if( is_multisite() && !is_super_admin() )
     146        return false;
     147
    139148    $cur = get_preferred_from_update_core();
    140149
     
    197206
    198207function wp_update_plugin($plugin, $feedback = '') {
     208    if( is_multisite() && !is_super_admin() )
     209        return false;
     210
    199211
    200212    if ( !empty($feedback) )
  • trunk/wp-admin/includes/user.php

    r12652 r12726  
    198198function get_author_user_ids() {
    199199    global $wpdb;
    200     $level_key = $wpdb->prefix . 'user_level';
     200    if( !is_multisite() ) {
     201        $level_key = $wpdb->get_blog_prefix() . 'user_level';
     202    } else {
     203        $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
     204    }
    201205    return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) );
    202206}
     
    249253            return array();
    250254    }
    251 
    252     $level_key = $wpdb->prefix . 'user_level';
     255    if( !is_multisite() ) {
     256        $level_key = $wpdb->get_blog_prefix() . 'user_level';
     257    } else {
     258        $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
     259    }
    253260
    254261    $query = $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s", $level_key);
     
    295302function get_nonauthor_user_ids() {
    296303    global $wpdb;
    297     $level_key = $wpdb->prefix . 'user_level';
     304
     305    if ( !is_multisite() ) {
     306        $level_key = $wpdb->get_blog_prefix() . 'user_level';
     307    } else {
     308        $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
     309    }
    298310
    299311    return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = '0'", $level_key) );
     
    441453
    442454    // FINALLY, delete user
    443 
    444     $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d", $id) );
    445     $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->users WHERE ID = %d", $id) );
     455    if ( !is_multisite() ) {
     456        $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d", $id) );
     457        $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->users WHERE ID = %d", $id) );
     458    } else {
     459        $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
     460        $wpdb->query("DELETE FROM $wpdb->usermeta WHERE user_id = $id AND meta_key = '{$level_key}'");
     461    }
    446462
    447463    wp_cache_delete($id, 'users');
     
    662678        if ( $this->role )
    663679            $this->query_from_where .= $wpdb->prepare(" INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id WHERE $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities' AND $wpdb->usermeta.meta_value LIKE %s", '%' . $this->role . '%');
    664         else
     680        elseif ( !is_multisite() )
    665681            $this->query_from_where .= " WHERE 1=1";
     682        else {
     683            $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
     684            $this->query_from_where .= ", $wpdb->usermeta WHERE $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '{$level_key}'";
     685        }
    666686        $this->query_from_where .= " $search_sql";
    667687
Note: See TracChangeset for help on using the changeset viewer.