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:
Jeremy Felt 2015-10-07 17:11:25 +00:00
parent feb2267a13
commit 9926983b66
36 changed files with 193 additions and 193 deletions

View File

@ -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);
}
}

View File

@ -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 );
}

View File

@ -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' ) );
}
/**

View File

@ -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' => ''

View File

@ -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();

View File

@ -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.

View File

@ -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";
}

View File

@ -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 ) );
}

View File

@ -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(),

View File

@ -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;
}

View File

@ -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.

View File

@ -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&#039;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&#039;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 );
}
}

View File

@ -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 &rarr; 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 &rarr; 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.
*

View File

@ -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 ) ) {

View File

@ -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' :

View File

@ -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>

View File

@ -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>

View File

@ -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';
}

View File

@ -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));

View File

@ -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;
}

View File

@ -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>

View File

@ -336,7 +336,7 @@ function map_meta_cap( $cap, $user_id ) {
$caps[] = $cap;
if ( is_multisite() ) {
// update_, install_, and delete_ are handled above with is_super_admin().
$menu_perms = get_network_option( 'menu_items', array() );
$menu_perms = get_site_option( 'menu_items', array() );
if ( empty( $menu_perms['plugins'] ) )
$caps[] = 'manage_network_plugins';
}
@ -352,7 +352,7 @@ function map_meta_cap( $cap, $user_id ) {
case 'create_users':
if ( !is_multisite() )
$caps[] = $cap;
elseif ( is_super_admin( $user_id ) || get_network_option( 'add_new_users' ) )
elseif ( is_super_admin( $user_id ) || get_site_option( 'add_new_users' ) )
$caps[] = $cap;
else
$caps[] = 'do_not_allow';
@ -578,7 +578,7 @@ function get_super_admins() {
if ( isset($super_admins) )
return $super_admins;
else
return get_network_option( 'site_admins', array('admin') );
return get_site_option( 'site_admins', array('admin') );
}
/**

View File

@ -1191,7 +1191,7 @@ final class WP_Theme implements ArrayAccess {
public static function get_allowed_on_network() {
static $allowed_themes;
if ( ! isset( $allowed_themes ) )
$allowed_themes = (array) get_network_option( 'allowedthemes' );
$allowed_themes = (array) get_site_option( 'allowedthemes' );
return $allowed_themes;
}

View File

@ -189,7 +189,7 @@ function wp_cookie_constants() {
* @since 1.5.0
*/
if ( !defined( 'COOKIEHASH' ) ) {
$siteurl = get_network_option( 'siteurl' );
$siteurl = get_site_option( 'siteurl' );
if ( $siteurl )
define( 'COOKIEHASH', md5( $siteurl ) );
else

View File

@ -1760,7 +1760,7 @@ function wp_upload_dir( $time = null ) {
* Honor the value of UPLOADS. This happens as long as ms-files rewriting is disabled.
* We also sometimes obey UPLOADS when rewriting is enabled -- see the next block.
*/
if ( defined( 'UPLOADS' ) && ! ( is_multisite() && get_network_option( 'ms_files_rewriting' ) ) ) {
if ( defined( 'UPLOADS' ) && ! ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) ) {
$dir = ABSPATH . UPLOADS;
$url = trailingslashit( $siteurl ) . UPLOADS;
}
@ -1768,7 +1768,7 @@ function wp_upload_dir( $time = null ) {
// If multisite (and if not the main site in a post-MU network)
if ( is_multisite() && ! ( is_main_network() && is_main_site() && defined( 'MULTISITE' ) ) ) {
if ( ! get_network_option( 'ms_files_rewriting' ) ) {
if ( ! get_site_option( 'ms_files_rewriting' ) ) {
/*
* If ms-files rewriting is disabled (networks created post-3.5), it is fairly
* straightforward: Append sites/%d if we're not on the main site (for post-MU
@ -4003,7 +4003,7 @@ function global_terms_enabled() {
if ( ! is_null( $filter ) )
$global_terms = (bool) $filter;
else
$global_terms = (bool) get_network_option( 'global_terms_enabled', false );
$global_terms = (bool) get_site_option( 'global_terms_enabled', false );
}
return $global_terms;
}

View File

@ -54,7 +54,7 @@ function get_locale() {
if ( is_multisite() ) {
// Don't check blog option when installing.
if ( wp_installing() || ( false === $ms_locale = get_option( 'WPLANG' ) ) ) {
$ms_locale = get_network_option( 'WPLANG' );
$ms_locale = get_site_option( 'WPLANG' );
}
if ( $ms_locale !== false ) {

View File

@ -23,7 +23,7 @@ function ms_upload_constants() {
// This filter is attached in ms-default-filters.php but that file is not included during SHORTINIT.
add_filter( 'default_site_option_ms_files_rewriting', '__return_true' );
if ( ! get_network_option( 'ms_files_rewriting' ) )
if ( ! get_site_option( 'ms_files_rewriting' ) )
return;
// Base uploads dir relative to ABSPATH

View File

@ -25,7 +25,7 @@
*/
function get_dashboard_blog() {
_deprecated_function( __FUNCTION__, '3.1' );
if ( $blog = get_network_option( 'dashboard_blog' ) )
if ( $blog = get_site_option( 'dashboard_blog' ) )
return get_blog_details( $blog );
return get_blog_details( $GLOBALS['current_site']->blog_id );

View File

@ -100,7 +100,7 @@ function get_active_blog_for_user( $user_id ) {
* @return int
*/
function get_user_count() {
return get_network_option( 'user_count' );
return get_site_option( 'user_count' );
}
/**
@ -117,7 +117,7 @@ function get_blog_count( $network_id = 0 ) {
if ( func_num_args() )
_deprecated_argument( __FUNCTION__, '3.1' );
return get_network_option( 'blog_count' );
return get_site_option( 'blog_count' );
}
/**
@ -344,7 +344,7 @@ function get_blog_id_from_url( $domain, $path = '/' ) {
* @return bool Returns true when the email address is banned.
*/
function is_email_address_unsafe( $user_email ) {
$banned_names = get_network_option( 'banned_email_domains' );
$banned_names = get_site_option( 'banned_email_domains' );
if ( $banned_names && ! is_array( $banned_names ) )
$banned_names = explode( "\n", $banned_names );
@ -422,10 +422,10 @@ function wpmu_validate_user_signup($user_name, $user_email) {
if ( empty( $user_name ) )
$errors->add('user_name', __( 'Please enter a username.' ) );
$illegal_names = get_network_option( 'illegal_names' );
$illegal_names = get_site_option( 'illegal_names' );
if ( ! is_array( $illegal_names ) ) {
$illegal_names = array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' );
add_network_option( 'illegal_names', $illegal_names );
add_site_option( 'illegal_names', $illegal_names );
}
if ( in_array( $user_name, $illegal_names ) )
$errors->add('user_name', __( 'That username is not allowed.' ) );
@ -450,7 +450,7 @@ function wpmu_validate_user_signup($user_name, $user_email) {
if ( !is_email( $user_email ) )
$errors->add('user_email', __( 'Please enter a valid email address.' ) );
$limited_email_domains = get_network_option( 'limited_email_domains' );
$limited_email_domains = get_site_option( 'limited_email_domains' );
if ( is_array( $limited_email_domains ) && ! empty( $limited_email_domains ) ) {
$emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) );
if ( ! in_array( $emaildomain, $limited_email_domains ) ) {
@ -544,10 +544,10 @@ function wpmu_validate_blog_signup( $blogname, $blog_title, $user = '' ) {
$blog_title = strip_tags( $blog_title );
$errors = new WP_Error();
$illegal_names = get_network_option( 'illegal_names' );
$illegal_names = get_site_option( 'illegal_names' );
if ( $illegal_names == false ) {
$illegal_names = array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' );
add_network_option( 'illegal_names', $illegal_names );
add_site_option( 'illegal_names', $illegal_names );
}
/*
@ -789,10 +789,10 @@ function wpmu_signup_blog_notification( $domain, $path, $title, $user, $user_ema
$activate_url = "http://{$domain}{$path}wp-activate.php?key=$key"; // @todo use *_url() API
$activate_url = esc_url($activate_url);
$admin_email = get_network_option( 'admin_email' );
$admin_email = get_site_option( 'admin_email' );
if ( $admin_email == '' )
$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
$from_name = get_network_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_network_option( 'site_name' ) );
$from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
$message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
$message = sprintf(
/**
@ -882,10 +882,10 @@ function wpmu_signup_user_notification( $user, $user_email, $key, $meta = array(
return false;
// Send email with activation link.
$admin_email = get_network_option( 'admin_email' );
$admin_email = get_site_option( 'admin_email' );
if ( $admin_email == '' )
$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
$from_name = get_network_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_network_option( 'site_name' ) );
$from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
$message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
$message = sprintf(
/**
@ -1124,7 +1124,7 @@ function wpmu_create_blog( $domain, $path, $title, $user_id, $meta = array(), $s
update_option( $key, $value );
}
add_option( 'WPLANG', get_network_option( 'WPLANG' ) );
add_option( 'WPLANG', get_site_option( 'WPLANG' ) );
update_option( 'blog_public', (int) $meta['public'] );
if ( ! is_super_admin( $user_id ) && ! get_user_meta( $user_id, 'primary_blog', true ) )
@ -1160,10 +1160,10 @@ function wpmu_create_blog( $domain, $path, $title, $user_id, $meta = array(), $s
* @return bool
*/
function newblog_notify_siteadmin( $blog_id, $deprecated = '' ) {
if ( get_network_option( 'registrationnotification' ) != 'yes' )
if ( get_site_option( 'registrationnotification' ) != 'yes' )
return false;
$email = get_network_option( 'admin_email' );
$email = get_site_option( 'admin_email' );
if ( is_email($email) == false )
return false;
@ -1205,10 +1205,10 @@ Disable these notifications: %4$s' ), $blogname, $siteurl, wp_unslash( $_SERVER[
* @return bool
*/
function newuser_notify_siteadmin( $user_id ) {
if ( get_network_option( 'registrationnotification' ) != 'yes' )
if ( get_site_option( 'registrationnotification' ) != 'yes' )
return false;
$email = get_network_option( 'admin_email' );
$email = get_site_option( 'admin_email' );
if ( is_email($email) == false )
return false;
@ -1344,7 +1344,7 @@ function install_blog( $blog_id, $blog_title = '' ) {
update_option( 'siteurl', $url );
update_option( 'home', $url );
if ( get_network_option( 'ms_files_rewriting' ) )
if ( get_site_option( 'ms_files_rewriting' ) )
update_option( 'upload_path', UPLOADBLOGSDIR . "/$blog_id/files" );
else
update_option( 'upload_path', get_blog_option( get_current_site()->blog_id, 'upload_path' ) );
@ -1420,7 +1420,7 @@ function wpmu_welcome_notification( $blog_id, $user_id, $password, $title, $meta
if ( ! apply_filters( 'wpmu_welcome_notification', $blog_id, $user_id, $password, $title, $meta ) )
return false;
$welcome_email = get_network_option( 'welcome_email' );
$welcome_email = get_site_option( 'welcome_email' );
if ( $welcome_email == false ) {
/* translators: Do not translate USERNAME, SITE_NAME, BLOG_URL, PASSWORD: those are placeholders. */
$welcome_email = __( 'Howdy USERNAME,
@ -1463,12 +1463,12 @@ We hope you enjoy your new site. Thanks!
* @param array $meta Signup meta data.
*/
$welcome_email = apply_filters( 'update_welcome_email', $welcome_email, $blog_id, $user_id, $password, $title, $meta );
$admin_email = get_network_option( 'admin_email' );
$admin_email = get_site_option( 'admin_email' );
if ( $admin_email == '' )
$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
$from_name = get_network_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_network_option( 'site_name' ) );
$from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
$message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
$message = $welcome_email;
@ -1519,7 +1519,7 @@ function wpmu_welcome_user_notification( $user_id, $password, $meta = array() )
if ( ! apply_filters( 'wpmu_welcome_user_notification', $user_id, $password, $meta ) )
return false;
$welcome_email = get_network_option( 'welcome_user_email' );
$welcome_email = get_site_option( 'welcome_user_email' );
$user = get_userdata( $user_id );
@ -1541,12 +1541,12 @@ function wpmu_welcome_user_notification( $user_id, $password, $meta = array() )
$welcome_email = str_replace( 'PASSWORD', $password, $welcome_email );
$welcome_email = str_replace( 'LOGINLINK', wp_login_url(), $welcome_email );
$admin_email = get_network_option( 'admin_email' );
$admin_email = get_site_option( 'admin_email' );
if ( $admin_email == '' )
$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
$from_name = get_network_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_network_option( 'site_name' ) );
$from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
$message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
$message = $welcome_email;
@ -1718,7 +1718,7 @@ function recurse_dirsize( $directory, $exclude = null ) {
* @return array
*/
function check_upload_mimes( $mimes ) {
$site_exts = explode( ' ', get_network_option( 'upload_filetypes', 'jpg jpeg png gif' ) );
$site_exts = explode( ' ', get_site_option( 'upload_filetypes', 'jpg jpeg png gif' ) );
$site_mimes = array();
foreach ( $site_exts as $ext ) {
foreach ( $mimes as $ext_pattern => $mime ) {
@ -1859,11 +1859,11 @@ function redirect_this_site( $deprecated = '' ) {
* @return string|array If the upload is under the size limit, $upload is returned. Otherwise returns an error message.
*/
function upload_is_file_too_big( $upload ) {
if ( ! is_array( $upload ) || defined( 'WP_IMPORTING' ) || get_network_option( 'upload_space_check_disabled' ) )
if ( ! is_array( $upload ) || defined( 'WP_IMPORTING' ) || get_site_option( 'upload_space_check_disabled' ) )
return $upload;
if ( strlen( $upload['bits'] ) > ( 1024 * get_network_option( 'fileupload_maxk', 1500 ) ) )
return sprintf( __( 'This file is too big. Files must be less than %d KB in size.' ) . '<br />', get_network_option( 'fileupload_maxk', 1500 ) );
if ( strlen( $upload['bits'] ) > ( 1024 * get_site_option( 'fileupload_maxk', 1500 ) ) )
return sprintf( __( 'This file is too big. Files must be less than %d KB in size.' ) . '<br />', get_site_option( 'fileupload_maxk', 1500 ));
return $upload;
}
@ -2076,7 +2076,7 @@ function is_user_option_local( $key, $user_id = 0, $blog_id = 0 ) {
* @return bool
*/
function users_can_register_signup_filter() {
$registration = get_network_option( 'registration' );
$registration = get_site_option('registration');
return ( $registration == 'all' || $registration == 'user' );
}
@ -2105,7 +2105,7 @@ LOGINLINK
Thanks!
--The Team @ SITE_NAME' );
update_network_option( 'welcome_user_email', $text );
update_site_option( 'welcome_user_email', $text );
}
return $text;
}
@ -2231,7 +2231,7 @@ function wp_update_network_site_counts() {
global $wpdb;
$count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(blog_id) as c FROM $wpdb->blogs WHERE site_id = %d AND spam = '0' AND deleted = '0' and archived = '0'", $wpdb->siteid) );
update_network_option( 'blog_count', $count );
update_site_option( 'blog_count', $count );
}
/**
@ -2245,7 +2245,7 @@ function wp_update_network_user_counts() {
global $wpdb;
$count = $wpdb->get_var( "SELECT COUNT(ID) as c FROM $wpdb->users WHERE spam = '0' AND deleted = '0'" );
update_network_option( 'user_count', $count );
update_site_option( 'user_count', $count );
}
/**
@ -2283,7 +2283,7 @@ function get_space_allowed() {
$space_allowed = get_option( 'blog_upload_space' );
if ( ! is_numeric( $space_allowed ) )
$space_allowed = get_network_option( 'blog_upload_space' );
$space_allowed = get_site_option( 'blog_upload_space' );
if ( empty( $space_allowed ) || ! is_numeric( $space_allowed ) )
$space_allowed = 100;
@ -2311,7 +2311,7 @@ function get_upload_space_available() {
$allowed = 0;
}
$space_allowed = $allowed * 1024 * 1024;
if ( get_network_option( 'upload_space_check_disabled' ) )
if ( get_site_option( 'upload_space_check_disabled' ) )
return $space_allowed;
$space_used = get_space_used() * 1024 * 1024;
@ -2329,7 +2329,7 @@ function get_upload_space_available() {
* @return bool True if space is available, false otherwise.
*/
function is_upload_space_available() {
if ( get_network_option( 'upload_space_check_disabled' ) )
if ( get_site_option( 'upload_space_check_disabled' ) )
return true;
return (bool) get_upload_space_available();
@ -2341,8 +2341,8 @@ function is_upload_space_available() {
* @return int of upload size limit in bytes
*/
function upload_size_limit_filter( $size ) {
$fileupload_maxk = 1024 * get_network_option( 'fileupload_maxk', 1500 );
if ( get_network_option( 'upload_space_check_disabled' ) )
$fileupload_maxk = 1024 * get_site_option( 'fileupload_maxk', 1500 );
if ( get_site_option( 'upload_space_check_disabled' ) )
return min( $size, $fileupload_maxk );
return min( $size, $fileupload_maxk, get_upload_space_available() );

View File

@ -34,7 +34,7 @@ function is_subdomain_install() {
* @return array Files to include.
*/
function wp_get_active_network_plugins() {
$active_plugins = (array) get_network_option( 'active_sitewide_plugins', array() );
$active_plugins = (array) get_site_option( 'active_sitewide_plugins', array() );
if ( empty( $active_plugins ) )
return array();
@ -96,7 +96,7 @@ function ms_site_check() {
if ( file_exists( WP_CONTENT_DIR . '/blog-inactive.php' ) )
return WP_CONTENT_DIR . '/blog-inactive.php';
else
wp_die( sprintf( __( 'This site has not been activated yet. If you are having problems activating your site, please contact <a href="mailto:%1$s">%1$s</a>.' ), str_replace( '@', ' AT ', get_network_option( 'admin_email', 'support@' . get_current_site()->domain ) ) ) );
wp_die( sprintf( __( 'This site has not been activated yet. If you are having problems activating your site, please contact <a href="mailto:%1$s">%1$s</a>.' ), str_replace( '@', ' AT ', get_site_option( 'admin_email', 'support@' . get_current_site()->domain ) ) ) );
}
if ( $blog->archived == '1' || $blog->spam == '1' ) {

View File

@ -88,7 +88,7 @@ function get_option( $option, $default = false ) {
wp_cache_add( $option, $value, 'options' );
} else { // option does not exist, so we must cache its non-existence
if ( ! is_array( $notoptions ) ) {
$notoptions = array();
$notoptions = array();
}
$notoptions[$option] = true;
wp_cache_set( 'notoptions', $notoptions, 'options' );
@ -1480,9 +1480,9 @@ function delete_site_transient( $transient ) {
} else {
$option_timeout = '_site_transient_timeout_' . $transient;
$option = '_site_transient_' . $transient;
$result = delete_network_option( $option );
$result = delete_site_option( $option );
if ( $result )
delete_network_option( $option_timeout );
delete_site_option( $option_timeout );
}
if ( $result ) {
@ -1543,16 +1543,16 @@ function get_site_transient( $transient ) {
$transient_option = '_site_transient_' . $transient;
if ( ! in_array( $transient, $no_timeout ) ) {
$transient_timeout = '_site_transient_timeout_' . $transient;
$timeout = get_network_option( $transient_timeout );
$timeout = get_site_option( $transient_timeout );
if ( false !== $timeout && $timeout < time() ) {
delete_network_option( $transient_option );
delete_network_option( $transient_timeout );
delete_site_option( $transient_option );
delete_site_option( $transient_timeout );
$value = false;
}
}
if ( ! isset( $value ) )
$value = get_network_option( $transient_option );
$value = get_site_option( $transient_option );
}
/**
@ -1620,14 +1620,14 @@ function set_site_transient( $transient, $value, $expiration = 0 ) {
} else {
$transient_timeout = '_site_transient_timeout_' . $transient;
$option = '_site_transient_' . $transient;
if ( false === get_network_option( $option ) ) {
if ( false === get_site_option( $option ) ) {
if ( $expiration )
add_network_option( $transient_timeout, time() + $expiration );
$result = add_network_option( $option, $value );
add_site_option( $transient_timeout, time() + $expiration );
$result = add_site_option( $option, $value );
} else {
if ( $expiration )
update_network_option( $transient_timeout, time() + $expiration );
$result = update_network_option( $option, $value );
update_site_option( $transient_timeout, time() + $expiration );
$result = update_site_option( $option, $value );
}
}
if ( $result ) {

View File

@ -1961,19 +1961,19 @@ function wp_salt( $scheme = 'auth' ) {
if ( defined( $const ) && constant( $const ) && empty( $duplicated_keys[ constant( $const ) ] ) ) {
$values[ $type ] = constant( $const );
} elseif ( ! $values[ $type ] ) {
$values[ $type ] = get_network_option( "{$scheme}_{$type}" );
$values[ $type ] = get_site_option( "{$scheme}_{$type}" );
if ( ! $values[ $type ] ) {
$values[ $type ] = wp_generate_password( 64, true, true );
update_network_option( "{$scheme}_{$type}", $values[ $type ] );
update_site_option( "{$scheme}_{$type}", $values[ $type ] );
}
}
}
} else {
if ( ! $values['key'] ) {
$values['key'] = get_network_option( 'secret_key' );
$values['key'] = get_site_option( 'secret_key' );
if ( ! $values['key'] ) {
$values['key'] = wp_generate_password( 64, true, true );
update_network_option( 'secret_key', $values['key'] );
update_site_option( 'secret_key', $values['key'] );
}
}
$values['salt'] = hash_hmac( 'md5', $scheme, $values['key'] );

View File

@ -1163,13 +1163,13 @@ function script_concat_settings() {
if ( ! isset($compress_scripts) ) {
$compress_scripts = defined('COMPRESS_SCRIPTS') ? COMPRESS_SCRIPTS : true;
if ( $compress_scripts && ( ! get_network_option( 'can_compress_scripts' ) || $compressed_output ) )
if ( $compress_scripts && ( ! get_site_option('can_compress_scripts') || $compressed_output ) )
$compress_scripts = false;
}
if ( ! isset($compress_css) ) {
$compress_css = defined('COMPRESS_CSS') ? COMPRESS_CSS : true;
if ( $compress_css && ( ! get_network_option( 'can_compress_scripts' ) || $compressed_output ) )
if ( $compress_css && ( ! get_site_option('can_compress_scripts') || $compressed_output ) )
$compress_css = false;
}
}

View File

@ -1811,7 +1811,7 @@ function _get_additional_user_keys( $user ) {
*/
function wp_get_user_contact_methods( $user = null ) {
$methods = array();
if ( get_network_option( 'initial_db_version' ) < 23588 ) {
if ( get_site_option( 'initial_db_version' ) < 23588 ) {
$methods = array(
'aim' => __( 'AIM' ),
'yim' => __( 'Yahoo IM' ),

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-34911';
$wp_version = '4.4-alpha-34912';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -7,7 +7,7 @@ add_action( 'wp_head', 'wp_no_robots' );
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
if ( is_array( get_network_option( 'illegal_names' ) ) && isset( $_GET[ 'new' ] ) && in_array( $_GET[ 'new' ], get_network_option( 'illegal_names' ) ) ) {
if ( is_array( get_site_option( 'illegal_names' )) && isset( $_GET[ 'new' ] ) && in_array( $_GET[ 'new' ], get_site_option( 'illegal_names' ) ) ) {
wp_redirect( network_home_url() );
die();
}
@ -673,7 +673,7 @@ function confirm_blog_signup( $domain, $path, $blog_title, $user_name = '', $use
}
// Main
$active_signup = get_network_option( 'registration', 'none' );
$active_signup = get_site_option( 'registration', 'none' );
/**
* Filter the type of site sign-up.
*