diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php
index a01d0fb42d..d1ecdb8086 100644
--- a/wp-admin/includes/misc.php
+++ b/wp-admin/includes/misc.php
@@ -120,6 +120,9 @@ function insert_with_markers( $filename, $marker, $insertion ) {
* @since unknown
*/
function save_mod_rewrite_rules() {
+ if ( is_multisite() )
+ return;
+
global $wp_rewrite;
$home_path = get_home_path();
diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
index c2d85827dc..f311fa1e49 100644
--- a/wp-admin/includes/template.php
+++ b/wp-admin/includes/template.php
@@ -229,11 +229,12 @@ function inline_edit_term_row($type) {
-
+
+
diff --git a/wp-admin/includes/update.php b/wp-admin/includes/update.php
index 470e809093..b784059e72 100644
--- a/wp-admin/includes/update.php
+++ b/wp-admin/includes/update.php
@@ -82,6 +82,9 @@ function find_core_update( $version, $locale ) {
}
function core_update_footer( $msg = '' ) {
+ if( is_multisite() && !is_super_admin() )
+ return false;
+
if ( !current_user_can('manage_options') )
return sprintf( __( 'Version %s' ), $GLOBALS['wp_version'] );
@@ -115,6 +118,9 @@ function core_update_footer( $msg = '' ) {
add_filter( 'update_footer', 'core_update_footer' );
function update_nag() {
+ if( is_multisite() && !is_super_admin() )
+ return false;
+
global $pagenow;
if ( 'update-core.php' == $pagenow )
@@ -136,6 +142,9 @@ add_action( 'admin_notices', 'update_nag', 3 );
// Called directly from dashboard
function update_right_now_message() {
+ if( is_multisite() && !is_super_admin() )
+ return false;
+
$cur = get_preferred_from_update_core();
$msg = sprintf( __('You are using WordPress %s.'), $GLOBALS['wp_version'] );
@@ -196,6 +205,9 @@ function wp_plugin_update_row( $file, $plugin_data ) {
}
function wp_update_plugin($plugin, $feedback = '') {
+ if( is_multisite() && !is_super_admin() )
+ return false;
+
if ( !empty($feedback) )
add_filter('update_feedback', $feedback);
diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php
index 913ab2b5f7..a70b0bb814 100644
--- a/wp-admin/includes/user.php
+++ b/wp-admin/includes/user.php
@@ -197,7 +197,11 @@ function edit_user( $user_id = 0 ) {
*/
function get_author_user_ids() {
global $wpdb;
- $level_key = $wpdb->prefix . 'user_level';
+ if( !is_multisite() ) {
+ $level_key = $wpdb->get_blog_prefix() . 'user_level';
+ } else {
+ $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
+ }
return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) );
}
@@ -248,8 +252,11 @@ function get_editable_user_ids( $user_id, $exclude_zeros = true, $post_type = 'p
else
return array();
}
-
- $level_key = $wpdb->prefix . 'user_level';
+ if( !is_multisite() ) {
+ $level_key = $wpdb->get_blog_prefix() . 'user_level';
+ } else {
+ $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
+ }
$query = $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s", $level_key);
if ( $exclude_zeros )
@@ -294,7 +301,12 @@ function get_editable_roles() {
*/
function get_nonauthor_user_ids() {
global $wpdb;
- $level_key = $wpdb->prefix . 'user_level';
+
+ if ( !is_multisite() ) {
+ $level_key = $wpdb->get_blog_prefix() . 'user_level';
+ } else {
+ $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
+ }
return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = '0'", $level_key) );
}
@@ -440,9 +452,13 @@ function wp_delete_user($id, $reassign = 'novalue') {
}
// FINALLY, delete user
-
- $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d", $id) );
- $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->users WHERE ID = %d", $id) );
+ if ( !is_multisite() ) {
+ $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d", $id) );
+ $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->users WHERE ID = %d", $id) );
+ } else {
+ $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
+ $wpdb->query("DELETE FROM $wpdb->usermeta WHERE user_id = $id AND meta_key = '{$level_key}'");
+ }
wp_cache_delete($id, 'users');
wp_cache_delete($user->user_login, 'userlogins');
@@ -661,8 +677,12 @@ class WP_User_Search {
$this->query_from_where = "FROM $wpdb->users";
if ( $this->role )
$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 . '%');
- else
+ elseif ( !is_multisite() )
$this->query_from_where .= " WHERE 1=1";
+ else {
+ $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
+ $this->query_from_where .= ", $wpdb->usermeta WHERE $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '{$level_key}'";
+ }
$this->query_from_where .= " $search_sql";
}