Revert [34778], continue using _site_option() for the current network.
The `_network_option()` parameter order will be changing to accept `$network_id` first. The `_site_option()` functions will remain in use throughout core as our way of retrieving a network option for the current network. See #28290. Built from https://develop.svn.wordpress.org/trunk@34912 git-svn-id: http://core.svn.wordpress.org/trunk@34877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -165,7 +165,7 @@ function wp_ajax_wp_compression_test() {
|
||||
wp_die( -1 );
|
||||
|
||||
if ( ini_get('zlib.output_compression') || 'ob_gzhandler' == ini_get('output_handler') ) {
|
||||
update_network_option( 'can_compress_scripts', 0 );
|
||||
update_site_option('can_compress_scripts', 0);
|
||||
wp_die( 0 );
|
||||
}
|
||||
|
||||
@@ -196,9 +196,9 @@ function wp_ajax_wp_compression_test() {
|
||||
echo $out;
|
||||
wp_die();
|
||||
} elseif ( 'no' == $_GET['test'] ) {
|
||||
update_network_option( 'can_compress_scripts', 0 );
|
||||
update_site_option('can_compress_scripts', 0);
|
||||
} elseif ( 'yes' == $_GET['test'] ) {
|
||||
update_network_option( 'can_compress_scripts', 1 );
|
||||
update_site_option('can_compress_scripts', 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
set_transient( 'plugin_slugs', array_keys( $plugins['all'] ), DAY_IN_SECONDS );
|
||||
|
||||
if ( $screen->in_admin( 'network' ) ) {
|
||||
$recently_activated = get_network_option( 'recently_activated', array() );
|
||||
$recently_activated = get_site_option( 'recently_activated', array() );
|
||||
} else {
|
||||
$recently_activated = get_option( 'recently_activated', array() );
|
||||
}
|
||||
@@ -142,7 +142,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
}
|
||||
|
||||
if ( $screen->in_admin( 'network' ) ) {
|
||||
update_network_option( 'recently_activated', $recently_activated );
|
||||
update_site_option( 'recently_activated', $recently_activated );
|
||||
} else {
|
||||
update_option( 'recently_activated', $recently_activated );
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ class WP_Themes_List_Table extends WP_List_Table {
|
||||
}
|
||||
}
|
||||
// Fallthrough.
|
||||
printf( __( 'Only the current theme is available to you. Contact the %s administrator for information about accessing additional themes.' ), get_network_option( 'site_name' ) );
|
||||
printf( __( 'Only the current theme is available to you. Contact the %s administrator for information about accessing additional themes.' ), get_site_option( 'site_name' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2368,7 +2368,7 @@ class Core_Upgrader extends WP_Upgrader {
|
||||
if ( version_compare( $wp_version, $offered_ver, '>' ) )
|
||||
return false;
|
||||
|
||||
$failure_data = get_network_option( 'auto_core_update_failed' );
|
||||
$failure_data = get_site_option( 'auto_core_update_failed' );
|
||||
if ( $failure_data ) {
|
||||
// If this was a critical update failure, cannot update.
|
||||
if ( ! empty( $failure_data['critical'] ) )
|
||||
@@ -2780,10 +2780,10 @@ class WP_Automatic_Updater {
|
||||
* @param object $item The update offer.
|
||||
*/
|
||||
protected function send_core_update_notification_email( $item ) {
|
||||
$notified = get_network_option( 'auto_core_update_notified' );
|
||||
$notified = get_site_option( 'auto_core_update_notified' );
|
||||
|
||||
// Don't notify if we've already notified the same email address of the same version.
|
||||
if ( $notified && $notified['email'] == get_network_option( 'admin_email' ) && $notified['version'] == $item->current )
|
||||
if ( $notified && $notified['email'] == get_site_option( 'admin_email' ) && $notified['version'] == $item->current )
|
||||
return false;
|
||||
|
||||
// See if we need to notify users of a core update.
|
||||
@@ -3108,7 +3108,7 @@ class WP_Automatic_Updater {
|
||||
$critical_data['rollback_code'] = $rollback_result->get_error_code();
|
||||
$critical_data['rollback_data'] = $rollback_result->get_error_data();
|
||||
}
|
||||
update_network_option( 'auto_core_update_failed', $critical_data );
|
||||
update_site_option( 'auto_core_update_failed', $critical_data );
|
||||
$this->send_email( 'critical', $core_update, $result );
|
||||
return;
|
||||
}
|
||||
@@ -3126,17 +3126,17 @@ class WP_Automatic_Updater {
|
||||
*/
|
||||
$send = true;
|
||||
$transient_failures = array( 'incompatible_archive', 'download_failed', 'insane_distro' );
|
||||
if ( in_array( $error_code, $transient_failures ) && ! get_network_option( 'auto_core_update_failed' ) ) {
|
||||
if ( in_array( $error_code, $transient_failures ) && ! get_site_option( 'auto_core_update_failed' ) ) {
|
||||
wp_schedule_single_event( time() + HOUR_IN_SECONDS, 'wp_maybe_auto_update' );
|
||||
$send = false;
|
||||
}
|
||||
|
||||
$n = get_network_option( 'auto_core_update_notified' );
|
||||
$n = get_site_option( 'auto_core_update_notified' );
|
||||
// Don't notify if we've already notified the same email address of the same version of the same notification type.
|
||||
if ( $n && 'fail' == $n['type'] && $n['email'] == get_network_option( 'admin_email' ) && $n['version'] == $core_update->current )
|
||||
if ( $n && 'fail' == $n['type'] && $n['email'] == get_site_option( 'admin_email' ) && $n['version'] == $core_update->current )
|
||||
$send = false;
|
||||
|
||||
update_network_option( 'auto_core_update_failed', array(
|
||||
update_site_option( 'auto_core_update_failed', array(
|
||||
'attempted' => $core_update->current,
|
||||
'current' => $wp_version,
|
||||
'error_code' => $error_code,
|
||||
@@ -3162,9 +3162,9 @@ class WP_Automatic_Updater {
|
||||
* @param mixed $result Optional. The result for the core update. Can be WP_Error.
|
||||
*/
|
||||
protected function send_email( $type, $core_update, $result = null ) {
|
||||
update_network_option( 'auto_core_update_notified', array(
|
||||
update_site_option( 'auto_core_update_notified', array(
|
||||
'type' => $type,
|
||||
'email' => get_network_option( 'admin_email' ),
|
||||
'email' => get_site_option( 'admin_email' ),
|
||||
'version' => $core_update->current,
|
||||
'timestamp' => time(),
|
||||
) );
|
||||
@@ -3320,7 +3320,7 @@ class WP_Automatic_Updater {
|
||||
$body .= "\n";
|
||||
}
|
||||
|
||||
$to = get_network_option( 'admin_email' );
|
||||
$to = get_site_option( 'admin_email' );
|
||||
$headers = '';
|
||||
|
||||
$email = compact( 'to', 'subject', 'body', 'headers' );
|
||||
@@ -3494,7 +3494,7 @@ Thanks! -- The WordPress Team" ) );
|
||||
}
|
||||
|
||||
$email = array(
|
||||
'to' => get_network_option( 'admin_email' ),
|
||||
'to' => get_site_option( 'admin_email' ),
|
||||
'subject' => $subject,
|
||||
'body' => implode( "\n", $body ),
|
||||
'headers' => ''
|
||||
|
||||
@@ -1196,7 +1196,7 @@ function wp_dashboard_plugins_output( $rss, $args = array() ) {
|
||||
* @return bool|null True if not multisite, user can't upload files, or the space check option is disabled.
|
||||
*/
|
||||
function wp_dashboard_quota() {
|
||||
if ( !is_multisite() || !current_user_can( 'upload_files' ) || get_network_option( 'upload_space_check_disabled' ) )
|
||||
if ( !is_multisite() || !current_user_can( 'upload_files' ) || get_site_option( 'upload_space_check_disabled' ) )
|
||||
return true;
|
||||
|
||||
$quota = get_space_allowed();
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* @return array $_FILES array with 'error' key set if file exceeds quota. 'error' is empty otherwise.
|
||||
*/
|
||||
function check_upload_size( $file ) {
|
||||
if ( get_network_option( 'upload_space_check_disabled' ) )
|
||||
if ( get_site_option( 'upload_space_check_disabled' ) )
|
||||
return $file;
|
||||
|
||||
if ( $file['error'] != '0' ) // there's already an error
|
||||
@@ -30,8 +30,8 @@ function check_upload_size( $file ) {
|
||||
$file_size = filesize( $file['tmp_name'] );
|
||||
if ( $space_left < $file_size )
|
||||
$file['error'] = sprintf( __( 'Not enough space to upload. %1$s KB needed.' ), number_format( ($file_size - $space_left) /1024 ) );
|
||||
if ( $file_size > ( 1024 * get_network_option( 'fileupload_maxk', 1500 ) ) )
|
||||
$file['error'] = sprintf(__('This file is too big. Files must be less than %1$s KB in size.'), get_network_option( 'fileupload_maxk', 1500 ) );
|
||||
if ( $file_size > ( 1024 * get_site_option( 'fileupload_maxk', 1500 ) ) )
|
||||
$file['error'] = sprintf(__('This file is too big. Files must be less than %1$s KB in size.'), get_site_option( 'fileupload_maxk', 1500 ) );
|
||||
if ( upload_is_user_over_quota( false ) ) {
|
||||
$file['error'] = __( 'You have used your space quota. Please delete files before uploading.' );
|
||||
}
|
||||
@@ -98,7 +98,7 @@ function wpmu_delete_blog( $blog_id, $drop = false ) {
|
||||
$upload_path = trim( get_option( 'upload_path' ) );
|
||||
|
||||
// If ms_files_rewriting is enabled and upload_path is empty, wp_upload_dir is not reliable.
|
||||
if ( $drop && get_network_option( 'ms_files_rewriting' ) && empty( $upload_path ) ) {
|
||||
if ( $drop && get_site_option( 'ms_files_rewriting' ) && empty( $upload_path ) ) {
|
||||
$drop = false;
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ All at ###SITENAME###
|
||||
$content = str_replace( '###USERNAME###', $current_user->user_login, $content );
|
||||
$content = str_replace( '###ADMIN_URL###', esc_url( admin_url( 'options.php?adminhash='.$hash ) ), $content );
|
||||
$content = str_replace( '###EMAIL###', $value, $content );
|
||||
$content = str_replace( '###SITENAME###', get_network_option( 'site_name' ), $content );
|
||||
$content = str_replace( '###SITENAME###', get_site_option( 'site_name' ), $content );
|
||||
$content = str_replace( '###SITEURL###', network_home_url(), $content );
|
||||
|
||||
wp_mail( $value, sprintf( __( '[%s] New Admin Email Address' ), wp_specialchars_decode( get_option( 'blogname' ) ) ), $content );
|
||||
@@ -385,7 +385,7 @@ All at ###SITENAME###
|
||||
$content = str_replace( '###USERNAME###', $current_user->user_login, $content );
|
||||
$content = str_replace( '###ADMIN_URL###', esc_url( admin_url( 'profile.php?newuseremail='.$hash ) ), $content );
|
||||
$content = str_replace( '###EMAIL###', $_POST['email'], $content);
|
||||
$content = str_replace( '###SITENAME###', get_network_option( 'site_name' ), $content );
|
||||
$content = str_replace( '###SITENAME###', get_site_option( 'site_name' ), $content );
|
||||
$content = str_replace( '###SITEURL###', network_home_url(), $content );
|
||||
|
||||
wp_mail( $_POST['email'], sprintf( __( '[%s] New Email Address' ), wp_specialchars_decode( get_option( 'blogname' ) ) ), $content );
|
||||
@@ -413,7 +413,7 @@ function new_user_email_admin_notice() {
|
||||
* @return bool True if user is over upload space quota, otherwise false.
|
||||
*/
|
||||
function upload_is_user_over_quota( $echo = true ) {
|
||||
if ( get_network_option( 'upload_space_check_disabled' ) )
|
||||
if ( get_site_option( 'upload_space_check_disabled' ) )
|
||||
return false;
|
||||
|
||||
$space_allowed = get_space_allowed();
|
||||
@@ -746,7 +746,7 @@ function site_admin_notice() {
|
||||
global $wp_db_version;
|
||||
if ( !is_super_admin() )
|
||||
return false;
|
||||
if ( get_network_option( 'wpmu_upgrade_site' ) != $wp_db_version )
|
||||
if ( get_site_option( 'wpmu_upgrade_site' ) != $wp_db_version )
|
||||
echo "<div class='update-nag'>" . sprintf( __( 'Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.' ), esc_url( network_admin_url( 'upgrade.php' ) ) ) . "</div>";
|
||||
}
|
||||
|
||||
@@ -828,7 +828,7 @@ function choose_primary_blog() {
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if ( in_array( get_network_option( 'registration' ), array( 'all', 'blog' ) ) ) : ?>
|
||||
<?php if ( in_array( get_site_option( 'registration' ), array( 'all', 'blog' ) ) ) : ?>
|
||||
<tr>
|
||||
<th scope="row" colspan="2" class="th-full">
|
||||
<?php
|
||||
@@ -870,12 +870,12 @@ function grant_super_admin( $user_id ) {
|
||||
do_action( 'grant_super_admin', $user_id );
|
||||
|
||||
// Directly fetch site_admins instead of using get_super_admins()
|
||||
$super_admins = get_network_option( 'site_admins', array( 'admin' ) );
|
||||
$super_admins = get_site_option( 'site_admins', array( 'admin' ) );
|
||||
|
||||
$user = get_userdata( $user_id );
|
||||
if ( $user && ! in_array( $user->user_login, $super_admins ) ) {
|
||||
$super_admins[] = $user->user_login;
|
||||
update_network_option( 'site_admins' , $super_admins );
|
||||
update_site_option( 'site_admins' , $super_admins );
|
||||
|
||||
/**
|
||||
* Fires after the user is granted Super Admin privileges.
|
||||
@@ -917,13 +917,13 @@ function revoke_super_admin( $user_id ) {
|
||||
do_action( 'revoke_super_admin', $user_id );
|
||||
|
||||
// Directly fetch site_admins instead of using get_super_admins()
|
||||
$super_admins = get_network_option( 'site_admins', array( 'admin' ) );
|
||||
$super_admins = get_site_option( 'site_admins', array( 'admin' ) );
|
||||
|
||||
$user = get_userdata( $user_id );
|
||||
if ( $user && 0 !== strcasecmp( $user->user_email, get_network_option( 'admin_email' ) ) ) {
|
||||
if ( $user && 0 !== strcasecmp( $user->user_email, get_site_option( 'admin_email' ) ) ) {
|
||||
if ( false !== ( $key = array_search( $user->user_login, $super_admins ) ) ) {
|
||||
unset( $super_admins[$key] );
|
||||
update_network_option( 'site_admins', $super_admins );
|
||||
update_site_option( 'site_admins', $super_admins );
|
||||
|
||||
/**
|
||||
* Fires after the user's Super Admin privileges are revoked.
|
||||
|
||||
@@ -450,7 +450,7 @@ define('BLOG_ID_CURRENT_SITE', 1);
|
||||
<match url="^index\.php$" ignoreCase="false" />
|
||||
<action type="None" />
|
||||
</rule>';
|
||||
if ( is_multisite() && get_network_option( 'ms_files_rewriting' ) ) {
|
||||
if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) {
|
||||
$web_config_file .= '
|
||||
<rule name="WordPress Rule for Files" stopProcessing="true">
|
||||
<match url="^' . $iis_subdir_match . 'files/(.+)" ignoreCase="false" />
|
||||
@@ -506,7 +506,7 @@ define('BLOG_ID_CURRENT_SITE', 1);
|
||||
<?php else : // end iis7_supports_permalinks(). construct an htaccess file instead:
|
||||
|
||||
$ms_files_rewriting = '';
|
||||
if ( is_multisite() && get_network_option( 'ms_files_rewriting' ) ) {
|
||||
if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) {
|
||||
$ms_files_rewriting = "\n# uploaded files\nRewriteRule ^";
|
||||
$ms_files_rewriting .= $subdir_match . "files/(.+) {$rewrite_base}" . WPINC . "/ms-files.php?file={$subdir_replacement_12} [L]" . "\n";
|
||||
}
|
||||
|
||||
@@ -462,7 +462,7 @@ function is_plugin_active_for_network( $plugin ) {
|
||||
if ( !is_multisite() )
|
||||
return false;
|
||||
|
||||
$plugins = get_network_option( 'active_sitewide_plugins' );
|
||||
$plugins = get_site_option( 'active_sitewide_plugins');
|
||||
if ( isset($plugins[$plugin]) )
|
||||
return true;
|
||||
|
||||
@@ -520,7 +520,7 @@ function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silen
|
||||
|
||||
if ( is_multisite() && ( $network_wide || is_network_only_plugin($plugin) ) ) {
|
||||
$network_wide = true;
|
||||
$current = get_network_option( 'active_sitewide_plugins', array() );
|
||||
$current = get_site_option( 'active_sitewide_plugins', array() );
|
||||
$_GET['networkwide'] = 1; // Back compat for plugins looking for this value.
|
||||
} else {
|
||||
$current = get_option( 'active_plugins', array() );
|
||||
@@ -573,9 +573,9 @@ function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silen
|
||||
}
|
||||
|
||||
if ( $network_wide ) {
|
||||
$current = get_network_option( 'active_sitewide_plugins', array() );
|
||||
$current = get_site_option( 'active_sitewide_plugins', array() );
|
||||
$current[$plugin] = time();
|
||||
update_network_option( 'active_sitewide_plugins', $current );
|
||||
update_site_option( 'active_sitewide_plugins', $current );
|
||||
} else {
|
||||
$current = get_option( 'active_plugins', array() );
|
||||
$current[] = $plugin;
|
||||
@@ -624,7 +624,7 @@ function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silen
|
||||
*/
|
||||
function deactivate_plugins( $plugins, $silent = false, $network_wide = null ) {
|
||||
if ( is_multisite() )
|
||||
$network_current = get_network_option( 'active_sitewide_plugins', array() );
|
||||
$network_current = get_site_option( 'active_sitewide_plugins', array() );
|
||||
$current = get_option( 'active_plugins', array() );
|
||||
$do_blog = $do_network = false;
|
||||
|
||||
@@ -705,7 +705,7 @@ function deactivate_plugins( $plugins, $silent = false, $network_wide = null ) {
|
||||
if ( $do_blog )
|
||||
update_option('active_plugins', $current);
|
||||
if ( $do_network )
|
||||
update_network_option( 'active_sitewide_plugins', $network_current );
|
||||
update_site_option( 'active_sitewide_plugins', $network_current );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -877,7 +877,7 @@ function validate_active_plugins() {
|
||||
}
|
||||
|
||||
if ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) {
|
||||
$network_plugins = (array) get_network_option( 'active_sitewide_plugins', array() );
|
||||
$network_plugins = (array) get_site_option( 'active_sitewide_plugins', array() );
|
||||
$plugins = array_merge( $plugins, array_keys( $network_plugins ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -935,7 +935,7 @@ function populate_network( $network_id = 1, $domain = '', $email = '', $site_nam
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$site_admins = get_network_option( 'site_admins' );
|
||||
$site_admins = get_site_option( 'site_admins' );
|
||||
}
|
||||
|
||||
/* translators: Do not translate USERNAME, SITE_NAME, BLOG_URL, PASSWORD: those are placeholders. */
|
||||
@@ -985,10 +985,10 @@ We hope you enjoy your new site. Thanks!
|
||||
// @todo - network admins should have a method of editing the network siteurl (used for cookie hash)
|
||||
'siteurl' => get_option( 'siteurl' ) . '/',
|
||||
'add_new_users' => '0',
|
||||
'upload_space_check_disabled' => is_multisite() ? get_network_option( 'upload_space_check_disabled' ) : '1',
|
||||
'upload_space_check_disabled' => is_multisite() ? get_site_option( 'upload_space_check_disabled' ) : '1',
|
||||
'subdomain_install' => intval( $subdomain_install ),
|
||||
'global_terms_enabled' => global_terms_enabled() ? '1' : '0',
|
||||
'ms_files_rewriting' => is_multisite() ? get_network_option( 'ms_files_rewriting' ) : '0',
|
||||
'ms_files_rewriting' => is_multisite() ? get_site_option( 'ms_files_rewriting' ) : '0',
|
||||
'initial_db_version' => get_option( 'initial_db_version' ),
|
||||
'active_sitewide_plugins' => array(),
|
||||
'WPLANG' => get_locale(),
|
||||
|
||||
@@ -1102,8 +1102,8 @@ function update_core($from, $to) {
|
||||
do_action( '_core_updated_successfully', $wp_version );
|
||||
|
||||
// Clear the option that blocks auto updates after failures, now that we've been successful.
|
||||
if ( function_exists( 'delete_network_option' ) )
|
||||
delete_network_option( 'auto_core_update_failed' );
|
||||
if ( function_exists( 'delete_site_option' ) )
|
||||
delete_site_option( 'auto_core_update_failed' );
|
||||
|
||||
return $wp_version;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ function get_preferred_from_update_core() {
|
||||
*/
|
||||
function get_core_updates( $options = array() ) {
|
||||
$options = array_merge( array( 'available' => true, 'dismissed' => false ), $options );
|
||||
$dismissed = get_network_option( 'dismissed_update_core' );
|
||||
$dismissed = get_site_option( 'dismissed_update_core' );
|
||||
|
||||
if ( ! is_array( $dismissed ) )
|
||||
$dismissed = array();
|
||||
@@ -134,9 +134,9 @@ function get_core_checksums( $version, $locale ) {
|
||||
* @return bool
|
||||
*/
|
||||
function dismiss_core_update( $update ) {
|
||||
$dismissed = get_network_option( 'dismissed_update_core' );
|
||||
$dismissed = get_site_option( 'dismissed_update_core' );
|
||||
$dismissed[ $update->current . '|' . $update->locale ] = true;
|
||||
return update_network_option( 'dismissed_update_core', $dismissed );
|
||||
return update_site_option( 'dismissed_update_core', $dismissed );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,14 +146,14 @@ function dismiss_core_update( $update ) {
|
||||
* @return bool
|
||||
*/
|
||||
function undismiss_core_update( $version, $locale ) {
|
||||
$dismissed = get_network_option( 'dismissed_update_core' );
|
||||
$dismissed = get_site_option( 'dismissed_update_core' );
|
||||
$key = $version . '|' . $locale;
|
||||
|
||||
if ( ! isset( $dismissed[$key] ) )
|
||||
return false;
|
||||
|
||||
unset( $dismissed[$key] );
|
||||
return update_network_option( 'dismissed_update_core', $dismissed );
|
||||
return update_site_option( 'dismissed_update_core', $dismissed );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -478,7 +478,7 @@ function maintenance_nag() {
|
||||
global $upgrading;
|
||||
$nag = isset( $upgrading );
|
||||
if ( ! $nag ) {
|
||||
$failed = get_network_option( 'auto_core_update_failed' );
|
||||
$failed = get_site_option( 'auto_core_update_failed' );
|
||||
/*
|
||||
* If an update failed critically, we may have copied over version.php but not other files.
|
||||
* In that case, if the install claims we're running the version we attempted, nag.
|
||||
|
||||
@@ -153,7 +153,7 @@ function wp_install_defaults( $user_id ) {
|
||||
$first_post_guid = get_option( 'home' ) . '/?p=1';
|
||||
|
||||
if ( is_multisite() ) {
|
||||
$first_post = get_network_option( 'first_post' );
|
||||
$first_post = get_site_option( 'first_post' );
|
||||
|
||||
if ( empty($first_post) )
|
||||
$first_post = __( 'Welcome to <a href="SITE_URL">SITE_NAME</a>. This is your first post. Edit or delete it, then start writing!' );
|
||||
@@ -189,9 +189,9 @@ function wp_install_defaults( $user_id ) {
|
||||
$first_comment = __('Hi, this is a comment.
|
||||
To delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.');
|
||||
if ( is_multisite() ) {
|
||||
$first_comment_author = get_network_option( 'first_comment_author', $first_comment_author );
|
||||
$first_comment_url = get_network_option( 'first_comment_url', network_home_url() );
|
||||
$first_comment = get_network_option( 'first_comment', $first_comment );
|
||||
$first_comment_author = get_site_option( 'first_comment_author', $first_comment_author );
|
||||
$first_comment_url = get_site_option( 'first_comment_url', network_home_url() );
|
||||
$first_comment = get_site_option( 'first_comment', $first_comment );
|
||||
}
|
||||
$wpdb->insert( $wpdb->comments, array(
|
||||
'comment_post_ID' => 1,
|
||||
@@ -214,7 +214,7 @@ To delete a comment, just log in and view the post's comments. There you wi
|
||||
|
||||
As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to delete this page and create new pages for your content. Have fun!" ), admin_url() );
|
||||
if ( is_multisite() )
|
||||
$first_page = get_network_option( 'first_page', $first_page );
|
||||
$first_page = get_site_option( 'first_page', $first_page );
|
||||
$first_post_guid = get_option('home') . '/?page_id=2';
|
||||
$wpdb->insert( $wpdb->posts, array(
|
||||
'post_author' => $user_id,
|
||||
@@ -1255,8 +1255,8 @@ function upgrade_300() {
|
||||
if ( $wp_current_db_version < 15093 )
|
||||
populate_roles_300();
|
||||
|
||||
if ( $wp_current_db_version < 14139 && is_multisite() && is_main_site() && ! defined( 'MULTISITE' ) && get_network_option( 'siteurl' ) === false )
|
||||
add_network_option( 'siteurl', '' );
|
||||
if ( $wp_current_db_version < 14139 && is_multisite() && is_main_site() && ! defined( 'MULTISITE' ) && get_site_option( 'siteurl' ) === false )
|
||||
add_site_option( 'siteurl', '' );
|
||||
|
||||
// 3.0 screen options key name changes.
|
||||
if ( wp_should_upgrade_global_tables() ) {
|
||||
@@ -1643,18 +1643,18 @@ function upgrade_network() {
|
||||
|
||||
// 2.8.
|
||||
if ( $wp_current_db_version < 11549 ) {
|
||||
$wpmu_sitewide_plugins = get_network_option( 'wpmu_sitewide_plugins' );
|
||||
$active_sitewide_plugins = get_network_option( 'active_sitewide_plugins' );
|
||||
$wpmu_sitewide_plugins = get_site_option( 'wpmu_sitewide_plugins' );
|
||||
$active_sitewide_plugins = get_site_option( 'active_sitewide_plugins' );
|
||||
if ( $wpmu_sitewide_plugins ) {
|
||||
if ( !$active_sitewide_plugins )
|
||||
$sitewide_plugins = (array) $wpmu_sitewide_plugins;
|
||||
else
|
||||
$sitewide_plugins = array_merge( (array) $active_sitewide_plugins, (array) $wpmu_sitewide_plugins );
|
||||
|
||||
update_network_option( 'active_sitewide_plugins', $sitewide_plugins );
|
||||
update_site_option( 'active_sitewide_plugins', $sitewide_plugins );
|
||||
}
|
||||
delete_network_option( 'wpmu_sitewide_plugins' );
|
||||
delete_network_option( 'deactivated_sitewide_plugins' );
|
||||
delete_site_option( 'wpmu_sitewide_plugins' );
|
||||
delete_site_option( 'deactivated_sitewide_plugins' );
|
||||
|
||||
$start = 0;
|
||||
while( $rows = $wpdb->get_results( "SELECT meta_key, meta_value FROM {$wpdb->sitemeta} ORDER BY meta_id LIMIT $start, 20" ) ) {
|
||||
@@ -1663,7 +1663,7 @@ function upgrade_network() {
|
||||
if ( !@unserialize( $value ) )
|
||||
$value = stripslashes( $value );
|
||||
if ( $value !== $row->meta_value ) {
|
||||
update_network_option( $row->meta_key, $value );
|
||||
update_site_option( $row->meta_key, $value );
|
||||
}
|
||||
}
|
||||
$start += 20;
|
||||
@@ -1672,22 +1672,22 @@ function upgrade_network() {
|
||||
|
||||
// 3.0
|
||||
if ( $wp_current_db_version < 13576 )
|
||||
update_network_option( 'global_terms_enabled', '1' );
|
||||
update_site_option( 'global_terms_enabled', '1' );
|
||||
|
||||
// 3.3
|
||||
if ( $wp_current_db_version < 19390 )
|
||||
update_network_option( 'initial_db_version', $wp_current_db_version );
|
||||
update_site_option( 'initial_db_version', $wp_current_db_version );
|
||||
|
||||
if ( $wp_current_db_version < 19470 ) {
|
||||
if ( false === get_network_option( 'active_sitewide_plugins' ) )
|
||||
update_network_option( 'active_sitewide_plugins', array() );
|
||||
if ( false === get_site_option( 'active_sitewide_plugins' ) )
|
||||
update_site_option( 'active_sitewide_plugins', array() );
|
||||
}
|
||||
|
||||
// 3.4
|
||||
if ( $wp_current_db_version < 20148 ) {
|
||||
// 'allowedthemes' keys things by stylesheet. 'allowed_themes' keyed things by name.
|
||||
$allowedthemes = get_network_option( 'allowedthemes' );
|
||||
$allowed_themes = get_network_option( 'allowed_themes' );
|
||||
$allowedthemes = get_site_option( 'allowedthemes' );
|
||||
$allowed_themes = get_site_option( 'allowed_themes' );
|
||||
if ( false === $allowedthemes && is_array( $allowed_themes ) && $allowed_themes ) {
|
||||
$converted = array();
|
||||
$themes = wp_get_themes();
|
||||
@@ -1695,22 +1695,22 @@ function upgrade_network() {
|
||||
if ( isset( $allowed_themes[ $theme_data->get('Name') ] ) )
|
||||
$converted[ $stylesheet ] = true;
|
||||
}
|
||||
update_network_option( 'allowedthemes', $converted );
|
||||
delete_network_option( 'allowed_themes' );
|
||||
update_site_option( 'allowedthemes', $converted );
|
||||
delete_site_option( 'allowed_themes' );
|
||||
}
|
||||
}
|
||||
|
||||
// 3.5
|
||||
if ( $wp_current_db_version < 21823 )
|
||||
update_network_option( 'ms_files_rewriting', '1' );
|
||||
update_site_option( 'ms_files_rewriting', '1' );
|
||||
|
||||
// 3.5.2
|
||||
if ( $wp_current_db_version < 24448 ) {
|
||||
$illegal_names = get_network_option( 'illegal_names' );
|
||||
$illegal_names = get_site_option( 'illegal_names' );
|
||||
if ( is_array( $illegal_names ) && count( $illegal_names ) === 1 ) {
|
||||
$illegal_name = reset( $illegal_names );
|
||||
$illegal_names = explode( ' ', $illegal_name );
|
||||
update_network_option( 'illegal_names', $illegal_names );
|
||||
update_site_option( 'illegal_names', $illegal_names );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ if ( $_POST ) {
|
||||
if ( ! isset($_POST[$option_name]) )
|
||||
continue;
|
||||
$value = wp_unslash( $_POST[$option_name] );
|
||||
update_network_option( $option_name, $value );
|
||||
update_site_option( $option_name, $value );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -113,7 +113,7 @@ if ( isset( $_GET['updated'] ) ) {
|
||||
<tr>
|
||||
<th scope="row"><label for="admin_email"><?php _e( 'Network Admin Email' ) ?></label></th>
|
||||
<td>
|
||||
<input name="admin_email" type="email" id="admin_email" aria-describedby="admin-email-desc" class="regular-text" value="<?php echo esc_attr( get_network_option( 'admin_email' ) ) ?>" />
|
||||
<input name="admin_email" type="email" id="admin_email" aria-describedby="admin-email-desc" class="regular-text" value="<?php echo esc_attr( get_site_option( 'admin_email' ) ) ?>" />
|
||||
<p class="description" id="admin-email-desc">
|
||||
<?php _e( 'This email address will receive notifications. Registration and support emails will also come from this address.' ); ?>
|
||||
</p>
|
||||
@@ -125,9 +125,9 @@ if ( isset( $_GET['updated'] ) ) {
|
||||
<tr>
|
||||
<th scope="row"><?php _e( 'Allow new registrations' ) ?></th>
|
||||
<?php
|
||||
if ( !get_network_option( 'registration' ) )
|
||||
update_network_option( 'registration', 'none' );
|
||||
$reg = get_network_option( 'registration' );
|
||||
if ( !get_site_option( 'registration' ) )
|
||||
update_site_option( 'registration', 'none' );
|
||||
$reg = get_site_option( 'registration' );
|
||||
?>
|
||||
<td>
|
||||
<fieldset>
|
||||
@@ -146,25 +146,25 @@ if ( isset( $_GET['updated'] ) ) {
|
||||
<tr>
|
||||
<th scope="row"><?php _e( 'Registration notification' ) ?></th>
|
||||
<?php
|
||||
if ( !get_network_option( 'registrationnotification' ) )
|
||||
update_network_option( 'registrationnotification', 'yes' );
|
||||
if ( !get_site_option( 'registrationnotification' ) )
|
||||
update_site_option( 'registrationnotification', 'yes' );
|
||||
?>
|
||||
<td>
|
||||
<label><input name="registrationnotification" type="checkbox" id="registrationnotification" value="yes"<?php checked( get_network_option( 'registrationnotification' ), 'yes' ) ?> /> <?php _e( 'Send the network admin an email notification every time someone registers a site or user account.' ) ?></label>
|
||||
<label><input name="registrationnotification" type="checkbox" id="registrationnotification" value="yes"<?php checked( get_site_option( 'registrationnotification' ), 'yes' ) ?> /> <?php _e( 'Send the network admin an email notification every time someone registers a site or user account.' ) ?></label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="addnewusers">
|
||||
<th scope="row"><?php _e( 'Add New Users' ) ?></th>
|
||||
<td>
|
||||
<label><input name="add_new_users" type="checkbox" id="add_new_users" value="1"<?php checked( get_network_option( 'add_new_users' ) ) ?> /> <?php _e( 'Allow site administrators to add new users to their site via the "Users → Add New" page.' ); ?></label>
|
||||
<label><input name="add_new_users" type="checkbox" id="add_new_users" value="1"<?php checked( get_site_option( 'add_new_users' ) ) ?> /> <?php _e( 'Allow site administrators to add new users to their site via the "Users → Add New" page.' ); ?></label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row"><label for="illegal_names"><?php _e( 'Banned Names' ) ?></label></th>
|
||||
<td>
|
||||
<input name="illegal_names" type="text" id="illegal_names" aria-describedby="illegal-names-desc" class="large-text" value="<?php echo esc_attr( implode( " ", (array) get_network_option( 'illegal_names' ) ) ); ?>" size="45" />
|
||||
<input name="illegal_names" type="text" id="illegal_names" aria-describedby="illegal-names-desc" class="large-text" value="<?php echo esc_attr( implode( " ", (array) get_site_option( 'illegal_names' ) ) ); ?>" size="45" />
|
||||
<p class="description" id="illegal-names-desc">
|
||||
<?php _e( 'Users are not allowed to register these sites. Separate names by spaces.' ) ?>
|
||||
</p>
|
||||
@@ -174,7 +174,7 @@ if ( isset( $_GET['updated'] ) ) {
|
||||
<tr>
|
||||
<th scope="row"><label for="limited_email_domains"><?php _e( 'Limited Email Registrations' ) ?></label></th>
|
||||
<td>
|
||||
<?php $limited_email_domains = get_network_option( 'limited_email_domains' );
|
||||
<?php $limited_email_domains = get_site_option( 'limited_email_domains' );
|
||||
$limited_email_domains = str_replace( ' ', "\n", $limited_email_domains ); ?>
|
||||
<textarea name="limited_email_domains" id="limited_email_domains" aria-describedby="limited-email-domains-desc" cols="45" rows="5">
|
||||
<?php echo esc_textarea( $limited_email_domains == '' ? '' : implode( "\n", (array) $limited_email_domains ) ); ?></textarea>
|
||||
@@ -188,7 +188,7 @@ if ( isset( $_GET['updated'] ) ) {
|
||||
<th scope="row"><label for="banned_email_domains"><?php _e('Banned Email Domains') ?></label></th>
|
||||
<td>
|
||||
<textarea name="banned_email_domains" id="banned_email_domains" aria-describedby="banned-email-domains-desc" cols="45" rows="5">
|
||||
<?php echo esc_textarea( get_network_option( 'banned_email_domains' ) == '' ? '' : implode( "\n", (array) get_network_option( 'banned_email_domains' ) ) ); ?></textarea>
|
||||
<?php echo esc_textarea( get_site_option( 'banned_email_domains' ) == '' ? '' : implode( "\n", (array) get_site_option( 'banned_email_domains' ) ) ); ?></textarea>
|
||||
<p class="description" id="banned-email-domains-desc">
|
||||
<?php _e( 'If you want to ban domains from site registrations. One domain per line.' ) ?>
|
||||
</p>
|
||||
@@ -203,7 +203,7 @@ if ( isset( $_GET['updated'] ) ) {
|
||||
<th scope="row"><label for="welcome_email"><?php _e( 'Welcome Email' ) ?></label></th>
|
||||
<td>
|
||||
<textarea name="welcome_email" id="welcome_email" aria-describedby="welcome-email-desc" rows="5" cols="45" class="large-text">
|
||||
<?php echo esc_textarea( get_network_option( 'welcome_email' ) ) ?></textarea>
|
||||
<?php echo esc_textarea( get_site_option( 'welcome_email' ) ) ?></textarea>
|
||||
<p class="description" id="welcome-email-desc">
|
||||
<?php _e( 'The welcome email sent to new site owners.' ) ?>
|
||||
</p>
|
||||
@@ -213,7 +213,7 @@ if ( isset( $_GET['updated'] ) ) {
|
||||
<th scope="row"><label for="welcome_user_email"><?php _e( 'Welcome User Email' ) ?></label></th>
|
||||
<td>
|
||||
<textarea name="welcome_user_email" id="welcome_user_email" aria-describedby="welcome-user-email-desc" rows="5" cols="45" class="large-text">
|
||||
<?php echo esc_textarea( get_network_option( 'welcome_user_email' ) ) ?></textarea>
|
||||
<?php echo esc_textarea( get_site_option( 'welcome_user_email' ) ) ?></textarea>
|
||||
<p class="description" id="welcome-user-email-desc">
|
||||
<?php _e( 'The welcome email sent to new users.' ) ?>
|
||||
</p>
|
||||
@@ -223,7 +223,7 @@ if ( isset( $_GET['updated'] ) ) {
|
||||
<th scope="row"><label for="first_post"><?php _e( 'First Post' ) ?></label></th>
|
||||
<td>
|
||||
<textarea name="first_post" id="first_post" aria-describedby="first-post-desc" rows="5" cols="45" class="large-text">
|
||||
<?php echo esc_textarea( get_network_option( 'first_post' ) ) ?></textarea>
|
||||
<?php echo esc_textarea( get_site_option( 'first_post' ) ) ?></textarea>
|
||||
<p class="description" id="first-post-desc">
|
||||
<?php _e( 'The first post on a new site.' ) ?>
|
||||
</p>
|
||||
@@ -233,7 +233,7 @@ if ( isset( $_GET['updated'] ) ) {
|
||||
<th scope="row"><label for="first_page"><?php _e( 'First Page' ) ?></label></th>
|
||||
<td>
|
||||
<textarea name="first_page" id="first_page" aria-describedby="first-page-desc" rows="5" cols="45" class="large-text">
|
||||
<?php echo esc_textarea( get_network_option( 'first_page' ) ) ?></textarea>
|
||||
<?php echo esc_textarea( get_site_option( 'first_page' ) ) ?></textarea>
|
||||
<p class="description" id="first-page-desc">
|
||||
<?php _e( 'The first page on a new site.' ) ?>
|
||||
</p>
|
||||
@@ -243,7 +243,7 @@ if ( isset( $_GET['updated'] ) ) {
|
||||
<th scope="row"><label for="first_comment"><?php _e( 'First Comment' ) ?></label></th>
|
||||
<td>
|
||||
<textarea name="first_comment" id="first_comment" aria-describedby="first-comment-desc" rows="5" cols="45" class="large-text">
|
||||
<?php echo esc_textarea( get_network_option( 'first_comment' ) ) ?></textarea>
|
||||
<?php echo esc_textarea( get_site_option( 'first_comment' ) ) ?></textarea>
|
||||
<p class="description" id="first-comment-desc">
|
||||
<?php _e( 'The first comment on a new site.' ) ?>
|
||||
</p>
|
||||
@@ -252,7 +252,7 @@ if ( isset( $_GET['updated'] ) ) {
|
||||
<tr>
|
||||
<th scope="row"><label for="first_comment_author"><?php _e( 'First Comment Author' ) ?></label></th>
|
||||
<td>
|
||||
<input type="text" size="40" name="first_comment_author" id="first_comment_author" aria-describedby="first-comment-author-desc" value="<?php echo get_network_option( 'first_comment_author' ) ?>" />
|
||||
<input type="text" size="40" name="first_comment_author" id="first_comment_author" aria-describedby="first-comment-author-desc" value="<?php echo get_site_option('first_comment_author') ?>" />
|
||||
<p class="description" id="first-comment-author-desc">
|
||||
<?php _e( 'The author of the first comment on a new site.' ) ?>
|
||||
</p>
|
||||
@@ -261,7 +261,7 @@ if ( isset( $_GET['updated'] ) ) {
|
||||
<tr>
|
||||
<th scope="row"><label for="first_comment_url"><?php _e( 'First Comment URL' ) ?></label></th>
|
||||
<td>
|
||||
<input type="text" size="40" name="first_comment_url" id="first_comment_url" aria-describedby="first-comment-url-desc" value="<?php echo esc_attr( get_network_option( 'first_comment_url' ) ) ?>" />
|
||||
<input type="text" size="40" name="first_comment_url" id="first_comment_url" aria-describedby="first-comment-url-desc" value="<?php echo esc_attr( get_site_option( 'first_comment_url' ) ) ?>" />
|
||||
<p class="description" id="first-comment-url-desc">
|
||||
<?php _e( 'The URL for the first comment on a new site.' ) ?>
|
||||
</p>
|
||||
@@ -273,7 +273,7 @@ if ( isset( $_GET['updated'] ) ) {
|
||||
<tr>
|
||||
<th scope="row"><?php _e( 'Site upload space' ) ?></th>
|
||||
<td>
|
||||
<label><input type="checkbox" id="upload_space_check_disabled" name="upload_space_check_disabled" value="0"<?php checked( get_network_option( 'upload_space_check_disabled' ), 0 ) ?>/> <?php printf( __( 'Limit total size of files uploaded to %s MB' ), '</label><label><input name="blog_upload_space" type="number" min="0" style="width: 100px" id="blog_upload_space" aria-describedby="blog-upload-space-desc" value="' . esc_attr( get_network_option('blog_upload_space', 100) ) . '" />' ); ?></label><br />
|
||||
<label><input type="checkbox" id="upload_space_check_disabled" name="upload_space_check_disabled" value="0"<?php checked( get_site_option( 'upload_space_check_disabled' ), 0 ) ?>/> <?php printf( __( 'Limit total size of files uploaded to %s MB' ), '</label><label><input name="blog_upload_space" type="number" min="0" style="width: 100px" id="blog_upload_space" aria-describedby="blog-upload-space-desc" value="' . esc_attr( get_site_option('blog_upload_space', 100) ) . '" />' ); ?></label><br />
|
||||
<p class="screen-reader-text" id="blog-upload-space-desc">
|
||||
<?php _e( 'Size in megabytes' ) ?>
|
||||
</p>
|
||||
@@ -283,7 +283,7 @@ if ( isset( $_GET['updated'] ) ) {
|
||||
<tr>
|
||||
<th scope="row"><label for="upload_filetypes"><?php _e( 'Upload file types' ) ?></label></th>
|
||||
<td>
|
||||
<input name="upload_filetypes" type="text" id="upload_filetypes" aria-describedby="upload-filetypes-desc" class="large-text" value="<?php echo esc_attr( get_network_option( 'upload_filetypes', 'jpg jpeg png gif' ) ) ?>" size="45" />
|
||||
<input name="upload_filetypes" type="text" id="upload_filetypes" aria-describedby="upload-filetypes-desc" class="large-text" value="<?php echo esc_attr( get_site_option( 'upload_filetypes', 'jpg jpeg png gif' ) ) ?>" size="45" />
|
||||
<p class="description" id="upload-filetypes-desc">
|
||||
<?php _e( 'Allowed file types. Separate types by spaces.' ) ?>
|
||||
</p>
|
||||
@@ -293,7 +293,7 @@ if ( isset( $_GET['updated'] ) ) {
|
||||
<tr>
|
||||
<th scope="row"><label for="fileupload_maxk"><?php _e( 'Max upload file size' ) ?></label></th>
|
||||
<td>
|
||||
<?php printf( _x( '%s KB', 'File size in kilobytes' ), '<input name="fileupload_maxk" type="number" min="0" style="width: 100px" id="fileupload_maxk" aria-describedby="fileupload-maxk-desc" value="' . esc_attr( get_network_option( 'fileupload_maxk', 300 ) ) . '" />' ); ?>
|
||||
<?php printf( _x( '%s KB', 'File size in kilobytes' ), '<input name="fileupload_maxk" type="number" min="0" style="width: 100px" id="fileupload_maxk" aria-describedby="fileupload-maxk-desc" value="' . esc_attr( get_site_option( 'fileupload_maxk', 300 ) ) . '" />' ); ?>
|
||||
<p class="screen-reader-text" id="fileupload-maxk-desc">
|
||||
<?php _e( 'Size in kilobytes' ) ?>
|
||||
</p>
|
||||
@@ -312,7 +312,7 @@ if ( isset( $_GET['updated'] ) ) {
|
||||
<th><label for="WPLANG"><?php _e( 'Default Language' ); ?></label></th>
|
||||
<td>
|
||||
<?php
|
||||
$lang = get_network_option( 'WPLANG' );
|
||||
$lang = get_site_option( 'WPLANG' );
|
||||
if ( ! in_array( $lang, $languages ) ) {
|
||||
$lang = '';
|
||||
}
|
||||
@@ -339,7 +339,7 @@ if ( isset( $_GET['updated'] ) ) {
|
||||
<th scope="row"><?php _e( 'Enable administration menus' ); ?></th>
|
||||
<td>
|
||||
<?php
|
||||
$menu_perms = get_network_option( 'menu_items' );
|
||||
$menu_perms = get_site_option( 'menu_items' );
|
||||
/**
|
||||
* Filter available network-wide administration menu options.
|
||||
*
|
||||
|
||||
@@ -124,7 +124,7 @@ Name: %3$s' ),
|
||||
get_site_url( $id ),
|
||||
wp_unslash( $title )
|
||||
);
|
||||
wp_mail( get_network_option( 'admin_email' ), sprintf( __( '[%s] New Site Created' ), $current_site->site_name ), $content_mail, 'From: "Site Admin" <' . get_network_option( 'admin_email' ) . '>' );
|
||||
wp_mail( get_site_option('admin_email'), sprintf( __( '[%s] New Site Created' ), $current_site->site_name ), $content_mail, 'From: "Site Admin" <' . get_site_option( 'admin_email' ) . '>' );
|
||||
wpmu_welcome_notification( $id, $user_id, $password, $title, array( 'public' => 1 ) );
|
||||
wp_redirect( add_query_arg( array( 'update' => 'added', 'id' => $id ), 'site-new.php' ) );
|
||||
exit;
|
||||
@@ -189,7 +189,7 @@ if ( ! empty( $messages ) ) {
|
||||
<td>
|
||||
<?php
|
||||
// Network default.
|
||||
$lang = get_network_option( 'WPLANG' );
|
||||
$lang = get_site_option( 'WPLANG' );
|
||||
|
||||
// Use English if the default isn't available.
|
||||
if ( ! in_array( $lang, $languages ) ) {
|
||||
|
||||
@@ -29,12 +29,12 @@ $_SERVER['REQUEST_URI'] = remove_query_arg( $temp_args, $_SERVER['REQUEST_URI']
|
||||
$referer = remove_query_arg( $temp_args, wp_get_referer() );
|
||||
|
||||
if ( $action ) {
|
||||
$allowed_themes = get_network_option( 'allowedthemes' );
|
||||
$allowed_themes = get_site_option( 'allowedthemes' );
|
||||
switch ( $action ) {
|
||||
case 'enable':
|
||||
check_admin_referer('enable-theme_' . $_GET['theme']);
|
||||
$allowed_themes[ $_GET['theme'] ] = true;
|
||||
update_network_option( 'allowedthemes', $allowed_themes );
|
||||
update_site_option( 'allowedthemes', $allowed_themes );
|
||||
if ( false === strpos( $referer, '/network/themes.php' ) )
|
||||
wp_redirect( network_admin_url( 'themes.php?enabled=1' ) );
|
||||
else
|
||||
@@ -43,7 +43,7 @@ if ( $action ) {
|
||||
case 'disable':
|
||||
check_admin_referer('disable-theme_' . $_GET['theme']);
|
||||
unset( $allowed_themes[ $_GET['theme'] ] );
|
||||
update_network_option( 'allowedthemes', $allowed_themes );
|
||||
update_site_option( 'allowedthemes', $allowed_themes );
|
||||
wp_safe_redirect( add_query_arg( 'disabled', '1', $referer ) );
|
||||
exit;
|
||||
case 'enable-selected':
|
||||
@@ -55,7 +55,7 @@ if ( $action ) {
|
||||
}
|
||||
foreach ( (array) $themes as $theme )
|
||||
$allowed_themes[ $theme ] = true;
|
||||
update_network_option( 'allowedthemes', $allowed_themes );
|
||||
update_site_option( 'allowedthemes', $allowed_themes );
|
||||
wp_safe_redirect( add_query_arg( 'enabled', count( $themes ), $referer ) );
|
||||
exit;
|
||||
case 'disable-selected':
|
||||
@@ -67,7 +67,7 @@ if ( $action ) {
|
||||
}
|
||||
foreach ( (array) $themes as $theme )
|
||||
unset( $allowed_themes[ $theme ] );
|
||||
update_network_option( 'allowedthemes', $allowed_themes );
|
||||
update_site_option( 'allowedthemes', $allowed_themes );
|
||||
wp_safe_redirect( add_query_arg( 'disabled', count( $themes ), $referer ) );
|
||||
exit;
|
||||
case 'update-selected' :
|
||||
|
||||
@@ -52,7 +52,7 @@ switch ( $action ) {
|
||||
* @global string $wp_db_version
|
||||
*/
|
||||
global $wp_db_version;
|
||||
update_network_option( 'wpmu_upgrade_site', $wp_db_version );
|
||||
update_site_option( 'wpmu_upgrade_site', $wp_db_version );
|
||||
}
|
||||
|
||||
$blogs = $wpdb->get_results( "SELECT blog_id FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' AND spam = '0' AND deleted = '0' AND archived = '0' ORDER BY registered DESC LIMIT {$n}, 5", ARRAY_A );
|
||||
@@ -109,7 +109,7 @@ switch ( $action ) {
|
||||
break;
|
||||
case 'show':
|
||||
default:
|
||||
if ( get_network_option( 'wpmu_upgrade_site' ) != $GLOBALS['wp_db_version'] ) :
|
||||
if ( get_site_option( 'wpmu_upgrade_site' ) != $GLOBALS['wp_db_version'] ) :
|
||||
?>
|
||||
<h2><?php _e( 'Database Upgrade Required' ); ?></h2>
|
||||
<p><?php _e( 'WordPress has been updated! Before we send you on your way, we need to individually upgrade the sites in your network.' ); ?></p>
|
||||
|
||||
@@ -56,7 +56,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
<?php settings_fields('writing'); ?>
|
||||
|
||||
<table class="form-table">
|
||||
<?php if ( get_network_option( 'initial_db_version' ) < 32453 ) : ?>
|
||||
<?php if ( get_site_option( 'initial_db_version' ) < 32453 ) : ?>
|
||||
<tr>
|
||||
<th scope="row"><?php _e('Formatting') ?></th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span><?php _e('Formatting') ?></span></legend>
|
||||
|
||||
@@ -95,7 +95,7 @@ $mail_options = array('mailserver_url', 'mailserver_port', 'mailserver_login', '
|
||||
if ( ! in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ) )
|
||||
$whitelist_options['reading'][] = 'blog_charset';
|
||||
|
||||
if ( get_network_option( 'initial_db_version' ) < 32453 ) {
|
||||
if ( get_site_option( 'initial_db_version' ) < 32453 ) {
|
||||
$whitelist_options['writing'][] = 'use_smilies';
|
||||
$whitelist_options['writing'][] = 'use_balanceTags';
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ case 'update':
|
||||
if ( ! is_network_admin() ) {
|
||||
update_option( 'recently_activated', array( $file => time() ) + (array) get_option( 'recently_activated' ) );
|
||||
} else {
|
||||
update_network_option( 'recently_activated', array( $file => time() ) + (array) get_network_option( 'recently_activated' ) );
|
||||
update_site_option( 'recently_activated', array( $file => time() ) + (array) get_site_option( 'recently_activated' ) );
|
||||
}
|
||||
|
||||
wp_redirect(add_query_arg('_wpnonce', wp_create_nonce('edit-plugin-test_' . $file), "plugin-editor.php?file=$file&liveupdate=1&scrollto=$scrollto&networkwide=" . $network_wide));
|
||||
|
||||
@@ -55,9 +55,9 @@ if ( $action ) {
|
||||
unset( $recent[ $plugin ] );
|
||||
update_option( 'recently_activated', $recent );
|
||||
} else {
|
||||
$recent = (array) get_network_option( 'recently_activated' );
|
||||
$recent = (array) get_site_option( 'recently_activated' );
|
||||
unset( $recent[ $plugin ] );
|
||||
update_network_option( 'recently_activated', $recent );
|
||||
update_site_option( 'recently_activated', $recent );
|
||||
}
|
||||
|
||||
if ( isset($_GET['from']) && 'import' == $_GET['from'] ) {
|
||||
@@ -101,7 +101,7 @@ if ( $action ) {
|
||||
if ( ! is_network_admin() ) {
|
||||
$recent = (array) get_option('recently_activated' );
|
||||
} else {
|
||||
$recent = (array) get_network_option( 'recently_activated' );
|
||||
$recent = (array) get_site_option('recently_activated' );
|
||||
}
|
||||
|
||||
foreach ( $plugins as $plugin ) {
|
||||
@@ -111,7 +111,7 @@ if ( $action ) {
|
||||
if ( ! is_network_admin() ) {
|
||||
update_option( 'recently_activated', $recent );
|
||||
} else {
|
||||
update_network_option( 'recently_activated', $recent );
|
||||
update_site_option( 'recently_activated', $recent );
|
||||
}
|
||||
|
||||
wp_redirect( self_admin_url("plugins.php?activate-multi=true&plugin_status=$status&paged=$page&s=$s") );
|
||||
@@ -182,7 +182,7 @@ if ( $action ) {
|
||||
if ( ! is_network_admin() ) {
|
||||
update_option( 'recently_activated', array( $plugin => time() ) + (array) get_option( 'recently_activated' ) );
|
||||
} else {
|
||||
update_network_option( 'recently_activated', array( $plugin => time() ) + (array) get_network_option( 'recently_activated' ) );
|
||||
update_site_option( 'recently_activated', array( $plugin => time() ) + (array) get_site_option( 'recently_activated' ) );
|
||||
}
|
||||
|
||||
if ( headers_sent() )
|
||||
@@ -220,7 +220,7 @@ if ( $action ) {
|
||||
if ( ! is_network_admin() ) {
|
||||
update_option( 'recently_activated', $deactivated + (array) get_option( 'recently_activated' ) );
|
||||
} else {
|
||||
update_network_option( 'recently_activated', $deactivated + (array) get_network_option( 'recently_activated' ) );
|
||||
update_site_option( 'recently_activated', $deactivated + (array) get_site_option( 'recently_activated' ) );
|
||||
}
|
||||
|
||||
wp_redirect( self_admin_url("plugins.php?deactivate-multi=true&plugin_status=$status&paged=$page&s=$s") );
|
||||
@@ -382,7 +382,7 @@ if ( $action ) {
|
||||
if ( ! is_network_admin() ) {
|
||||
update_option( 'recently_activated', array() );
|
||||
} else {
|
||||
update_network_option( 'recently_activated', array() );
|
||||
update_site_option( 'recently_activated', array() );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ else
|
||||
if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && !isset($super_admins) ) { ?>
|
||||
<tr class="user-super-admin-wrap"><th><?php _e('Super Admin'); ?></th>
|
||||
<td>
|
||||
<?php if ( $profileuser->user_email != get_network_option( 'admin_email' ) || ! is_super_admin( $profileuser->ID ) ) : ?>
|
||||
<?php if ( $profileuser->user_email != get_site_option( 'admin_email' ) || ! is_super_admin( $profileuser->ID ) ) : ?>
|
||||
<p><label><input type="checkbox" id="super_admin" name="super_admin"<?php checked( is_super_admin( $profileuser->ID ) ); ?> /> <?php _e( 'Grant this user super admin privileges for the Network.' ); ?></label></p>
|
||||
<?php else : ?>
|
||||
<p><?php _e( 'Super admin privileges cannot be removed because this user has the network admin email.' ); ?></p>
|
||||
|
||||
Reference in New Issue
Block a user