mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-16 23:00:21 +00:00
MS: Use *_network_option() functions throughout core.
Replaces all uses of `*_site_option()` with the corresponding "network" function. This excludes one usage in `wp-admin/admin-footer.php` that needs more investigation. Props spacedmonkey. See #28290. git-svn-id: https://develop.svn.wordpress.org/trunk@34778 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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_site_option( 'menu_items', array() );
|
||||
$menu_perms = get_network_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_site_option( 'add_new_users' ) )
|
||||
elseif ( is_super_admin( $user_id ) || get_network_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_site_option( 'site_admins', array('admin') );
|
||||
return get_network_option( 'site_admins', array('admin') );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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_site_option( 'allowedthemes' );
|
||||
$allowed_themes = (array) get_network_option( 'allowedthemes' );
|
||||
return $allowed_themes;
|
||||
}
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ function wp_cookie_constants() {
|
||||
* @since 1.5.0
|
||||
*/
|
||||
if ( !defined( 'COOKIEHASH' ) ) {
|
||||
$siteurl = get_site_option( 'siteurl' );
|
||||
$siteurl = get_network_option( 'siteurl' );
|
||||
if ( $siteurl )
|
||||
define( 'COOKIEHASH', md5( $siteurl ) );
|
||||
else
|
||||
|
||||
@@ -1762,7 +1762,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_site_option( 'ms_files_rewriting' ) ) ) {
|
||||
if ( defined( 'UPLOADS' ) && ! ( is_multisite() && get_network_option( 'ms_files_rewriting' ) ) ) {
|
||||
$dir = ABSPATH . UPLOADS;
|
||||
$url = trailingslashit( $siteurl ) . UPLOADS;
|
||||
}
|
||||
@@ -1770,7 +1770,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_site_option( 'ms_files_rewriting' ) ) {
|
||||
if ( ! get_network_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_site_option( 'global_terms_enabled', false );
|
||||
$global_terms = (bool) get_network_option( 'global_terms_enabled', false );
|
||||
}
|
||||
return $global_terms;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ function get_locale() {
|
||||
if ( is_multisite() ) {
|
||||
// Don't check blog option when installing.
|
||||
if ( defined( 'WP_INSTALLING' ) || ( false === $ms_locale = get_option( 'WPLANG' ) ) ) {
|
||||
$ms_locale = get_site_option( 'WPLANG' );
|
||||
$ms_locale = get_network_option( 'WPLANG' );
|
||||
}
|
||||
|
||||
if ( $ms_locale !== false ) {
|
||||
|
||||
@@ -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_site_option( 'ms_files_rewriting' ) )
|
||||
if ( ! get_network_option( 'ms_files_rewriting' ) )
|
||||
return;
|
||||
|
||||
// Base uploads dir relative to ABSPATH
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
*/
|
||||
function get_dashboard_blog() {
|
||||
_deprecated_function( __FUNCTION__, '3.1' );
|
||||
if ( $blog = get_site_option( 'dashboard_blog' ) )
|
||||
if ( $blog = get_network_option( 'dashboard_blog' ) )
|
||||
return get_blog_details( $blog );
|
||||
|
||||
return get_blog_details( $GLOBALS['current_site']->blog_id );
|
||||
|
||||
@@ -100,7 +100,7 @@ function get_active_blog_for_user( $user_id ) {
|
||||
* @return int
|
||||
*/
|
||||
function get_user_count() {
|
||||
return get_site_option( 'user_count' );
|
||||
return get_network_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_site_option( 'blog_count' );
|
||||
return get_network_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_site_option( 'banned_email_domains' );
|
||||
$banned_names = get_network_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_site_option( 'illegal_names' );
|
||||
$illegal_names = get_network_option( 'illegal_names' );
|
||||
if ( ! is_array( $illegal_names ) ) {
|
||||
$illegal_names = array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' );
|
||||
add_site_option( 'illegal_names', $illegal_names );
|
||||
add_network_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_site_option( 'limited_email_domains' );
|
||||
$limited_email_domains = get_network_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_site_option( 'illegal_names' );
|
||||
$illegal_names = get_network_option( 'illegal_names' );
|
||||
if ( $illegal_names == false ) {
|
||||
$illegal_names = array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' );
|
||||
add_site_option( 'illegal_names', $illegal_names );
|
||||
add_network_option( 'illegal_names', $illegal_names );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -801,10 +801,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_site_option( 'admin_email' );
|
||||
$admin_email = get_network_option( 'admin_email' );
|
||||
if ( $admin_email == '' )
|
||||
$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
|
||||
$from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
|
||||
$from_name = get_network_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_network_option( 'site_name' ) );
|
||||
$message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
|
||||
$message = sprintf(
|
||||
/**
|
||||
@@ -894,10 +894,10 @@ function wpmu_signup_user_notification( $user, $user_email, $key, $meta = array(
|
||||
return false;
|
||||
|
||||
// Send email with activation link.
|
||||
$admin_email = get_site_option( 'admin_email' );
|
||||
$admin_email = get_network_option( 'admin_email' );
|
||||
if ( $admin_email == '' )
|
||||
$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
|
||||
$from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
|
||||
$from_name = get_network_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_network_option( 'site_name' ) );
|
||||
$message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
|
||||
$message = sprintf(
|
||||
/**
|
||||
@@ -1135,7 +1135,7 @@ function wpmu_create_blog( $domain, $path, $title, $user_id, $meta = array(), $s
|
||||
update_option( $key, $value );
|
||||
}
|
||||
|
||||
add_option( 'WPLANG', get_site_option( 'WPLANG' ) );
|
||||
add_option( 'WPLANG', get_network_option( 'WPLANG' ) );
|
||||
update_option( 'blog_public', (int) $meta['public'] );
|
||||
|
||||
if ( ! is_super_admin( $user_id ) && ! get_user_meta( $user_id, 'primary_blog', true ) )
|
||||
@@ -1171,10 +1171,10 @@ function wpmu_create_blog( $domain, $path, $title, $user_id, $meta = array(), $s
|
||||
* @return bool
|
||||
*/
|
||||
function newblog_notify_siteadmin( $blog_id, $deprecated = '' ) {
|
||||
if ( get_site_option( 'registrationnotification' ) != 'yes' )
|
||||
if ( get_network_option( 'registrationnotification' ) != 'yes' )
|
||||
return false;
|
||||
|
||||
$email = get_site_option( 'admin_email' );
|
||||
$email = get_network_option( 'admin_email' );
|
||||
if ( is_email($email) == false )
|
||||
return false;
|
||||
|
||||
@@ -1216,10 +1216,10 @@ Disable these notifications: %4$s' ), $blogname, $siteurl, wp_unslash( $_SERVER[
|
||||
* @return bool
|
||||
*/
|
||||
function newuser_notify_siteadmin( $user_id ) {
|
||||
if ( get_site_option( 'registrationnotification' ) != 'yes' )
|
||||
if ( get_network_option( 'registrationnotification' ) != 'yes' )
|
||||
return false;
|
||||
|
||||
$email = get_site_option( 'admin_email' );
|
||||
$email = get_network_option( 'admin_email' );
|
||||
|
||||
if ( is_email($email) == false )
|
||||
return false;
|
||||
@@ -1355,7 +1355,7 @@ function install_blog( $blog_id, $blog_title = '' ) {
|
||||
update_option( 'siteurl', $url );
|
||||
update_option( 'home', $url );
|
||||
|
||||
if ( get_site_option( 'ms_files_rewriting' ) )
|
||||
if ( get_network_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' ) );
|
||||
@@ -1431,7 +1431,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_site_option( 'welcome_email' );
|
||||
$welcome_email = get_network_option( 'welcome_email' );
|
||||
if ( $welcome_email == false ) {
|
||||
/* translators: Do not translate USERNAME, SITE_NAME, BLOG_URL, PASSWORD: those are placeholders. */
|
||||
$welcome_email = __( 'Howdy USERNAME,
|
||||
@@ -1474,12 +1474,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_site_option( 'admin_email' );
|
||||
$admin_email = get_network_option( 'admin_email' );
|
||||
|
||||
if ( $admin_email == '' )
|
||||
$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
|
||||
|
||||
$from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
|
||||
$from_name = get_network_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_network_option( 'site_name' ) );
|
||||
$message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
|
||||
$message = $welcome_email;
|
||||
|
||||
@@ -1530,7 +1530,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_site_option( 'welcome_user_email' );
|
||||
$welcome_email = get_network_option( 'welcome_user_email' );
|
||||
|
||||
$user = get_userdata( $user_id );
|
||||
|
||||
@@ -1552,12 +1552,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_site_option( 'admin_email' );
|
||||
$admin_email = get_network_option( 'admin_email' );
|
||||
|
||||
if ( $admin_email == '' )
|
||||
$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
|
||||
|
||||
$from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
|
||||
$from_name = get_network_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_network_option( 'site_name' ) );
|
||||
$message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
|
||||
$message = $welcome_email;
|
||||
|
||||
@@ -1729,7 +1729,7 @@ function recurse_dirsize( $directory, $exclude = null ) {
|
||||
* @return array
|
||||
*/
|
||||
function check_upload_mimes( $mimes ) {
|
||||
$site_exts = explode( ' ', get_site_option( 'upload_filetypes', 'jpg jpeg png gif' ) );
|
||||
$site_exts = explode( ' ', get_network_option( 'upload_filetypes', 'jpg jpeg png gif' ) );
|
||||
$site_mimes = array();
|
||||
foreach ( $site_exts as $ext ) {
|
||||
foreach ( $mimes as $ext_pattern => $mime ) {
|
||||
@@ -1870,11 +1870,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_site_option( 'upload_space_check_disabled' ) )
|
||||
if ( ! is_array( $upload ) || defined( 'WP_IMPORTING' ) || get_network_option( 'upload_space_check_disabled' ) )
|
||||
return $upload;
|
||||
|
||||
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 ));
|
||||
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 ) );
|
||||
|
||||
return $upload;
|
||||
}
|
||||
@@ -2087,7 +2087,7 @@ function is_user_option_local( $key, $user_id = 0, $blog_id = 0 ) {
|
||||
* @return bool
|
||||
*/
|
||||
function users_can_register_signup_filter() {
|
||||
$registration = get_site_option('registration');
|
||||
$registration = get_network_option( 'registration' );
|
||||
return ( $registration == 'all' || $registration == 'user' );
|
||||
}
|
||||
|
||||
@@ -2116,7 +2116,7 @@ LOGINLINK
|
||||
Thanks!
|
||||
|
||||
--The Team @ SITE_NAME' );
|
||||
update_site_option( 'welcome_user_email', $text );
|
||||
update_network_option( 'welcome_user_email', $text );
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
@@ -2242,7 +2242,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_site_option( 'blog_count', $count );
|
||||
update_network_option( 'blog_count', $count );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2256,7 +2256,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_site_option( 'user_count', $count );
|
||||
update_network_option( 'user_count', $count );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2294,7 +2294,7 @@ function get_space_allowed() {
|
||||
$space_allowed = get_option( 'blog_upload_space' );
|
||||
|
||||
if ( ! is_numeric( $space_allowed ) )
|
||||
$space_allowed = get_site_option( 'blog_upload_space' );
|
||||
$space_allowed = get_network_option( 'blog_upload_space' );
|
||||
|
||||
if ( empty( $space_allowed ) || ! is_numeric( $space_allowed ) )
|
||||
$space_allowed = 100;
|
||||
@@ -2322,7 +2322,7 @@ function get_upload_space_available() {
|
||||
$allowed = 0;
|
||||
}
|
||||
$space_allowed = $allowed * 1024 * 1024;
|
||||
if ( get_site_option( 'upload_space_check_disabled' ) )
|
||||
if ( get_network_option( 'upload_space_check_disabled' ) )
|
||||
return $space_allowed;
|
||||
|
||||
$space_used = get_space_used() * 1024 * 1024;
|
||||
@@ -2340,7 +2340,7 @@ function get_upload_space_available() {
|
||||
* @return bool True if space is available, false otherwise.
|
||||
*/
|
||||
function is_upload_space_available() {
|
||||
if ( get_site_option( 'upload_space_check_disabled' ) )
|
||||
if ( get_network_option( 'upload_space_check_disabled' ) )
|
||||
return true;
|
||||
|
||||
return (bool) get_upload_space_available();
|
||||
@@ -2352,8 +2352,8 @@ function is_upload_space_available() {
|
||||
* @return int of upload size limit in bytes
|
||||
*/
|
||||
function upload_size_limit_filter( $size ) {
|
||||
$fileupload_maxk = 1024 * get_site_option( 'fileupload_maxk', 1500 );
|
||||
if ( get_site_option( 'upload_space_check_disabled' ) )
|
||||
$fileupload_maxk = 1024 * get_network_option( 'fileupload_maxk', 1500 );
|
||||
if ( get_network_option( 'upload_space_check_disabled' ) )
|
||||
return min( $size, $fileupload_maxk );
|
||||
|
||||
return min( $size, $fileupload_maxk, get_upload_space_available() );
|
||||
|
||||
@@ -34,7 +34,7 @@ function is_subdomain_install() {
|
||||
* @return array Files to include.
|
||||
*/
|
||||
function wp_get_active_network_plugins() {
|
||||
$active_plugins = (array) get_site_option( 'active_sitewide_plugins', array() );
|
||||
$active_plugins = (array) get_network_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_site_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_network_option( 'admin_email', 'support@' . get_current_site()->domain ) ) ) );
|
||||
}
|
||||
|
||||
if ( $blog->archived == '1' || $blog->spam == '1' ) {
|
||||
|
||||
@@ -222,7 +222,7 @@ if ( ! $current_site instanceof WP_Network ) {
|
||||
}
|
||||
|
||||
if ( empty( $current_site->site_name ) ) {
|
||||
$current_site->site_name = get_site_option( 'site_name' );
|
||||
$current_site->site_name = get_network_option( 'site_name' );
|
||||
if ( ! $current_site->site_name ) {
|
||||
$current_site->site_name = ucfirst( $current_site->domain );
|
||||
}
|
||||
|
||||
+13
-13
@@ -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' );
|
||||
@@ -1466,9 +1466,9 @@ function delete_site_transient( $transient ) {
|
||||
} else {
|
||||
$option_timeout = '_site_transient_timeout_' . $transient;
|
||||
$option = '_site_transient_' . $transient;
|
||||
$result = delete_site_option( $option );
|
||||
$result = delete_network_option( $option );
|
||||
if ( $result )
|
||||
delete_site_option( $option_timeout );
|
||||
delete_network_option( $option_timeout );
|
||||
}
|
||||
if ( $result ) {
|
||||
|
||||
@@ -1529,16 +1529,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_site_option( $transient_timeout );
|
||||
$timeout = get_network_option( $transient_timeout );
|
||||
if ( false !== $timeout && $timeout < time() ) {
|
||||
delete_site_option( $transient_option );
|
||||
delete_site_option( $transient_timeout );
|
||||
delete_network_option( $transient_option );
|
||||
delete_network_option( $transient_timeout );
|
||||
$value = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! isset( $value ) )
|
||||
$value = get_site_option( $transient_option );
|
||||
$value = get_network_option( $transient_option );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1593,14 +1593,14 @@ function set_site_transient( $transient, $value, $expiration = 0 ) {
|
||||
} else {
|
||||
$transient_timeout = '_site_transient_timeout_' . $transient;
|
||||
$option = '_site_transient_' . $transient;
|
||||
if ( false === get_site_option( $option ) ) {
|
||||
if ( false === get_network_option( $option ) ) {
|
||||
if ( $expiration )
|
||||
add_site_option( $transient_timeout, time() + $expiration );
|
||||
$result = add_site_option( $option, $value );
|
||||
add_network_option( $transient_timeout, time() + $expiration );
|
||||
$result = add_network_option( $option, $value );
|
||||
} else {
|
||||
if ( $expiration )
|
||||
update_site_option( $transient_timeout, time() + $expiration );
|
||||
$result = update_site_option( $option, $value );
|
||||
update_network_option( $transient_timeout, time() + $expiration );
|
||||
$result = update_network_option( $option, $value );
|
||||
}
|
||||
}
|
||||
if ( $result ) {
|
||||
@@ -1631,4 +1631,4 @@ function set_site_transient( $transient, $value, $expiration = 0 ) {
|
||||
do_action( 'setted_site_transient', $transient, $value, $expiration );
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -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_site_option( "{$scheme}_{$type}" );
|
||||
$values[ $type ] = get_network_option( "{$scheme}_{$type}" );
|
||||
if ( ! $values[ $type ] ) {
|
||||
$values[ $type ] = wp_generate_password( 64, true, true );
|
||||
update_site_option( "{$scheme}_{$type}", $values[ $type ] );
|
||||
update_network_option( "{$scheme}_{$type}", $values[ $type ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ( ! $values['key'] ) {
|
||||
$values['key'] = get_site_option( 'secret_key' );
|
||||
$values['key'] = get_network_option( 'secret_key' );
|
||||
if ( ! $values['key'] ) {
|
||||
$values['key'] = wp_generate_password( 64, true, true );
|
||||
update_site_option( 'secret_key', $values['key'] );
|
||||
update_network_option( 'secret_key', $values['key'] );
|
||||
}
|
||||
}
|
||||
$values['salt'] = hash_hmac( 'md5', $scheme, $values['key'] );
|
||||
|
||||
@@ -1161,13 +1161,13 @@ function script_concat_settings() {
|
||||
|
||||
if ( ! isset($compress_scripts) ) {
|
||||
$compress_scripts = defined('COMPRESS_SCRIPTS') ? COMPRESS_SCRIPTS : true;
|
||||
if ( $compress_scripts && ( ! get_site_option('can_compress_scripts') || $compressed_output ) )
|
||||
if ( $compress_scripts && ( ! get_network_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_site_option('can_compress_scripts') || $compressed_output ) )
|
||||
if ( $compress_css && ( ! get_network_option( 'can_compress_scripts' ) || $compressed_output ) )
|
||||
$compress_css = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1809,7 +1809,7 @@ function _get_additional_user_keys( $user ) {
|
||||
*/
|
||||
function wp_get_user_contact_methods( $user = null ) {
|
||||
$methods = array();
|
||||
if ( get_site_option( 'initial_db_version' ) < 23588 ) {
|
||||
if ( get_network_option( 'initial_db_version' ) < 23588 ) {
|
||||
$methods = array(
|
||||
'aim' => __( 'AIM' ),
|
||||
'yim' => __( 'Yahoo IM' ),
|
||||
|
||||
Reference in New Issue
Block a user