-
diff --git a/wp-admin/admin-footer.php b/wp-admin/admin-footer.php
index a99eaba..aa82fa0 100644
|
a
|
b
|
do_action( 'admin_print_footer_scripts' ); |
| 86 | 86 | */ |
| 87 | 87 | do_action( "admin_footer-" . $GLOBALS['hook_suffix'] ); |
| 88 | 88 | |
| 89 | | // get_site_option() won't exist when auto upgrading from <= 2.7 |
| 90 | | if ( function_exists('get_site_option') ) { |
| 91 | | if ( false === get_site_option('can_compress_scripts') ) |
| | 89 | // get_network_option() won't exist when auto upgrading from <= 2.7 |
| | 90 | if ( function_exists( 'get_network_option' ) ) { |
| | 91 | if ( false === get_network_option('can_compress_scripts') ) |
| 92 | 92 | compression_test(); |
| 93 | 93 | } |
| 94 | 94 | |
-
diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php
index fc8bed3..b57304d 100644
|
a
|
b
|
function wp_ajax_wp_compression_test() { |
| 165 | 165 | wp_die( -1 ); |
| 166 | 166 | |
| 167 | 167 | if ( ini_get('zlib.output_compression') || 'ob_gzhandler' == ini_get('output_handler') ) { |
| 168 | | update_site_option('can_compress_scripts', 0); |
| | 168 | update_network_option('can_compress_scripts', 0); |
| 169 | 169 | wp_die( 0 ); |
| 170 | 170 | } |
| 171 | 171 | |
| … |
… |
function wp_ajax_wp_compression_test() { |
| 196 | 196 | echo $out; |
| 197 | 197 | wp_die(); |
| 198 | 198 | } elseif ( 'no' == $_GET['test'] ) { |
| 199 | | update_site_option('can_compress_scripts', 0); |
| | 199 | update_network_option('can_compress_scripts', 0); |
| 200 | 200 | } elseif ( 'yes' == $_GET['test'] ) { |
| 201 | | update_site_option('can_compress_scripts', 1); |
| | 201 | update_network_option('can_compress_scripts', 1); |
| 202 | 202 | } |
| 203 | 203 | } |
| 204 | 204 | |
-
diff --git a/wp-admin/includes/class-wp-themes-list-table.php b/wp-admin/includes/class-wp-themes-list-table.php
index e01e3d4..66b98e8 100644
|
a
|
b
|
class WP_Themes_List_Table extends WP_List_Table { |
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | // Fallthrough. |
| 105 | | printf( __( 'Only the current theme is available to you. Contact the %s administrator for information about accessing additional themes.' ), get_site_option( 'site_name' ) ); |
| | 105 | printf( __( 'Only the current theme is available to you. Contact the %s administrator for information about accessing additional themes.' ), get_network_option( 'site_name' ) ); |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | /** |
-
diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php
index 91966a7..c4a809c 100644
|
a
|
b
|
class Core_Upgrader extends WP_Upgrader { |
| 2345 | 2345 | if ( version_compare( $wp_version, $offered_ver, '>' ) ) |
| 2346 | 2346 | return false; |
| 2347 | 2347 | |
| 2348 | | $failure_data = get_site_option( 'auto_core_update_failed' ); |
| | 2348 | $failure_data = get_network_option( 'auto_core_update_failed' ); |
| 2349 | 2349 | if ( $failure_data ) { |
| 2350 | 2350 | // If this was a critical update failure, cannot update. |
| 2351 | 2351 | if ( ! empty( $failure_data['critical'] ) ) |
| … |
… |
class WP_Automatic_Updater { |
| 2758 | 2758 | * @param object $item The update offer. |
| 2759 | 2759 | */ |
| 2760 | 2760 | protected function send_core_update_notification_email( $item ) { |
| 2761 | | $notified = get_site_option( 'auto_core_update_notified' ); |
| | 2761 | $notified = get_network_option( 'auto_core_update_notified' ); |
| 2762 | 2762 | |
| 2763 | 2763 | // Don't notify if we've already notified the same email address of the same version. |
| 2764 | | if ( $notified && $notified['email'] == get_site_option( 'admin_email' ) && $notified['version'] == $item->current ) |
| | 2764 | if ( $notified && $notified['email'] == get_network_option( 'admin_email' ) && $notified['version'] == $item->current ) |
| 2765 | 2765 | return false; |
| 2766 | 2766 | |
| 2767 | 2767 | // See if we need to notify users of a core update. |
| … |
… |
class WP_Automatic_Updater { |
| 3086 | 3086 | $critical_data['rollback_code'] = $rollback_result->get_error_code(); |
| 3087 | 3087 | $critical_data['rollback_data'] = $rollback_result->get_error_data(); |
| 3088 | 3088 | } |
| 3089 | | update_site_option( 'auto_core_update_failed', $critical_data ); |
| | 3089 | update_network_option( 'auto_core_update_failed', $critical_data ); |
| 3090 | 3090 | $this->send_email( 'critical', $core_update, $result ); |
| 3091 | 3091 | return; |
| 3092 | 3092 | } |
| … |
… |
class WP_Automatic_Updater { |
| 3104 | 3104 | */ |
| 3105 | 3105 | $send = true; |
| 3106 | 3106 | $transient_failures = array( 'incompatible_archive', 'download_failed', 'insane_distro' ); |
| 3107 | | if ( in_array( $error_code, $transient_failures ) && ! get_site_option( 'auto_core_update_failed' ) ) { |
| | 3107 | if ( in_array( $error_code, $transient_failures ) && ! get_network_option( 'auto_core_update_failed' ) ) { |
| 3108 | 3108 | wp_schedule_single_event( time() + HOUR_IN_SECONDS, 'wp_maybe_auto_update' ); |
| 3109 | 3109 | $send = false; |
| 3110 | 3110 | } |
| 3111 | 3111 | |
| 3112 | | $n = get_site_option( 'auto_core_update_notified' ); |
| | 3112 | $n = get_network_option( 'auto_core_update_notified' ); |
| 3113 | 3113 | // Don't notify if we've already notified the same email address of the same version of the same notification type. |
| 3114 | | if ( $n && 'fail' == $n['type'] && $n['email'] == get_site_option( 'admin_email' ) && $n['version'] == $core_update->current ) |
| | 3114 | if ( $n && 'fail' == $n['type'] && $n['email'] == get_network_option( 'admin_email' ) && $n['version'] == $core_update->current ) |
| 3115 | 3115 | $send = false; |
| 3116 | 3116 | |
| 3117 | | update_site_option( 'auto_core_update_failed', array( |
| | 3117 | update_network_option( 'auto_core_update_failed', array( |
| 3118 | 3118 | 'attempted' => $core_update->current, |
| 3119 | 3119 | 'current' => $wp_version, |
| 3120 | 3120 | 'error_code' => $error_code, |
| … |
… |
class WP_Automatic_Updater { |
| 3140 | 3140 | * @param mixed $result Optional. The result for the core update. Can be WP_Error. |
| 3141 | 3141 | */ |
| 3142 | 3142 | protected function send_email( $type, $core_update, $result = null ) { |
| 3143 | | update_site_option( 'auto_core_update_notified', array( |
| | 3143 | update_network_option( 'auto_core_update_notified', array( |
| 3144 | 3144 | 'type' => $type, |
| 3145 | | 'email' => get_site_option( 'admin_email' ), |
| | 3145 | 'email' => get_network_option( 'admin_email' ), |
| 3146 | 3146 | 'version' => $core_update->current, |
| 3147 | 3147 | 'timestamp' => time(), |
| 3148 | 3148 | ) ); |
| … |
… |
class WP_Automatic_Updater { |
| 3298 | 3298 | $body .= "\n"; |
| 3299 | 3299 | } |
| 3300 | 3300 | |
| 3301 | | $to = get_site_option( 'admin_email' ); |
| | 3301 | $to = get_network_option( 'admin_email' ); |
| 3302 | 3302 | $headers = ''; |
| 3303 | 3303 | |
| 3304 | 3304 | $email = compact( 'to', 'subject', 'body', 'headers' ); |
| … |
… |
Thanks! -- The WordPress Team" ) ); |
| 3450 | 3450 | } |
| 3451 | 3451 | |
| 3452 | 3452 | $email = array( |
| 3453 | | 'to' => get_site_option( 'admin_email' ), |
| | 3453 | 'to' => get_network_option( 'admin_email' ), |
| 3454 | 3454 | 'subject' => $subject, |
| 3455 | 3455 | 'body' => implode( "\n", $body ), |
| 3456 | 3456 | 'headers' => '' |
-
diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php
index 2d10b06..c70d768 100644
|
a
|
b
|
function wp_dashboard_plugins_output( $rss, $args = array() ) { |
| 1193 | 1193 | * @return bool|null True if not multisite, user can't upload files, or the space check option is disabled. |
| 1194 | 1194 | */ |
| 1195 | 1195 | function wp_dashboard_quota() { |
| 1196 | | if ( !is_multisite() || !current_user_can( 'upload_files' ) || get_site_option( 'upload_space_check_disabled' ) ) |
| | 1196 | if ( !is_multisite() || !current_user_can( 'upload_files' ) || get_network_option( 'upload_space_check_disabled' ) ) |
| 1197 | 1197 | return true; |
| 1198 | 1198 | |
| 1199 | 1199 | $quota = get_space_allowed(); |
-
diff --git a/wp-admin/includes/ms.php b/wp-admin/includes/ms.php
index 2907d24..0062a16 100644
|
a
|
b
|
|
| 16 | 16 | * @return array $_FILES array with 'error' key set if file exceeds quota. 'error' is empty otherwise. |
| 17 | 17 | */ |
| 18 | 18 | function check_upload_size( $file ) { |
| 19 | | if ( get_site_option( 'upload_space_check_disabled' ) ) |
| | 19 | if ( get_network_option( 'upload_space_check_disabled' ) ) |
| 20 | 20 | return $file; |
| 21 | 21 | |
| 22 | 22 | if ( $file['error'] != '0' ) // there's already an error |
| … |
… |
function check_upload_size( $file ) { |
| 30 | 30 | $file_size = filesize( $file['tmp_name'] ); |
| 31 | 31 | if ( $space_left < $file_size ) |
| 32 | 32 | $file['error'] = sprintf( __( 'Not enough space to upload. %1$s KB needed.' ), number_format( ($file_size - $space_left) /1024 ) ); |
| 33 | | if ( $file_size > ( 1024 * get_site_option( 'fileupload_maxk', 1500 ) ) ) |
| 34 | | $file['error'] = sprintf(__('This file is too big. Files must be less than %1$s KB in size.'), get_site_option( 'fileupload_maxk', 1500 ) ); |
| | 33 | if ( $file_size > ( 1024 * get_network_option( 'fileupload_maxk', 1500 ) ) ) |
| | 34 | $file['error'] = sprintf(__('This file is too big. Files must be less than %1$s KB in size.'), get_network_option( 'fileupload_maxk', 1500 ) ); |
| 35 | 35 | if ( upload_is_user_over_quota( false ) ) { |
| 36 | 36 | $file['error'] = __( 'You have used your space quota. Please delete files before uploading.' ); |
| 37 | 37 | } |
| … |
… |
function wpmu_delete_blog( $blog_id, $drop = false ) { |
| 98 | 98 | $upload_path = trim( get_option( 'upload_path' ) ); |
| 99 | 99 | |
| 100 | 100 | // If ms_files_rewriting is enabled and upload_path is empty, wp_upload_dir is not reliable. |
| 101 | | if ( $drop && get_site_option( 'ms_files_rewriting' ) && empty( $upload_path ) ) { |
| | 101 | if ( $drop && get_network_option( 'ms_files_rewriting' ) && empty( $upload_path ) ) { |
| 102 | 102 | $drop = false; |
| 103 | 103 | } |
| 104 | 104 | |
| … |
… |
All at ###SITENAME### |
| 306 | 306 | $content = str_replace( '###USERNAME###', $current_user->user_login, $content ); |
| 307 | 307 | $content = str_replace( '###ADMIN_URL###', esc_url( admin_url( 'options.php?adminhash='.$hash ) ), $content ); |
| 308 | 308 | $content = str_replace( '###EMAIL###', $value, $content ); |
| 309 | | $content = str_replace( '###SITENAME###', get_site_option( 'site_name' ), $content ); |
| | 309 | $content = str_replace( '###SITENAME###', get_network_option( 'site_name' ), $content ); |
| 310 | 310 | $content = str_replace( '###SITEURL###', network_home_url(), $content ); |
| 311 | 311 | |
| 312 | 312 | wp_mail( $value, sprintf( __( '[%s] New Admin Email Address' ), wp_specialchars_decode( get_option( 'blogname' ) ) ), $content ); |
| … |
… |
All at ###SITENAME### |
| 385 | 385 | $content = str_replace( '###USERNAME###', $current_user->user_login, $content ); |
| 386 | 386 | $content = str_replace( '###ADMIN_URL###', esc_url( admin_url( 'profile.php?newuseremail='.$hash ) ), $content ); |
| 387 | 387 | $content = str_replace( '###EMAIL###', $_POST['email'], $content); |
| 388 | | $content = str_replace( '###SITENAME###', get_site_option( 'site_name' ), $content ); |
| | 388 | $content = str_replace( '###SITENAME###', get_network_option( 'site_name' ), $content ); |
| 389 | 389 | $content = str_replace( '###SITEURL###', network_home_url(), $content ); |
| 390 | 390 | |
| 391 | 391 | wp_mail( $_POST['email'], sprintf( __( '[%s] New Email Address' ), wp_specialchars_decode( get_option( 'blogname' ) ) ), $content ); |
| … |
… |
function new_user_email_admin_notice() { |
| 413 | 413 | * @return bool True if user is over upload space quota, otherwise false. |
| 414 | 414 | */ |
| 415 | 415 | function upload_is_user_over_quota( $echo = true ) { |
| 416 | | if ( get_site_option( 'upload_space_check_disabled' ) ) |
| | 416 | if ( get_network_option( 'upload_space_check_disabled' ) ) |
| 417 | 417 | return false; |
| 418 | 418 | |
| 419 | 419 | $space_allowed = get_space_allowed(); |
| … |
… |
function site_admin_notice() { |
| 746 | 746 | global $wp_db_version; |
| 747 | 747 | if ( !is_super_admin() ) |
| 748 | 748 | return false; |
| 749 | | if ( get_site_option( 'wpmu_upgrade_site' ) != $wp_db_version ) |
| | 749 | if ( get_network_option( 'wpmu_upgrade_site' ) != $wp_db_version ) |
| 750 | 750 | 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>"; |
| 751 | 751 | } |
| 752 | 752 | |
| … |
… |
function choose_primary_blog() { |
| 828 | 828 | ?> |
| 829 | 829 | </td> |
| 830 | 830 | </tr> |
| 831 | | <?php if ( in_array( get_site_option( 'registration' ), array( 'all', 'blog' ) ) ) : ?> |
| | 831 | <?php if ( in_array( get_network_option( 'registration' ), array( 'all', 'blog' ) ) ) : ?> |
| 832 | 832 | <tr> |
| 833 | 833 | <th scope="row" colspan="2" class="th-full"> |
| 834 | 834 | <?php |
| … |
… |
function grant_super_admin( $user_id ) { |
| 870 | 870 | do_action( 'grant_super_admin', $user_id ); |
| 871 | 871 | |
| 872 | 872 | // Directly fetch site_admins instead of using get_super_admins() |
| 873 | | $super_admins = get_site_option( 'site_admins', array( 'admin' ) ); |
| | 873 | $super_admins = get_network_option( 'site_admins', array( 'admin' ) ); |
| 874 | 874 | |
| 875 | 875 | $user = get_userdata( $user_id ); |
| 876 | 876 | if ( $user && ! in_array( $user->user_login, $super_admins ) ) { |
| 877 | 877 | $super_admins[] = $user->user_login; |
| 878 | | update_site_option( 'site_admins' , $super_admins ); |
| | 878 | update_network_option( 'site_admins' , $super_admins ); |
| 879 | 879 | |
| 880 | 880 | /** |
| 881 | 881 | * Fires after the user is granted Super Admin privileges. |
| … |
… |
function revoke_super_admin( $user_id ) { |
| 917 | 917 | do_action( 'revoke_super_admin', $user_id ); |
| 918 | 918 | |
| 919 | 919 | // Directly fetch site_admins instead of using get_super_admins() |
| 920 | | $super_admins = get_site_option( 'site_admins', array( 'admin' ) ); |
| | 920 | $super_admins = get_network_option( 'site_admins', array( 'admin' ) ); |
| 921 | 921 | |
| 922 | 922 | $user = get_userdata( $user_id ); |
| 923 | | if ( $user && 0 !== strcasecmp( $user->user_email, get_site_option( 'admin_email' ) ) ) { |
| | 923 | if ( $user && 0 !== strcasecmp( $user->user_email, get_network_option( 'admin_email' ) ) ) { |
| 924 | 924 | if ( false !== ( $key = array_search( $user->user_login, $super_admins ) ) ) { |
| 925 | 925 | unset( $super_admins[$key] ); |
| 926 | | update_site_option( 'site_admins', $super_admins ); |
| | 926 | update_network_option( 'site_admins', $super_admins ); |
| 927 | 927 | |
| 928 | 928 | /** |
| 929 | 929 | * Fires after the user's Super Admin privileges are revoked. |
-
diff --git a/wp-admin/includes/network.php b/wp-admin/includes/network.php
index 1300449..9d41fdd 100644
|
a
|
b
|
define('BLOG_ID_CURRENT_SITE', 1); |
| 404 | 404 | <match url="^index\.php$" ignoreCase="false" /> |
| 405 | 405 | <action type="None" /> |
| 406 | 406 | </rule>'; |
| 407 | | if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) { |
| | 407 | if ( is_multisite() && get_network_option( 'ms_files_rewriting' ) ) { |
| 408 | 408 | $web_config_file .= ' |
| 409 | 409 | <rule name="WordPress Rule for Files" stopProcessing="true"> |
| 410 | 410 | <match url="^' . $iis_subdir_match . 'files/(.+)" ignoreCase="false" /> |
| … |
… |
define('BLOG_ID_CURRENT_SITE', 1); |
| 457 | 457 | <?php else : // end iis7_supports_permalinks(). construct an htaccess file instead: |
| 458 | 458 | |
| 459 | 459 | $ms_files_rewriting = ''; |
| 460 | | if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) { |
| | 460 | if ( is_multisite() && get_network_option( 'ms_files_rewriting' ) ) { |
| 461 | 461 | $ms_files_rewriting = "\n# uploaded files\nRewriteRule ^"; |
| 462 | 462 | $ms_files_rewriting .= $subdir_match . "files/(.+) {$rewrite_base}" . WPINC . "/ms-files.php?file={$subdir_replacement_12} [L]" . "\n"; |
| 463 | 463 | } |
-
diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php
index e5739be..dfb7922 100644
|
a
|
b
|
function is_plugin_active_for_network( $plugin ) { |
| 465 | 465 | if ( !is_multisite() ) |
| 466 | 466 | return false; |
| 467 | 467 | |
| 468 | | $plugins = get_site_option( 'active_sitewide_plugins'); |
| | 468 | $plugins = get_network_option( 'active_sitewide_plugins'); |
| 469 | 469 | if ( isset($plugins[$plugin]) ) |
| 470 | 470 | return true; |
| 471 | 471 | |
| … |
… |
function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silen |
| 523 | 523 | |
| 524 | 524 | if ( is_multisite() && ( $network_wide || is_network_only_plugin($plugin) ) ) { |
| 525 | 525 | $network_wide = true; |
| 526 | | $current = get_site_option( 'active_sitewide_plugins', array() ); |
| | 526 | $current = get_network_option( 'active_sitewide_plugins', array() ); |
| 527 | 527 | $_GET['networkwide'] = 1; // Back compat for plugins looking for this value. |
| 528 | 528 | } else { |
| 529 | 529 | $current = get_option( 'active_plugins', array() ); |
| … |
… |
function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silen |
| 576 | 576 | } |
| 577 | 577 | |
| 578 | 578 | if ( $network_wide ) { |
| 579 | | $current = get_site_option( 'active_sitewide_plugins', array() ); |
| | 579 | $current = get_network_option( 'active_sitewide_plugins', array() ); |
| 580 | 580 | $current[$plugin] = time(); |
| 581 | | update_site_option( 'active_sitewide_plugins', $current ); |
| | 581 | update_network_option( 'active_sitewide_plugins', $current ); |
| 582 | 582 | } else { |
| 583 | 583 | $current = get_option( 'active_plugins', array() ); |
| 584 | 584 | $current[] = $plugin; |
| … |
… |
function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silen |
| 627 | 627 | */ |
| 628 | 628 | function deactivate_plugins( $plugins, $silent = false, $network_wide = null ) { |
| 629 | 629 | if ( is_multisite() ) |
| 630 | | $network_current = get_site_option( 'active_sitewide_plugins', array() ); |
| | 630 | $network_current = get_network_option( 'active_sitewide_plugins', array() ); |
| 631 | 631 | $current = get_option( 'active_plugins', array() ); |
| 632 | 632 | $do_blog = $do_network = false; |
| 633 | 633 | |
| … |
… |
function deactivate_plugins( $plugins, $silent = false, $network_wide = null ) { |
| 708 | 708 | if ( $do_blog ) |
| 709 | 709 | update_option('active_plugins', $current); |
| 710 | 710 | if ( $do_network ) |
| 711 | | update_site_option( 'active_sitewide_plugins', $network_current ); |
| | 711 | update_network_option( 'active_sitewide_plugins', $network_current ); |
| 712 | 712 | } |
| 713 | 713 | |
| 714 | 714 | /** |
| … |
… |
function validate_active_plugins() { |
| 880 | 880 | } |
| 881 | 881 | |
| 882 | 882 | if ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) { |
| 883 | | $network_plugins = (array) get_site_option( 'active_sitewide_plugins', array() ); |
| | 883 | $network_plugins = (array) get_network_option( 'active_sitewide_plugins', array() ); |
| 884 | 884 | $plugins = array_merge( $plugins, array_keys( $network_plugins ) ); |
| 885 | 885 | } |
| 886 | 886 | |
-
diff --git a/wp-admin/includes/schema.php b/wp-admin/includes/schema.php
index 4eb6bca..d4b8cf2 100644
|
a
|
b
|
function populate_network( $network_id = 1, $domain = '', $email = '', $site_nam |
| 928 | 928 | } |
| 929 | 929 | } |
| 930 | 930 | } else { |
| 931 | | $site_admins = get_site_option( 'site_admins' ); |
| | 931 | $site_admins = get_network_option( 'site_admins' ); |
| 932 | 932 | } |
| 933 | 933 | |
| 934 | 934 | /* translators: Do not translate USERNAME, SITE_NAME, BLOG_URL, PASSWORD: those are placeholders. */ |
| … |
… |
We hope you enjoy your new site. Thanks! |
| 978 | 978 | // @todo - network admins should have a method of editing the network siteurl (used for cookie hash) |
| 979 | 979 | 'siteurl' => get_option( 'siteurl' ) . '/', |
| 980 | 980 | 'add_new_users' => '0', |
| 981 | | 'upload_space_check_disabled' => is_multisite() ? get_site_option( 'upload_space_check_disabled' ) : '1', |
| | 981 | 'upload_space_check_disabled' => is_multisite() ? get_network_option( 'upload_space_check_disabled' ) : '1', |
| 982 | 982 | 'subdomain_install' => intval( $subdomain_install ), |
| 983 | 983 | 'global_terms_enabled' => global_terms_enabled() ? '1' : '0', |
| 984 | | 'ms_files_rewriting' => is_multisite() ? get_site_option( 'ms_files_rewriting' ) : '0', |
| | 984 | 'ms_files_rewriting' => is_multisite() ? get_network_option( 'ms_files_rewriting' ) : '0', |
| 985 | 985 | 'initial_db_version' => get_option( 'initial_db_version' ), |
| 986 | 986 | 'active_sitewide_plugins' => array(), |
| 987 | 987 | 'WPLANG' => get_locale(), |
-
diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php
index ac1ac37..130c6de 100644
|
a
|
b
|
function update_core($from, $to) { |
| 1102 | 1102 | do_action( '_core_updated_successfully', $wp_version ); |
| 1103 | 1103 | |
| 1104 | 1104 | // Clear the option that blocks auto updates after failures, now that we've been successful. |
| 1105 | | if ( function_exists( 'delete_site_option' ) ) |
| 1106 | | delete_site_option( 'auto_core_update_failed' ); |
| | 1105 | if ( function_exists( 'delete_network_option' ) ) |
| | 1106 | delete_network_option( 'auto_core_update_failed' ); |
| 1107 | 1107 | |
| 1108 | 1108 | return $wp_version; |
| 1109 | 1109 | } |
-
diff --git a/wp-admin/includes/update.php b/wp-admin/includes/update.php
index e3f363c..c00aa45 100644
|
a
|
b
|
function get_preferred_from_update_core() { |
| 29 | 29 | */ |
| 30 | 30 | function get_core_updates( $options = array() ) { |
| 31 | 31 | $options = array_merge( array( 'available' => true, 'dismissed' => false ), $options ); |
| 32 | | $dismissed = get_site_option( 'dismissed_update_core' ); |
| | 32 | $dismissed = get_network_option( 'dismissed_update_core' ); |
| 33 | 33 | |
| 34 | 34 | if ( ! is_array( $dismissed ) ) |
| 35 | 35 | $dismissed = array(); |
| … |
… |
function get_core_checksums( $version, $locale ) { |
| 134 | 134 | * @return bool |
| 135 | 135 | */ |
| 136 | 136 | function dismiss_core_update( $update ) { |
| 137 | | $dismissed = get_site_option( 'dismissed_update_core' ); |
| | 137 | $dismissed = get_network_option( 'dismissed_update_core' ); |
| 138 | 138 | $dismissed[ $update->current . '|' . $update->locale ] = true; |
| 139 | | return update_site_option( 'dismissed_update_core', $dismissed ); |
| | 139 | return update_network_option( 'dismissed_update_core', $dismissed ); |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /** |
| … |
… |
function dismiss_core_update( $update ) { |
| 146 | 146 | * @return bool |
| 147 | 147 | */ |
| 148 | 148 | function undismiss_core_update( $version, $locale ) { |
| 149 | | $dismissed = get_site_option( 'dismissed_update_core' ); |
| | 149 | $dismissed = get_network_option( 'dismissed_update_core' ); |
| 150 | 150 | $key = $version . '|' . $locale; |
| 151 | 151 | |
| 152 | 152 | if ( ! isset( $dismissed[$key] ) ) |
| 153 | 153 | return false; |
| 154 | 154 | |
| 155 | 155 | unset( $dismissed[$key] ); |
| 156 | | return update_site_option( 'dismissed_update_core', $dismissed ); |
| | 156 | return update_network_option( 'dismissed_update_core', $dismissed ); |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | /** |
| … |
… |
function maintenance_nag() { |
| 478 | 478 | global $upgrading; |
| 479 | 479 | $nag = isset( $upgrading ); |
| 480 | 480 | if ( ! $nag ) { |
| 481 | | $failed = get_site_option( 'auto_core_update_failed' ); |
| | 481 | $failed = get_network_option( 'auto_core_update_failed' ); |
| 482 | 482 | /* |
| 483 | 483 | * If an update failed critically, we may have copied over version.php but not other files. |
| 484 | 484 | * In that case, if the install claims we're running the version we attempted, nag. |
-
diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php
index 967cfe3..724d979 100644
|
a
|
b
|
function wp_install_defaults( $user_id ) { |
| 153 | 153 | $first_post_guid = get_option( 'home' ) . '/?p=1'; |
| 154 | 154 | |
| 155 | 155 | if ( is_multisite() ) { |
| 156 | | $first_post = get_site_option( 'first_post' ); |
| | 156 | $first_post = get_network_option( 'first_post' ); |
| 157 | 157 | |
| 158 | 158 | if ( empty($first_post) ) |
| 159 | 159 | $first_post = __( 'Welcome to <a href="SITE_URL">SITE_NAME</a>. This is your first post. Edit or delete it, then start writing!' ); |
| … |
… |
function wp_install_defaults( $user_id ) { |
| 189 | 189 | $first_comment = __('Hi, this is a comment. |
| 190 | 190 | To delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.'); |
| 191 | 191 | if ( is_multisite() ) { |
| 192 | | $first_comment_author = get_site_option( 'first_comment_author', $first_comment_author ); |
| 193 | | $first_comment_url = get_site_option( 'first_comment_url', network_home_url() ); |
| 194 | | $first_comment = get_site_option( 'first_comment', $first_comment ); |
| | 192 | $first_comment_author = get_network_option( 'first_comment_author', $first_comment_author ); |
| | 193 | $first_comment_url = get_network_option( 'first_comment_url', network_home_url() ); |
| | 194 | $first_comment = get_network_option( 'first_comment', $first_comment ); |
| 195 | 195 | } |
| 196 | 196 | $wpdb->insert( $wpdb->comments, array( |
| 197 | 197 | 'comment_post_ID' => 1, |
| … |
… |
To delete a comment, just log in and view the post's comments. There you wi |
| 214 | 214 | |
| 215 | 215 | 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() ); |
| 216 | 216 | if ( is_multisite() ) |
| 217 | | $first_page = get_site_option( 'first_page', $first_page ); |
| | 217 | $first_page = get_network_option( 'first_page', $first_page ); |
| 218 | 218 | $first_post_guid = get_option('home') . '/?page_id=2'; |
| 219 | 219 | $wpdb->insert( $wpdb->posts, array( |
| 220 | 220 | 'post_author' => $user_id, |
| … |
… |
function upgrade_300() { |
| 1255 | 1255 | if ( $wp_current_db_version < 15093 ) |
| 1256 | 1256 | populate_roles_300(); |
| 1257 | 1257 | |
| 1258 | | if ( $wp_current_db_version < 14139 && is_multisite() && is_main_site() && ! defined( 'MULTISITE' ) && get_site_option( 'siteurl' ) === false ) |
| 1259 | | add_site_option( 'siteurl', '' ); |
| | 1258 | if ( $wp_current_db_version < 14139 && is_multisite() && is_main_site() && ! defined( 'MULTISITE' ) && get_network_option( 'siteurl' ) === false ) |
| | 1259 | add_network_option( 'siteurl', '' ); |
| 1260 | 1260 | |
| 1261 | 1261 | // 3.0 screen options key name changes. |
| 1262 | 1262 | if ( wp_should_upgrade_global_tables() ) { |
| … |
… |
function upgrade_network() { |
| 1643 | 1643 | |
| 1644 | 1644 | // 2.8. |
| 1645 | 1645 | if ( $wp_current_db_version < 11549 ) { |
| 1646 | | $wpmu_sitewide_plugins = get_site_option( 'wpmu_sitewide_plugins' ); |
| 1647 | | $active_sitewide_plugins = get_site_option( 'active_sitewide_plugins' ); |
| | 1646 | $wpmu_sitewide_plugins = get_network_option( 'wpmu_sitewide_plugins' ); |
| | 1647 | $active_sitewide_plugins = get_network_option( 'active_sitewide_plugins' ); |
| 1648 | 1648 | if ( $wpmu_sitewide_plugins ) { |
| 1649 | 1649 | if ( !$active_sitewide_plugins ) |
| 1650 | 1650 | $sitewide_plugins = (array) $wpmu_sitewide_plugins; |
| 1651 | 1651 | else |
| 1652 | 1652 | $sitewide_plugins = array_merge( (array) $active_sitewide_plugins, (array) $wpmu_sitewide_plugins ); |
| 1653 | 1653 | |
| 1654 | | update_site_option( 'active_sitewide_plugins', $sitewide_plugins ); |
| | 1654 | update_network_option( 'active_sitewide_plugins', $sitewide_plugins ); |
| 1655 | 1655 | } |
| 1656 | | delete_site_option( 'wpmu_sitewide_plugins' ); |
| 1657 | | delete_site_option( 'deactivated_sitewide_plugins' ); |
| | 1656 | delete_network_option( 'wpmu_sitewide_plugins' ); |
| | 1657 | delete_network_option( 'deactivated_sitewide_plugins' ); |
| 1658 | 1658 | |
| 1659 | 1659 | $start = 0; |
| 1660 | 1660 | while( $rows = $wpdb->get_results( "SELECT meta_key, meta_value FROM {$wpdb->sitemeta} ORDER BY meta_id LIMIT $start, 20" ) ) { |
| … |
… |
function upgrade_network() { |
| 1663 | 1663 | if ( !@unserialize( $value ) ) |
| 1664 | 1664 | $value = stripslashes( $value ); |
| 1665 | 1665 | if ( $value !== $row->meta_value ) { |
| 1666 | | update_site_option( $row->meta_key, $value ); |
| | 1666 | update_network_option( $row->meta_key, $value ); |
| 1667 | 1667 | } |
| 1668 | 1668 | } |
| 1669 | 1669 | $start += 20; |
| … |
… |
function upgrade_network() { |
| 1672 | 1672 | |
| 1673 | 1673 | // 3.0 |
| 1674 | 1674 | if ( $wp_current_db_version < 13576 ) |
| 1675 | | update_site_option( 'global_terms_enabled', '1' ); |
| | 1675 | update_network_option( 'global_terms_enabled', '1' ); |
| 1676 | 1676 | |
| 1677 | 1677 | // 3.3 |
| 1678 | 1678 | if ( $wp_current_db_version < 19390 ) |
| 1679 | | update_site_option( 'initial_db_version', $wp_current_db_version ); |
| | 1679 | update_network_option( 'initial_db_version', $wp_current_db_version ); |
| 1680 | 1680 | |
| 1681 | 1681 | if ( $wp_current_db_version < 19470 ) { |
| 1682 | | if ( false === get_site_option( 'active_sitewide_plugins' ) ) |
| 1683 | | update_site_option( 'active_sitewide_plugins', array() ); |
| | 1682 | if ( false === get_network_option( 'active_sitewide_plugins' ) ) |
| | 1683 | update_network_option( 'active_sitewide_plugins', array() ); |
| 1684 | 1684 | } |
| 1685 | 1685 | |
| 1686 | 1686 | // 3.4 |
| 1687 | 1687 | if ( $wp_current_db_version < 20148 ) { |
| 1688 | 1688 | // 'allowedthemes' keys things by stylesheet. 'allowed_themes' keyed things by name. |
| 1689 | | $allowedthemes = get_site_option( 'allowedthemes' ); |
| 1690 | | $allowed_themes = get_site_option( 'allowed_themes' ); |
| | 1689 | $allowedthemes = get_network_option( 'allowedthemes' ); |
| | 1690 | $allowed_themes = get_network_option( 'allowed_themes' ); |
| 1691 | 1691 | if ( false === $allowedthemes && is_array( $allowed_themes ) && $allowed_themes ) { |
| 1692 | 1692 | $converted = array(); |
| 1693 | 1693 | $themes = wp_get_themes(); |
| … |
… |
function upgrade_network() { |
| 1695 | 1695 | if ( isset( $allowed_themes[ $theme_data->get('Name') ] ) ) |
| 1696 | 1696 | $converted[ $stylesheet ] = true; |
| 1697 | 1697 | } |
| 1698 | | update_site_option( 'allowedthemes', $converted ); |
| 1699 | | delete_site_option( 'allowed_themes' ); |
| | 1698 | update_network_option( 'allowedthemes', $converted ); |
| | 1699 | delete_network_option( 'allowed_themes' ); |
| 1700 | 1700 | } |
| 1701 | 1701 | } |
| 1702 | 1702 | |
| 1703 | 1703 | // 3.5 |
| 1704 | 1704 | if ( $wp_current_db_version < 21823 ) |
| 1705 | | update_site_option( 'ms_files_rewriting', '1' ); |
| | 1705 | update_network_option( 'ms_files_rewriting', '1' ); |
| 1706 | 1706 | |
| 1707 | 1707 | // 3.5.2 |
| 1708 | 1708 | if ( $wp_current_db_version < 24448 ) { |
| 1709 | | $illegal_names = get_site_option( 'illegal_names' ); |
| | 1709 | $illegal_names = get_network_option( 'illegal_names' ); |
| 1710 | 1710 | if ( is_array( $illegal_names ) && count( $illegal_names ) === 1 ) { |
| 1711 | 1711 | $illegal_name = reset( $illegal_names ); |
| 1712 | 1712 | $illegal_names = explode( ' ', $illegal_name ); |
| 1713 | | update_site_option( 'illegal_names', $illegal_names ); |
| | 1713 | update_network_option( 'illegal_names', $illegal_names ); |
| 1714 | 1714 | } |
| 1715 | 1715 | } |
| 1716 | 1716 | |
-
diff --git a/wp-admin/network/settings.php b/wp-admin/network/settings.php
index a7010e9..4b61059 100644
|
a
|
b
|
if ( $_POST ) { |
| 76 | 76 | if ( ! isset($_POST[$option_name]) ) |
| 77 | 77 | continue; |
| 78 | 78 | $value = wp_unslash( $_POST[$option_name] ); |
| 79 | | update_site_option( $option_name, $value ); |
| | 79 | update_network_option( $option_name, $value ); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
| … |
… |
if ( isset( $_GET['updated'] ) ) { |
| 113 | 113 | <tr> |
| 114 | 114 | <th scope="row"><label for="admin_email"><?php _e( 'Network Admin Email' ) ?></label></th> |
| 115 | 115 | <td> |
| 116 | | <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' ) ) ?>" /> |
| | 116 | <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' ) ) ?>" /> |
| 117 | 117 | <p class="description" id="admin-email-desc"> |
| 118 | 118 | <?php _e( 'This email address will receive notifications. Registration and support emails will also come from this address.' ); ?> |
| 119 | 119 | </p> |
| … |
… |
if ( isset( $_GET['updated'] ) ) { |
| 125 | 125 | <tr> |
| 126 | 126 | <th scope="row"><?php _e( 'Allow new registrations' ) ?></th> |
| 127 | 127 | <?php |
| 128 | | if ( !get_site_option( 'registration' ) ) |
| 129 | | update_site_option( 'registration', 'none' ); |
| 130 | | $reg = get_site_option( 'registration' ); |
| | 128 | if ( !get_network_option( 'registration' ) ) |
| | 129 | update_network_option( 'registration', 'none' ); |
| | 130 | $reg = get_network_option( 'registration' ); |
| 131 | 131 | ?> |
| 132 | 132 | <td> |
| 133 | 133 | <fieldset> |
| … |
… |
if ( isset( $_GET['updated'] ) ) { |
| 146 | 146 | <tr> |
| 147 | 147 | <th scope="row"><?php _e( 'Registration notification' ) ?></th> |
| 148 | 148 | <?php |
| 149 | | if ( !get_site_option( 'registrationnotification' ) ) |
| 150 | | update_site_option( 'registrationnotification', 'yes' ); |
| | 149 | if ( !get_network_option( 'registrationnotification' ) ) |
| | 150 | update_network_option( 'registrationnotification', 'yes' ); |
| 151 | 151 | ?> |
| 152 | 152 | <td> |
| 153 | | <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> |
| | 153 | <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> |
| 154 | 154 | </td> |
| 155 | 155 | </tr> |
| 156 | 156 | |
| 157 | 157 | <tr id="addnewusers"> |
| 158 | 158 | <th scope="row"><?php _e( 'Add New Users' ) ?></th> |
| 159 | 159 | <td> |
| 160 | | <label><input name="add_new_users" type="checkbox" id="add_new_users" value="1"<?php checked( get_site_option( 'add_new_users' ) ) ?> /> <?php _e( 'Allow site administrators to add new users to their site via the "Users → Add New" page.' ); ?></label> |
| | 160 | <label><input name="add_new_users" type="checkbox" id="add_new_users" value="1"<?php checked( get_network_option( 'add_new_users' ) ) ?> /> <?php _e( 'Allow site administrators to add new users to their site via the "Users → Add New" page.' ); ?></label> |
| 161 | 161 | </td> |
| 162 | 162 | </tr> |
| 163 | 163 | |
| 164 | 164 | <tr> |
| 165 | 165 | <th scope="row"><label for="illegal_names"><?php _e( 'Banned Names' ) ?></label></th> |
| 166 | 166 | <td> |
| 167 | | <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" /> |
| | 167 | <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" /> |
| 168 | 168 | <p class="description" id="illegal-names-desc"> |
| 169 | 169 | <?php _e( 'Users are not allowed to register these sites. Separate names by spaces.' ) ?> |
| 170 | 170 | </p> |
| … |
… |
if ( isset( $_GET['updated'] ) ) { |
| 174 | 174 | <tr> |
| 175 | 175 | <th scope="row"><label for="limited_email_domains"><?php _e( 'Limited Email Registrations' ) ?></label></th> |
| 176 | 176 | <td> |
| 177 | | <?php $limited_email_domains = get_site_option( 'limited_email_domains' ); |
| | 177 | <?php $limited_email_domains = get_network_option( 'limited_email_domains' ); |
| 178 | 178 | $limited_email_domains = str_replace( ' ', "\n", $limited_email_domains ); ?> |
| 179 | 179 | <textarea name="limited_email_domains" id="limited_email_domains" aria-describedby="limited-email-domains-desc" cols="45" rows="5"> |
| 180 | 180 | <?php echo esc_textarea( $limited_email_domains == '' ? '' : implode( "\n", (array) $limited_email_domains ) ); ?></textarea> |
| … |
… |
if ( isset( $_GET['updated'] ) ) { |
| 188 | 188 | <th scope="row"><label for="banned_email_domains"><?php _e('Banned Email Domains') ?></label></th> |
| 189 | 189 | <td> |
| 190 | 190 | <textarea name="banned_email_domains" id="banned_email_domains" aria-describedby="banned-email-domains-desc" cols="45" rows="5"> |
| 191 | | <?php echo esc_textarea( get_site_option( 'banned_email_domains' ) == '' ? '' : implode( "\n", (array) get_site_option( 'banned_email_domains' ) ) ); ?></textarea> |
| | 191 | <?php echo esc_textarea( get_network_option( 'banned_email_domains' ) == '' ? '' : implode( "\n", (array) get_network_option( 'banned_email_domains' ) ) ); ?></textarea> |
| 192 | 192 | <p class="description" id="banned-email-domains-desc"> |
| 193 | 193 | <?php _e( 'If you want to ban domains from site registrations. One domain per line.' ) ?> |
| 194 | 194 | </p> |
| … |
… |
if ( isset( $_GET['updated'] ) ) { |
| 203 | 203 | <th scope="row"><label for="welcome_email"><?php _e( 'Welcome Email' ) ?></label></th> |
| 204 | 204 | <td> |
| 205 | 205 | <textarea name="welcome_email" id="welcome_email" aria-describedby="welcome-email-desc" rows="5" cols="45" class="large-text"> |
| 206 | | <?php echo esc_textarea( get_site_option( 'welcome_email' ) ) ?></textarea> |
| | 206 | <?php echo esc_textarea( get_network_option( 'welcome_email' ) ) ?></textarea> |
| 207 | 207 | <p class="description" id="welcome-email-desc"> |
| 208 | 208 | <?php _e( 'The welcome email sent to new site owners.' ) ?> |
| 209 | 209 | </p> |
| … |
… |
if ( isset( $_GET['updated'] ) ) { |
| 213 | 213 | <th scope="row"><label for="welcome_user_email"><?php _e( 'Welcome User Email' ) ?></label></th> |
| 214 | 214 | <td> |
| 215 | 215 | <textarea name="welcome_user_email" id="welcome_user_email" aria-describedby="welcome-user-email-desc" rows="5" cols="45" class="large-text"> |
| 216 | | <?php echo esc_textarea( get_site_option( 'welcome_user_email' ) ) ?></textarea> |
| | 216 | <?php echo esc_textarea( get_network_option( 'welcome_user_email' ) ) ?></textarea> |
| 217 | 217 | <p class="description" id="welcome-user-email-desc"> |
| 218 | 218 | <?php _e( 'The welcome email sent to new users.' ) ?> |
| 219 | 219 | </p> |
| … |
… |
if ( isset( $_GET['updated'] ) ) { |
| 223 | 223 | <th scope="row"><label for="first_post"><?php _e( 'First Post' ) ?></label></th> |
| 224 | 224 | <td> |
| 225 | 225 | <textarea name="first_post" id="first_post" aria-describedby="first-post-desc" rows="5" cols="45" class="large-text"> |
| 226 | | <?php echo esc_textarea( get_site_option( 'first_post' ) ) ?></textarea> |
| | 226 | <?php echo esc_textarea( get_network_option( 'first_post' ) ) ?></textarea> |
| 227 | 227 | <p class="description" id="first-post-desc"> |
| 228 | 228 | <?php _e( 'The first post on a new site.' ) ?> |
| 229 | 229 | </p> |
| … |
… |
if ( isset( $_GET['updated'] ) ) { |
| 233 | 233 | <th scope="row"><label for="first_page"><?php _e( 'First Page' ) ?></label></th> |
| 234 | 234 | <td> |
| 235 | 235 | <textarea name="first_page" id="first_page" aria-describedby="first-page-desc" rows="5" cols="45" class="large-text"> |
| 236 | | <?php echo esc_textarea( get_site_option( 'first_page' ) ) ?></textarea> |
| | 236 | <?php echo esc_textarea( get_network_option( 'first_page' ) ) ?></textarea> |
| 237 | 237 | <p class="description" id="first-page-desc"> |
| 238 | 238 | <?php _e( 'The first page on a new site.' ) ?> |
| 239 | 239 | </p> |
| … |
… |
if ( isset( $_GET['updated'] ) ) { |
| 243 | 243 | <th scope="row"><label for="first_comment"><?php _e( 'First Comment' ) ?></label></th> |
| 244 | 244 | <td> |
| 245 | 245 | <textarea name="first_comment" id="first_comment" aria-describedby="first-comment-desc" rows="5" cols="45" class="large-text"> |
| 246 | | <?php echo esc_textarea( get_site_option( 'first_comment' ) ) ?></textarea> |
| | 246 | <?php echo esc_textarea( get_network_option( 'first_comment' ) ) ?></textarea> |
| 247 | 247 | <p class="description" id="first-comment-desc"> |
| 248 | 248 | <?php _e( 'The first comment on a new site.' ) ?> |
| 249 | 249 | </p> |
| … |
… |
if ( isset( $_GET['updated'] ) ) { |
| 252 | 252 | <tr> |
| 253 | 253 | <th scope="row"><label for="first_comment_author"><?php _e( 'First Comment Author' ) ?></label></th> |
| 254 | 254 | <td> |
| 255 | | <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') ?>" /> |
| | 255 | <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') ?>" /> |
| 256 | 256 | <p class="description" id="first-comment-author-desc"> |
| 257 | 257 | <?php _e( 'The author of the first comment on a new site.' ) ?> |
| 258 | 258 | </p> |
| … |
… |
if ( isset( $_GET['updated'] ) ) { |
| 261 | 261 | <tr> |
| 262 | 262 | <th scope="row"><label for="first_comment_url"><?php _e( 'First Comment URL' ) ?></label></th> |
| 263 | 263 | <td> |
| 264 | | <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' ) ) ?>" /> |
| | 264 | <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' ) ) ?>" /> |
| 265 | 265 | <p class="description" id="first-comment-url-desc"> |
| 266 | 266 | <?php _e( 'The URL for the first comment on a new site.' ) ?> |
| 267 | 267 | </p> |
| … |
… |
if ( isset( $_GET['updated'] ) ) { |
| 273 | 273 | <tr> |
| 274 | 274 | <th scope="row"><?php _e( 'Site upload space' ) ?></th> |
| 275 | 275 | <td> |
| 276 | | <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 /> |
| | 276 | <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 /> |
| 277 | 277 | <p class="screen-reader-text" id="blog-upload-space-desc"> |
| 278 | 278 | <?php _e( 'Size in megabytes' ) ?> |
| 279 | 279 | </p> |
| … |
… |
if ( isset( $_GET['updated'] ) ) { |
| 283 | 283 | <tr> |
| 284 | 284 | <th scope="row"><label for="upload_filetypes"><?php _e( 'Upload file types' ) ?></label></th> |
| 285 | 285 | <td> |
| 286 | | <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" /> |
| | 286 | <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" /> |
| 287 | 287 | <p class="description" id="upload-filetypes-desc"> |
| 288 | 288 | <?php _e( 'Allowed file types. Separate types by spaces.' ) ?> |
| 289 | 289 | </p> |
| … |
… |
if ( isset( $_GET['updated'] ) ) { |
| 293 | 293 | <tr> |
| 294 | 294 | <th scope="row"><label for="fileupload_maxk"><?php _e( 'Max upload file size' ) ?></label></th> |
| 295 | 295 | <td> |
| 296 | | <?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 ) ) . '" />' ); ?> |
| | 296 | <?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 ) ) . '" />' ); ?> |
| 297 | 297 | <p class="screen-reader-text" id="fileupload-maxk-desc"> |
| 298 | 298 | <?php _e( 'Size in kilobytes' ) ?> |
| 299 | 299 | </p> |
| … |
… |
if ( isset( $_GET['updated'] ) ) { |
| 312 | 312 | <th><label for="WPLANG"><?php _e( 'Default Language' ); ?></label></th> |
| 313 | 313 | <td> |
| 314 | 314 | <?php |
| 315 | | $lang = get_site_option( 'WPLANG' ); |
| | 315 | $lang = get_network_option( 'WPLANG' ); |
| 316 | 316 | if ( ! in_array( $lang, $languages ) ) { |
| 317 | 317 | $lang = ''; |
| 318 | 318 | } |
| … |
… |
if ( isset( $_GET['updated'] ) ) { |
| 339 | 339 | <th scope="row"><?php _e( 'Enable administration menus' ); ?></th> |
| 340 | 340 | <td> |
| 341 | 341 | <?php |
| 342 | | $menu_perms = get_site_option( 'menu_items' ); |
| | 342 | $menu_perms = get_network_option( 'menu_items' ); |
| 343 | 343 | /** |
| 344 | 344 | * Filter available network-wide administration menu options. |
| 345 | 345 | * |
-
diff --git a/wp-admin/network/site-new.php b/wp-admin/network/site-new.php
index 665f2ab..d35e5f4 100644
|
a
|
b
|
Name: %3$s' ), |
| 123 | 123 | get_site_url( $id ), |
| 124 | 124 | wp_unslash( $title ) |
| 125 | 125 | ); |
| 126 | | 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' ) . '>' ); |
| | 126 | 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' ) . '>' ); |
| 127 | 127 | wpmu_welcome_notification( $id, $user_id, $password, $title, array( 'public' => 1 ) ); |
| 128 | 128 | wp_redirect( add_query_arg( array( 'update' => 'added', 'id' => $id ), 'site-new.php' ) ); |
| 129 | 129 | exit; |
| … |
… |
if ( ! empty( $messages ) ) { |
| 188 | 188 | <td> |
| 189 | 189 | <?php |
| 190 | 190 | // Network default. |
| 191 | | $lang = get_site_option( 'WPLANG' ); |
| | 191 | $lang = get_network_option( 'WPLANG' ); |
| 192 | 192 | |
| 193 | 193 | // Use English if the default isn't available. |
| 194 | 194 | if ( ! in_array( $lang, $languages ) ) { |
-
diff --git a/wp-admin/network/themes.php b/wp-admin/network/themes.php
index 3917014..2aecf57 100644
|
a
|
b
|
$_SERVER['REQUEST_URI'] = remove_query_arg( $temp_args, $_SERVER['REQUEST_URI'] |
| 29 | 29 | $referer = remove_query_arg( $temp_args, wp_get_referer() ); |
| 30 | 30 | |
| 31 | 31 | if ( $action ) { |
| 32 | | $allowed_themes = get_site_option( 'allowedthemes' ); |
| | 32 | $allowed_themes = get_network_option( 'allowedthemes' ); |
| 33 | 33 | switch ( $action ) { |
| 34 | 34 | case 'enable': |
| 35 | 35 | check_admin_referer('enable-theme_' . $_GET['theme']); |
| 36 | 36 | $allowed_themes[ $_GET['theme'] ] = true; |
| 37 | | update_site_option( 'allowedthemes', $allowed_themes ); |
| | 37 | update_network_option( 'allowedthemes', $allowed_themes ); |
| 38 | 38 | if ( false === strpos( $referer, '/network/themes.php' ) ) |
| 39 | 39 | wp_redirect( network_admin_url( 'themes.php?enabled=1' ) ); |
| 40 | 40 | else |
| … |
… |
if ( $action ) { |
| 43 | 43 | case 'disable': |
| 44 | 44 | check_admin_referer('disable-theme_' . $_GET['theme']); |
| 45 | 45 | unset( $allowed_themes[ $_GET['theme'] ] ); |
| 46 | | update_site_option( 'allowedthemes', $allowed_themes ); |
| | 46 | update_network_option( 'allowedthemes', $allowed_themes ); |
| 47 | 47 | wp_safe_redirect( add_query_arg( 'disabled', '1', $referer ) ); |
| 48 | 48 | exit; |
| 49 | 49 | case 'enable-selected': |
| … |
… |
if ( $action ) { |
| 55 | 55 | } |
| 56 | 56 | foreach ( (array) $themes as $theme ) |
| 57 | 57 | $allowed_themes[ $theme ] = true; |
| 58 | | update_site_option( 'allowedthemes', $allowed_themes ); |
| | 58 | update_network_option( 'allowedthemes', $allowed_themes ); |
| 59 | 59 | wp_safe_redirect( add_query_arg( 'enabled', count( $themes ), $referer ) ); |
| 60 | 60 | exit; |
| 61 | 61 | case 'disable-selected': |
| … |
… |
if ( $action ) { |
| 67 | 67 | } |
| 68 | 68 | foreach ( (array) $themes as $theme ) |
| 69 | 69 | unset( $allowed_themes[ $theme ] ); |
| 70 | | update_site_option( 'allowedthemes', $allowed_themes ); |
| | 70 | update_network_option( 'allowedthemes', $allowed_themes ); |
| 71 | 71 | wp_safe_redirect( add_query_arg( 'disabled', count( $themes ), $referer ) ); |
| 72 | 72 | exit; |
| 73 | 73 | case 'update-selected' : |
-
diff --git a/wp-admin/network/upgrade.php b/wp-admin/network/upgrade.php
index 60d8d89..930913c 100644
|
a
|
b
|
switch ( $action ) { |
| 52 | 52 | * @global string $wp_db_version |
| 53 | 53 | */ |
| 54 | 54 | global $wp_db_version; |
| 55 | | update_site_option( 'wpmu_upgrade_site', $wp_db_version ); |
| | 55 | update_network_option( 'wpmu_upgrade_site', $wp_db_version ); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | $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 ); |
| … |
… |
switch ( $action ) { |
| 109 | 109 | break; |
| 110 | 110 | case 'show': |
| 111 | 111 | default: |
| 112 | | if ( get_site_option( 'wpmu_upgrade_site' ) != $GLOBALS['wp_db_version'] ) : |
| | 112 | if ( get_network_option( 'wpmu_upgrade_site' ) != $GLOBALS['wp_db_version'] ) : |
| 113 | 113 | ?> |
| 114 | 114 | <h3><?php _e( 'Database Upgrade Required' ); ?></h3> |
| 115 | 115 | <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> |
-
diff --git a/wp-admin/options-writing.php b/wp-admin/options-writing.php
index 9fb2db0..3c03461 100644
|
a
|
b
|
include( ABSPATH . 'wp-admin/admin-header.php' ); |
| 56 | 56 | <?php settings_fields('writing'); ?> |
| 57 | 57 | |
| 58 | 58 | <table class="form-table"> |
| 59 | | <?php if ( get_site_option( 'initial_db_version' ) < 32453 ) : ?> |
| | 59 | <?php if ( get_network_option( 'initial_db_version' ) < 32453 ) : ?> |
| 60 | 60 | <tr> |
| 61 | 61 | <th scope="row"><?php _e('Formatting') ?></th> |
| 62 | 62 | <td><fieldset><legend class="screen-reader-text"><span><?php _e('Formatting') ?></span></legend> |
-
diff --git a/wp-admin/options.php b/wp-admin/options.php
index a4809cf..4d52ab7 100644
|
a
|
b
|
$mail_options = array('mailserver_url', 'mailserver_port', 'mailserver_login', ' |
| 95 | 95 | if ( ! in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ) ) |
| 96 | 96 | $whitelist_options['reading'][] = 'blog_charset'; |
| 97 | 97 | |
| 98 | | if ( get_site_option( 'initial_db_version' ) < 32453 ) { |
| | 98 | if ( get_network_option( 'initial_db_version' ) < 32453 ) { |
| 99 | 99 | $whitelist_options['writing'][] = 'use_smilies'; |
| 100 | 100 | $whitelist_options['writing'][] = 'use_balanceTags'; |
| 101 | 101 | } |
-
diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php
index aa8ab1a..dea516b 100644
|
a
|
b
|
else |
| 316 | 316 | if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && !isset($super_admins) ) { ?> |
| 317 | 317 | <tr class="user-super-admin-wrap"><th><?php _e('Super Admin'); ?></th> |
| 318 | 318 | <td> |
| 319 | | <?php if ( $profileuser->user_email != get_site_option( 'admin_email' ) || ! is_super_admin( $profileuser->ID ) ) : ?> |
| | 319 | <?php if ( $profileuser->user_email != get_network_option( 'admin_email' ) || ! is_super_admin( $profileuser->ID ) ) : ?> |
| 320 | 320 | <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> |
| 321 | 321 | <?php else : ?> |
| 322 | 322 | <p><?php _e( 'Super admin privileges cannot be removed because this user has the network admin email.' ); ?></p> |
-
diff --git a/wp-includes/capabilities-functions.php b/wp-includes/capabilities-functions.php
index 9525a6a..0795ff4 100644
|
a
|
b
|
function map_meta_cap( $cap, $user_id ) { |
| 335 | 335 | $caps[] = $cap; |
| 336 | 336 | if ( is_multisite() ) { |
| 337 | 337 | // update_, install_, and delete_ are handled above with is_super_admin(). |
| 338 | | $menu_perms = get_site_option( 'menu_items', array() ); |
| | 338 | $menu_perms = get_network_option( 'menu_items', array() ); |
| 339 | 339 | if ( empty( $menu_perms['plugins'] ) ) |
| 340 | 340 | $caps[] = 'manage_network_plugins'; |
| 341 | 341 | } |
| … |
… |
function map_meta_cap( $cap, $user_id ) { |
| 351 | 351 | case 'create_users': |
| 352 | 352 | if ( !is_multisite() ) |
| 353 | 353 | $caps[] = $cap; |
| 354 | | elseif ( is_super_admin( $user_id ) || get_site_option( 'add_new_users' ) ) |
| | 354 | elseif ( is_super_admin( $user_id ) || get_network_option( 'add_new_users' ) ) |
| 355 | 355 | $caps[] = $cap; |
| 356 | 356 | else |
| 357 | 357 | $caps[] = 'do_not_allow'; |
| … |
… |
function get_super_admins() { |
| 577 | 577 | if ( isset($super_admins) ) |
| 578 | 578 | return $super_admins; |
| 579 | 579 | else |
| 580 | | return get_site_option( 'site_admins', array('admin') ); |
| | 580 | return get_network_option( 'site_admins', array('admin') ); |
| 581 | 581 | } |
| 582 | 582 | |
| 583 | 583 | /** |
-
diff --git a/wp-includes/class-wp-theme.php b/wp-includes/class-wp-theme.php
index 7bd9dca..31381ab 100644
|
a
|
b
|
final class WP_Theme implements ArrayAccess { |
| 1191 | 1191 | public static function get_allowed_on_network() { |
| 1192 | 1192 | static $allowed_themes; |
| 1193 | 1193 | if ( ! isset( $allowed_themes ) ) |
| 1194 | | $allowed_themes = (array) get_site_option( 'allowedthemes' ); |
| | 1194 | $allowed_themes = (array) get_network_option( 'allowedthemes' ); |
| 1195 | 1195 | return $allowed_themes; |
| 1196 | 1196 | } |
| 1197 | 1197 | |
-
diff --git a/wp-includes/default-constants.php b/wp-includes/default-constants.php
index 1ec1b36..62ec64b 100644
|
a
|
b
|
function wp_cookie_constants() { |
| 189 | 189 | * @since 1.5.0 |
| 190 | 190 | */ |
| 191 | 191 | if ( !defined( 'COOKIEHASH' ) ) { |
| 192 | | $siteurl = get_site_option( 'siteurl' ); |
| | 192 | $siteurl = get_network_option( 'siteurl' ); |
| 193 | 193 | if ( $siteurl ) |
| 194 | 194 | define( 'COOKIEHASH', md5( $siteurl ) ); |
| 195 | 195 | else |
-
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index ef2976c..aabdf77 100644
|
a
|
b
|
function wp_upload_dir( $time = null ) { |
| 1749 | 1749 | * Honor the value of UPLOADS. This happens as long as ms-files rewriting is disabled. |
| 1750 | 1750 | * We also sometimes obey UPLOADS when rewriting is enabled -- see the next block. |
| 1751 | 1751 | */ |
| 1752 | | if ( defined( 'UPLOADS' ) && ! ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) ) { |
| | 1752 | if ( defined( 'UPLOADS' ) && ! ( is_multisite() && get_network_option( 'ms_files_rewriting' ) ) ) { |
| 1753 | 1753 | $dir = ABSPATH . UPLOADS; |
| 1754 | 1754 | $url = trailingslashit( $siteurl ) . UPLOADS; |
| 1755 | 1755 | } |
| … |
… |
function wp_upload_dir( $time = null ) { |
| 1757 | 1757 | // If multisite (and if not the main site in a post-MU network) |
| 1758 | 1758 | if ( is_multisite() && ! ( is_main_network() && is_main_site() && defined( 'MULTISITE' ) ) ) { |
| 1759 | 1759 | |
| 1760 | | if ( ! get_site_option( 'ms_files_rewriting' ) ) { |
| | 1760 | if ( ! get_network_option( 'ms_files_rewriting' ) ) { |
| 1761 | 1761 | /* |
| 1762 | 1762 | * If ms-files rewriting is disabled (networks created post-3.5), it is fairly |
| 1763 | 1763 | * straightforward: Append sites/%d if we're not on the main site (for post-MU |
| … |
… |
function global_terms_enabled() { |
| 4004 | 4004 | if ( ! is_null( $filter ) ) |
| 4005 | 4005 | $global_terms = (bool) $filter; |
| 4006 | 4006 | else |
| 4007 | | $global_terms = (bool) get_site_option( 'global_terms_enabled', false ); |
| | 4007 | $global_terms = (bool) get_network_option( 'global_terms_enabled', false ); |
| 4008 | 4008 | } |
| 4009 | 4009 | return $global_terms; |
| 4010 | 4010 | } |
-
diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php
index 85a020d..9ecb7ef 100644
|
a
|
b
|
function get_locale() { |
| 53 | 53 | if ( is_multisite() ) { |
| 54 | 54 | // Don't check blog option when installing. |
| 55 | 55 | if ( defined( 'WP_INSTALLING' ) || ( false === $ms_locale = get_option( 'WPLANG' ) ) ) { |
| 56 | | $ms_locale = get_site_option( 'WPLANG' ); |
| | 56 | $ms_locale = get_network_option( 'WPLANG' ); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | if ( $ms_locale !== false ) { |
-
diff --git a/wp-includes/ms-default-constants.php b/wp-includes/ms-default-constants.php
index 05b1eeb..84efad1 100644
|
a
|
b
|
function ms_upload_constants() { |
| 23 | 23 | // This filter is attached in ms-default-filters.php but that file is not included during SHORTINIT. |
| 24 | 24 | add_filter( 'default_site_option_ms_files_rewriting', '__return_true' ); |
| 25 | 25 | |
| 26 | | if ( ! get_site_option( 'ms_files_rewriting' ) ) |
| | 26 | if ( ! get_network_option( 'ms_files_rewriting' ) ) |
| 27 | 27 | return; |
| 28 | 28 | |
| 29 | 29 | // Base uploads dir relative to ABSPATH |
-
diff --git a/wp-includes/ms-deprecated.php b/wp-includes/ms-deprecated.php
index b3d5607..7db302d 100644
|
a
|
b
|
|
| 25 | 25 | */ |
| 26 | 26 | function get_dashboard_blog() { |
| 27 | 27 | _deprecated_function( __FUNCTION__, '3.1' ); |
| 28 | | if ( $blog = get_site_option( 'dashboard_blog' ) ) |
| | 28 | if ( $blog = get_network_option( 'dashboard_blog' ) ) |
| 29 | 29 | return get_blog_details( $blog ); |
| 30 | 30 | |
| 31 | 31 | return get_blog_details( $GLOBALS['current_site']->blog_id ); |
-
diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php
index a6c2d02..ccfed2f 100644
|
a
|
b
|
function get_active_blog_for_user( $user_id ) { |
| 125 | 125 | * @return int |
| 126 | 126 | */ |
| 127 | 127 | function get_user_count() { |
| 128 | | return get_site_option( 'user_count' ); |
| | 128 | return get_network_option( 'user_count' ); |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
| … |
… |
function get_blog_count( $network_id = 0 ) { |
| 142 | 142 | if ( func_num_args() ) |
| 143 | 143 | _deprecated_argument( __FUNCTION__, '3.1' ); |
| 144 | 144 | |
| 145 | | return get_site_option( 'blog_count' ); |
| | 145 | return get_network_option( 'blog_count' ); |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | /** |
| … |
… |
function get_blog_id_from_url( $domain, $path = '/' ) { |
| 402 | 402 | * @return bool Returns true when the email address is banned. |
| 403 | 403 | */ |
| 404 | 404 | function is_email_address_unsafe( $user_email ) { |
| 405 | | $banned_names = get_site_option( 'banned_email_domains' ); |
| | 405 | $banned_names = get_network_option( 'banned_email_domains' ); |
| 406 | 406 | if ( $banned_names && ! is_array( $banned_names ) ) |
| 407 | 407 | $banned_names = explode( "\n", $banned_names ); |
| 408 | 408 | |
| … |
… |
function wpmu_validate_user_signup($user_name, $user_email) { |
| 480 | 480 | if ( empty( $user_name ) ) |
| 481 | 481 | $errors->add('user_name', __( 'Please enter a username.' ) ); |
| 482 | 482 | |
| 483 | | $illegal_names = get_site_option( 'illegal_names' ); |
| | 483 | $illegal_names = get_network_option( 'illegal_names' ); |
| 484 | 484 | if ( ! is_array( $illegal_names ) ) { |
| 485 | 485 | $illegal_names = array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' ); |
| 486 | | add_site_option( 'illegal_names', $illegal_names ); |
| | 486 | add_network_option( 'illegal_names', $illegal_names ); |
| 487 | 487 | } |
| 488 | 488 | if ( in_array( $user_name, $illegal_names ) ) |
| 489 | 489 | $errors->add('user_name', __( 'That username is not allowed.' ) ); |
| … |
… |
function wpmu_validate_user_signup($user_name, $user_email) { |
| 508 | 508 | if ( !is_email( $user_email ) ) |
| 509 | 509 | $errors->add('user_email', __( 'Please enter a valid email address.' ) ); |
| 510 | 510 | |
| 511 | | $limited_email_domains = get_site_option( 'limited_email_domains' ); |
| | 511 | $limited_email_domains = get_network_option( 'limited_email_domains' ); |
| 512 | 512 | if ( is_array( $limited_email_domains ) && ! empty( $limited_email_domains ) ) { |
| 513 | 513 | $emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) ); |
| 514 | 514 | if ( ! in_array( $emaildomain, $limited_email_domains ) ) { |
| … |
… |
function wpmu_validate_blog_signup( $blogname, $blog_title, $user = '' ) { |
| 602 | 602 | $blog_title = substr( $blog_title, 0, 50 ); |
| 603 | 603 | |
| 604 | 604 | $errors = new WP_Error(); |
| 605 | | $illegal_names = get_site_option( 'illegal_names' ); |
| | 605 | $illegal_names = get_network_option( 'illegal_names' ); |
| 606 | 606 | if ( $illegal_names == false ) { |
| 607 | 607 | $illegal_names = array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' ); |
| 608 | | add_site_option( 'illegal_names', $illegal_names ); |
| | 608 | add_network_option( 'illegal_names', $illegal_names ); |
| 609 | 609 | } |
| 610 | 610 | |
| 611 | 611 | /* |
| … |
… |
function wpmu_signup_blog_notification( $domain, $path, $title, $user, $user_ema |
| 858 | 858 | $activate_url = "http://{$domain}{$path}wp-activate.php?key=$key"; // @todo use *_url() API |
| 859 | 859 | |
| 860 | 860 | $activate_url = esc_url($activate_url); |
| 861 | | $admin_email = get_site_option( 'admin_email' ); |
| | 861 | $admin_email = get_network_option( 'admin_email' ); |
| 862 | 862 | if ( $admin_email == '' ) |
| 863 | 863 | $admin_email = 'support@' . $_SERVER['SERVER_NAME']; |
| 864 | | $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) ); |
| | 864 | $from_name = get_network_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_network_option( 'site_name' ) ); |
| 865 | 865 | $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; |
| 866 | 866 | $message = sprintf( |
| 867 | 867 | /** |
| … |
… |
function wpmu_signup_user_notification( $user, $user_email, $key, $meta = array( |
| 951 | 951 | return false; |
| 952 | 952 | |
| 953 | 953 | // Send email with activation link. |
| 954 | | $admin_email = get_site_option( 'admin_email' ); |
| | 954 | $admin_email = get_network_option( 'admin_email' ); |
| 955 | 955 | if ( $admin_email == '' ) |
| 956 | 956 | $admin_email = 'support@' . $_SERVER['SERVER_NAME']; |
| 957 | | $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) ); |
| | 957 | $from_name = get_network_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_network_option( 'site_name' ) ); |
| 958 | 958 | $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; |
| 959 | 959 | $message = sprintf( |
| 960 | 960 | /** |
| … |
… |
function wpmu_create_blog( $domain, $path, $title, $user_id, $meta = array(), $s |
| 1192 | 1192 | update_option( $key, $value ); |
| 1193 | 1193 | } |
| 1194 | 1194 | |
| 1195 | | add_option( 'WPLANG', get_site_option( 'WPLANG' ) ); |
| | 1195 | add_option( 'WPLANG', get_network_option( 'WPLANG' ) ); |
| 1196 | 1196 | update_option( 'blog_public', (int) $meta['public'] ); |
| 1197 | 1197 | |
| 1198 | 1198 | if ( ! is_super_admin( $user_id ) && ! get_user_meta( $user_id, 'primary_blog', true ) ) |
| … |
… |
function wpmu_create_blog( $domain, $path, $title, $user_id, $meta = array(), $s |
| 1228 | 1228 | * @return bool |
| 1229 | 1229 | */ |
| 1230 | 1230 | function newblog_notify_siteadmin( $blog_id, $deprecated = '' ) { |
| 1231 | | if ( get_site_option( 'registrationnotification' ) != 'yes' ) |
| | 1231 | if ( get_network_option( 'registrationnotification' ) != 'yes' ) |
| 1232 | 1232 | return false; |
| 1233 | 1233 | |
| 1234 | | $email = get_site_option( 'admin_email' ); |
| | 1234 | $email = get_network_option( 'admin_email' ); |
| 1235 | 1235 | if ( is_email($email) == false ) |
| 1236 | 1236 | return false; |
| 1237 | 1237 | |
| … |
… |
Disable these notifications: %4$s' ), $blogname, $siteurl, wp_unslash( $_SERVER[ |
| 1273 | 1273 | * @return bool |
| 1274 | 1274 | */ |
| 1275 | 1275 | function newuser_notify_siteadmin( $user_id ) { |
| 1276 | | if ( get_site_option( 'registrationnotification' ) != 'yes' ) |
| | 1276 | if ( get_network_option( 'registrationnotification' ) != 'yes' ) |
| 1277 | 1277 | return false; |
| 1278 | 1278 | |
| 1279 | | $email = get_site_option( 'admin_email' ); |
| | 1279 | $email = get_network_option( 'admin_email' ); |
| 1280 | 1280 | |
| 1281 | 1281 | if ( is_email($email) == false ) |
| 1282 | 1282 | return false; |
| … |
… |
function install_blog( $blog_id, $blog_title = '' ) { |
| 1412 | 1412 | update_option( 'siteurl', $url ); |
| 1413 | 1413 | update_option( 'home', $url ); |
| 1414 | 1414 | |
| 1415 | | if ( get_site_option( 'ms_files_rewriting' ) ) |
| | 1415 | if ( get_network_option( 'ms_files_rewriting' ) ) |
| 1416 | 1416 | update_option( 'upload_path', UPLOADBLOGSDIR . "/$blog_id/files" ); |
| 1417 | 1417 | else |
| 1418 | 1418 | update_option( 'upload_path', get_blog_option( get_current_site()->blog_id, 'upload_path' ) ); |
| … |
… |
function wpmu_welcome_notification( $blog_id, $user_id, $password, $title, $meta |
| 1488 | 1488 | if ( ! apply_filters( 'wpmu_welcome_notification', $blog_id, $user_id, $password, $title, $meta ) ) |
| 1489 | 1489 | return false; |
| 1490 | 1490 | |
| 1491 | | $welcome_email = get_site_option( 'welcome_email' ); |
| | 1491 | $welcome_email = get_network_option( 'welcome_email' ); |
| 1492 | 1492 | if ( $welcome_email == false ) { |
| 1493 | 1493 | /* translators: Do not translate USERNAME, SITE_NAME, BLOG_URL, PASSWORD: those are placeholders. */ |
| 1494 | 1494 | $welcome_email = __( 'Howdy USERNAME, |
| … |
… |
We hope you enjoy your new site. Thanks! |
| 1531 | 1531 | * @param array $meta Signup meta data. |
| 1532 | 1532 | */ |
| 1533 | 1533 | $welcome_email = apply_filters( 'update_welcome_email', $welcome_email, $blog_id, $user_id, $password, $title, $meta ); |
| 1534 | | $admin_email = get_site_option( 'admin_email' ); |
| | 1534 | $admin_email = get_network_option( 'admin_email' ); |
| 1535 | 1535 | |
| 1536 | 1536 | if ( $admin_email == '' ) |
| 1537 | 1537 | $admin_email = 'support@' . $_SERVER['SERVER_NAME']; |
| 1538 | 1538 | |
| 1539 | | $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) ); |
| | 1539 | $from_name = get_network_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_network_option( 'site_name' ) ); |
| 1540 | 1540 | $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; |
| 1541 | 1541 | $message = $welcome_email; |
| 1542 | 1542 | |
| … |
… |
function wpmu_welcome_user_notification( $user_id, $password, $meta = array() ) |
| 1587 | 1587 | if ( ! apply_filters( 'wpmu_welcome_user_notification', $user_id, $password, $meta ) ) |
| 1588 | 1588 | return false; |
| 1589 | 1589 | |
| 1590 | | $welcome_email = get_site_option( 'welcome_user_email' ); |
| | 1590 | $welcome_email = get_network_option( 'welcome_user_email' ); |
| 1591 | 1591 | |
| 1592 | 1592 | $user = get_userdata( $user_id ); |
| 1593 | 1593 | |
| … |
… |
function wpmu_welcome_user_notification( $user_id, $password, $meta = array() ) |
| 1609 | 1609 | $welcome_email = str_replace( 'PASSWORD', $password, $welcome_email ); |
| 1610 | 1610 | $welcome_email = str_replace( 'LOGINLINK', wp_login_url(), $welcome_email ); |
| 1611 | 1611 | |
| 1612 | | $admin_email = get_site_option( 'admin_email' ); |
| | 1612 | $admin_email = get_network_option( 'admin_email' ); |
| 1613 | 1613 | |
| 1614 | 1614 | if ( $admin_email == '' ) |
| 1615 | 1615 | $admin_email = 'support@' . $_SERVER['SERVER_NAME']; |
| 1616 | 1616 | |
| 1617 | | $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) ); |
| | 1617 | $from_name = get_network_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_network_option( 'site_name' ) ); |
| 1618 | 1618 | $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; |
| 1619 | 1619 | $message = $welcome_email; |
| 1620 | 1620 | |
| … |
… |
function recurse_dirsize( $directory, $exclude = null ) { |
| 1786 | 1786 | * @return array |
| 1787 | 1787 | */ |
| 1788 | 1788 | function check_upload_mimes( $mimes ) { |
| 1789 | | $site_exts = explode( ' ', get_site_option( 'upload_filetypes', 'jpg jpeg png gif' ) ); |
| | 1789 | $site_exts = explode( ' ', get_network_option( 'upload_filetypes', 'jpg jpeg png gif' ) ); |
| 1790 | 1790 | $site_mimes = array(); |
| 1791 | 1791 | foreach ( $site_exts as $ext ) { |
| 1792 | 1792 | foreach ( $mimes as $ext_pattern => $mime ) { |
| … |
… |
function redirect_this_site( $deprecated = '' ) { |
| 1925 | 1925 | * @return string|array If the upload is under the size limit, $upload is returned. Otherwise returns an error message. |
| 1926 | 1926 | */ |
| 1927 | 1927 | function upload_is_file_too_big( $upload ) { |
| 1928 | | if ( ! is_array( $upload ) || defined( 'WP_IMPORTING' ) || get_site_option( 'upload_space_check_disabled' ) ) |
| | 1928 | if ( ! is_array( $upload ) || defined( 'WP_IMPORTING' ) || get_network_option( 'upload_space_check_disabled' ) ) |
| 1929 | 1929 | return $upload; |
| 1930 | 1930 | |
| 1931 | | if ( strlen( $upload['bits'] ) > ( 1024 * get_site_option( 'fileupload_maxk', 1500 ) ) ) |
| 1932 | | return sprintf( __( 'This file is too big. Files must be less than %d KB in size.' ) . '<br />', get_site_option( 'fileupload_maxk', 1500 )); |
| | 1931 | if ( strlen( $upload['bits'] ) > ( 1024 * get_network_option( 'fileupload_maxk', 1500 ) ) ) |
| | 1932 | return sprintf( __( 'This file is too big. Files must be less than %d KB in size.' ) . '<br />', get_network_option( 'fileupload_maxk', 1500 )); |
| 1933 | 1933 | |
| 1934 | 1934 | return $upload; |
| 1935 | 1935 | } |
| … |
… |
function is_user_option_local( $key, $user_id = 0, $blog_id = 0 ) { |
| 2142 | 2142 | * @return bool |
| 2143 | 2143 | */ |
| 2144 | 2144 | function users_can_register_signup_filter() { |
| 2145 | | $registration = get_site_option('registration'); |
| | 2145 | $registration = get_network_option('registration'); |
| 2146 | 2146 | return ( $registration == 'all' || $registration == 'user' ); |
| 2147 | 2147 | } |
| 2148 | 2148 | |
| … |
… |
LOGINLINK |
| 2171 | 2171 | Thanks! |
| 2172 | 2172 | |
| 2173 | 2173 | --The Team @ SITE_NAME' ); |
| 2174 | | update_site_option( 'welcome_user_email', $text ); |
| | 2174 | update_network_option( 'welcome_user_email', $text ); |
| 2175 | 2175 | } |
| 2176 | 2176 | return $text; |
| 2177 | 2177 | } |
| … |
… |
function wp_update_network_site_counts() { |
| 2297 | 2297 | global $wpdb; |
| 2298 | 2298 | |
| 2299 | 2299 | $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) ); |
| 2300 | | update_site_option( 'blog_count', $count ); |
| | 2300 | update_network_option( 'blog_count', $count ); |
| 2301 | 2301 | } |
| 2302 | 2302 | |
| 2303 | 2303 | /** |
| … |
… |
function wp_update_network_user_counts() { |
| 2311 | 2311 | global $wpdb; |
| 2312 | 2312 | |
| 2313 | 2313 | $count = $wpdb->get_var( "SELECT COUNT(ID) as c FROM $wpdb->users WHERE spam = '0' AND deleted = '0'" ); |
| 2314 | | update_site_option( 'user_count', $count ); |
| | 2314 | update_network_option( 'user_count', $count ); |
| 2315 | 2315 | } |
| 2316 | 2316 | |
| 2317 | 2317 | /** |
| … |
… |
function get_space_allowed() { |
| 2349 | 2349 | $space_allowed = get_option( 'blog_upload_space' ); |
| 2350 | 2350 | |
| 2351 | 2351 | if ( ! is_numeric( $space_allowed ) ) |
| 2352 | | $space_allowed = get_site_option( 'blog_upload_space' ); |
| | 2352 | $space_allowed = get_network_option( 'blog_upload_space' ); |
| 2353 | 2353 | |
| 2354 | 2354 | if ( empty( $space_allowed ) || ! is_numeric( $space_allowed ) ) |
| 2355 | 2355 | $space_allowed = 100; |
| … |
… |
function get_space_allowed() { |
| 2373 | 2373 | */ |
| 2374 | 2374 | function get_upload_space_available() { |
| 2375 | 2375 | $space_allowed = get_space_allowed() * 1024 * 1024; |
| 2376 | | if ( get_site_option( 'upload_space_check_disabled' ) ) |
| | 2376 | if ( get_network_option( 'upload_space_check_disabled' ) ) |
| 2377 | 2377 | return $space_allowed; |
| 2378 | 2378 | |
| 2379 | 2379 | $space_used = get_space_used() * 1024 * 1024; |
| … |
… |
function get_upload_space_available() { |
| 2391 | 2391 | * @return bool True if space is available, false otherwise. |
| 2392 | 2392 | */ |
| 2393 | 2393 | function is_upload_space_available() { |
| 2394 | | if ( get_site_option( 'upload_space_check_disabled' ) ) |
| | 2394 | if ( get_network_option( 'upload_space_check_disabled' ) ) |
| 2395 | 2395 | return true; |
| 2396 | 2396 | |
| 2397 | 2397 | return (bool) get_upload_space_available(); |
| … |
… |
function is_upload_space_available() { |
| 2403 | 2403 | * @return int of upload size limit in bytes |
| 2404 | 2404 | */ |
| 2405 | 2405 | function upload_size_limit_filter( $size ) { |
| 2406 | | $fileupload_maxk = 1024 * get_site_option( 'fileupload_maxk', 1500 ); |
| 2407 | | if ( get_site_option( 'upload_space_check_disabled' ) ) |
| | 2406 | $fileupload_maxk = 1024 * get_network_option( 'fileupload_maxk', 1500 ); |
| | 2407 | if ( get_network_option( 'upload_space_check_disabled' ) ) |
| 2408 | 2408 | return min( $size, $fileupload_maxk ); |
| 2409 | 2409 | |
| 2410 | 2410 | return min( $size, $fileupload_maxk, get_upload_space_available() ); |
-
diff --git a/wp-includes/ms-load.php b/wp-includes/ms-load.php
index 451e0dc..2c16145 100644
|
a
|
b
|
function is_subdomain_install() { |
| 34 | 34 | * @return array Files to include. |
| 35 | 35 | */ |
| 36 | 36 | function wp_get_active_network_plugins() { |
| 37 | | $active_plugins = (array) get_site_option( 'active_sitewide_plugins', array() ); |
| | 37 | $active_plugins = (array) get_network_option( 'active_sitewide_plugins', array() ); |
| 38 | 38 | if ( empty( $active_plugins ) ) |
| 39 | 39 | return array(); |
| 40 | 40 | |
| … |
… |
function ms_site_check() { |
| 96 | 96 | if ( file_exists( WP_CONTENT_DIR . '/blog-inactive.php' ) ) |
| 97 | 97 | return WP_CONTENT_DIR . '/blog-inactive.php'; |
| 98 | 98 | else |
| 99 | | 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 ) ) ) ); |
| | 99 | 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 ) ) ) ); |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | if ( $blog->archived == '1' || $blog->spam == '1' ) { |
-
diff --git a/wp-includes/ms-settings.php b/wp-includes/ms-settings.php
index 00da6da..7d0fbc6 100644
|
a
|
b
|
if ( ! $current_site instanceof WP_Network ) { |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | if ( empty( $current_site->site_name ) ) { |
| 225 | | $current_site->site_name = get_site_option( 'site_name' ); |
| | 225 | $current_site->site_name = get_network_option( 'site_name' ); |
| 226 | 226 | if ( ! $current_site->site_name ) { |
| 227 | 227 | $current_site->site_name = ucfirst( $current_site->domain ); |
| 228 | 228 | } |
-
diff --git a/wp-includes/option.php b/wp-includes/option.php
index ab8f81b..90844e0 100644
|
a
|
b
|
function delete_all_user_settings() { |
| 976 | 976 | * |
| 977 | 977 | * @since 2.8.0 |
| 978 | 978 | * |
| | 979 | * @see get_network_option() |
| | 980 | * |
| | 981 | * |
| | 982 | * @param string $option Name of option to retrieve. Expected to not be SQL-escaped. |
| | 983 | * @param mixed $default Optional value to return if option doesn't exist. Default false. |
| | 984 | * @param bool $deprecated Whether to use cache. Multisite only. Always set to true. |
| | 985 | * @return mixed Value set for the option. |
| | 986 | */ |
| | 987 | function get_site_option( $option, $default = false, $deprecated = true ) { |
| | 988 | return get_network_option( $option, $default ); |
| | 989 | } |
| | 990 | /** |
| | 991 | * Add a new site option. |
| | 992 | * |
| | 993 | * Existing options will not be updated. Note that prior to 3.3 this wasn't the case. |
| | 994 | * |
| | 995 | * @since 2.8.0 |
| | 996 | * |
| | 997 | * @see add_network_option() |
| | 998 | * |
| | 999 | * |
| | 1000 | * @param string $option Name of option to add. Expected to not be SQL-escaped. |
| | 1001 | * @param mixed $value Optional. Option value, can be anything. Expected to not be SQL-escaped. |
| | 1002 | * @return bool False if option was not added and true if option was added. |
| | 1003 | */ |
| | 1004 | function add_site_option( $option, $value ) { |
| | 1005 | return add_network_option( $option, $value ); |
| | 1006 | } |
| | 1007 | /** |
| | 1008 | * Removes site option by name. |
| | 1009 | * |
| | 1010 | * @since 2.8.0 |
| | 1011 | * |
| | 1012 | * @see delete_network_option() |
| | 1013 | * |
| | 1014 | * |
| | 1015 | * @param string $option Name of option to remove. Expected to not be SQL-escaped. |
| | 1016 | * @return bool True, if succeed. False, if failure. |
| | 1017 | */ |
| | 1018 | function delete_site_option( $option ) { |
| | 1019 | return delete_network_option( $option ); |
| | 1020 | } |
| | 1021 | /** |
| | 1022 | * Update the value of a site option that was already added. |
| | 1023 | * |
| | 1024 | * @since 2.8.0 |
| | 1025 | * |
| | 1026 | * @see update_network_option() |
| | 1027 | * |
| | 1028 | * |
| | 1029 | * @param string $option Name of option. Expected to not be SQL-escaped. |
| | 1030 | * @param mixed $value Option value. Expected to not be SQL-escaped. |
| | 1031 | * @return bool False if value was not updated and true if value was updated. |
| | 1032 | */ |
| | 1033 | function update_site_option( $option, $value ) { |
| | 1034 | return update_network_option( $option, $value ); |
| | 1035 | } |
| | 1036 | |
| | 1037 | /** |
| | 1038 | * Retrieve site option value based on name of option. |
| | 1039 | * |
| | 1040 | * @since 4.4.0 |
| | 1041 | * |
| 979 | 1042 | * @see get_option() |
| 980 | 1043 | * |
| 981 | 1044 | * @global wpdb $wpdb |
| 982 | 1045 | * |
| 983 | 1046 | * @param string $option Name of option to retrieve. Expected to not be SQL-escaped. |
| 984 | 1047 | * @param mixed $default Optional value to return if option doesn't exist. Default false. |
| 985 | | * @param bool $use_cache Whether to use cache. Multisite only. Default true. |
| | 1048 | * @param int|bool $network_id ID of the network. |
| 986 | 1049 | * @return mixed Value set for the option. |
| 987 | 1050 | */ |
| 988 | | function get_site_option( $option, $default = false, $use_cache = true ) { |
| | 1051 | function get_network_option( $option, $default = false, $network_id = true ) { |
| 989 | 1052 | global $wpdb; |
| 990 | 1053 | |
| | 1054 | /** If network ID not set, get current network. **/ |
| | 1055 | if( false === $network_id && is_multisite() ){ |
| | 1056 | $current_network = get_current_site(); |
| | 1057 | $network_id = $current_network->id; |
| | 1058 | } |
| | 1059 | /** Make sure network id is an int */ |
| | 1060 | $network_id = (int) $network_id; |
| | 1061 | |
| 991 | 1062 | /** |
| 992 | 1063 | * Filter an existing site option before it is retrieved. |
| 993 | 1064 | * |
| … |
… |
function get_site_option( $option, $default = false, $use_cache = true ) { |
| 1008 | 1079 | if ( false !== $pre ) |
| 1009 | 1080 | return $pre; |
| 1010 | 1081 | |
| | 1082 | /** |
| | 1083 | * Filter an existing network option before it is retrieved. |
| | 1084 | * |
| | 1085 | * The dynamic portion of the hook name, `$option`, refers to the option name. |
| | 1086 | * |
| | 1087 | * Passing a truthy value to the filter will effectively short-circuit retrieval, |
| | 1088 | * returning the passed value instead. |
| | 1089 | * |
| | 1090 | * @since 4.4.0 |
| | 1091 | * |
| | 1092 | * @param mixed $pre_option The default value to return if the option does not exist. |
| | 1093 | * @param string $option Option name. |
| | 1094 | * @param int $network_id ID of the network. |
| | 1095 | * |
| | 1096 | */ |
| | 1097 | $pre = apply_filters( 'pre_network_option_' . $option, false, $option, $network_id ); |
| | 1098 | |
| | 1099 | if ( false !== $pre ) |
| | 1100 | return $pre; |
| | 1101 | |
| 1011 | 1102 | // prevent non-existent options from triggering multiple queries |
| 1012 | | $notoptions_key = "{$wpdb->siteid}:notoptions"; |
| | 1103 | $notoptions_key = "{$network_id}:notoptions"; |
| 1013 | 1104 | $notoptions = wp_cache_get( $notoptions_key, 'site-options' ); |
| 1014 | 1105 | |
| 1015 | 1106 | if ( isset( $notoptions[$option] ) ) { |
| … |
… |
function get_site_option( $option, $default = false, $use_cache = true ) { |
| 1026 | 1117 | * in the database. |
| 1027 | 1118 | * @param string $option Option name. |
| 1028 | 1119 | */ |
| 1029 | | return apply_filters( 'default_site_option_' . $option, $default, $option ); |
| | 1120 | $default = apply_filters( 'default_site_option_' . $option, $default, $option ); |
| | 1121 | |
| | 1122 | /** |
| | 1123 | * Filter a specific default network option. |
| | 1124 | * |
| | 1125 | * The dynamic portion of the hook name, `$option`, refers to the option name. |
| | 1126 | * |
| | 1127 | * @since 4.4.0 |
| | 1128 | * |
| | 1129 | * @param mixed $default The value to return if the site option does not exist |
| | 1130 | * in the database. |
| | 1131 | * @param string $option Option name. |
| | 1132 | * @param int $network_id ID of the network. |
| | 1133 | */ |
| | 1134 | return apply_filters( 'default_network_option_' . $option, $default, $option, $network_id ); |
| 1030 | 1135 | } |
| 1031 | 1136 | |
| 1032 | 1137 | if ( ! is_multisite() ) { |
| 1033 | 1138 | |
| 1034 | 1139 | /** This filter is documented in wp-includes/option.php */ |
| 1035 | 1140 | $default = apply_filters( 'default_site_option_' . $option, $default, $option ); |
| | 1141 | /** This filter is documented in wp-includes/option.php */ |
| | 1142 | $default = apply_filters( 'default_network_option_' . $option, $default, $option, $network_id ); |
| 1036 | 1143 | $value = get_option($option, $default); |
| 1037 | 1144 | } else { |
| 1038 | | $cache_key = "{$wpdb->siteid}:$option"; |
| 1039 | | if ( $use_cache ) |
| 1040 | | $value = wp_cache_get($cache_key, 'site-options'); |
| | 1145 | $cache_key = "{$network_id}:$option"; |
| | 1146 | $value = wp_cache_get($cache_key, 'site-options'); |
| 1041 | 1147 | |
| 1042 | | if ( !isset($value) || (false === $value) ) { |
| 1043 | | $row = $wpdb->get_row( $wpdb->prepare("SELECT meta_value FROM $wpdb->sitemeta WHERE meta_key = %s AND site_id = %d", $option, $wpdb->siteid ) ); |
| | 1148 | if ( false === $value ) { |
| | 1149 | $row = $wpdb->get_row( $wpdb->prepare("SELECT meta_value FROM $wpdb->sitemeta WHERE meta_key = %s AND site_id = %d", $option, $network_id ) ); |
| 1044 | 1150 | |
| 1045 | 1151 | // Has to be get_row instead of get_var because of funkiness with 0, false, null values |
| 1046 | 1152 | if ( is_object( $row ) ) { |
| … |
… |
function get_site_option( $option, $default = false, $use_cache = true ) { |
| 1056 | 1162 | |
| 1057 | 1163 | /** This filter is documented in wp-includes/option.php */ |
| 1058 | 1164 | $value = apply_filters( 'default_site_option_' . $option, $default, $option ); |
| | 1165 | /** This filter is documented in wp-includes/option.php */ |
| | 1166 | $value = apply_filters( 'default_network_option_' . $option, $value, $option, $network_id ); |
| 1059 | 1167 | } |
| 1060 | 1168 | } |
| 1061 | 1169 | } |
| 1062 | 1170 | |
| | 1171 | |
| 1063 | 1172 | /** |
| 1064 | 1173 | * Filter the value of an existing site option. |
| 1065 | 1174 | * |
| … |
… |
function get_site_option( $option, $default = false, $use_cache = true ) { |
| 1072 | 1181 | * @param mixed $value Value of site option. |
| 1073 | 1182 | * @param string $option Option name. |
| 1074 | 1183 | */ |
| 1075 | | return apply_filters( 'site_option_' . $option, $value, $option ); |
| | 1184 | $value = apply_filters( 'site_option_' . $option, $value, $option ); |
| | 1185 | |
| | 1186 | /** |
| | 1187 | * Filter the value of an existing network option. |
| | 1188 | * |
| | 1189 | * The dynamic portion of the hook name, `$option`, refers to the option name. |
| | 1190 | * |
| | 1191 | * @since 4.4.0 |
| | 1192 | * |
| | 1193 | * @param mixed $value Value of site option. |
| | 1194 | * @param string $option Option name. |
| | 1195 | * @param int $network_id ID of the network. |
| | 1196 | */ |
| | 1197 | return apply_filters( 'network_option_' . $option, $value, $option, $network_id ); |
| 1076 | 1198 | } |
| 1077 | 1199 | |
| 1078 | 1200 | /** |
| 1079 | | * Add a new site option. |
| | 1201 | * Add a new network option. |
| 1080 | 1202 | * |
| 1081 | 1203 | * Existing options will not be updated. Note that prior to 3.3 this wasn't the case. |
| 1082 | 1204 | * |
| 1083 | | * @since 2.8.0 |
| | 1205 | * @since 4.4.0 |
| 1084 | 1206 | * |
| 1085 | 1207 | * @see add_option() |
| 1086 | 1208 | * |
| … |
… |
function get_site_option( $option, $default = false, $use_cache = true ) { |
| 1088 | 1210 | * |
| 1089 | 1211 | * @param string $option Name of option to add. Expected to not be SQL-escaped. |
| 1090 | 1212 | * @param mixed $value Optional. Option value, can be anything. Expected to not be SQL-escaped. |
| | 1213 | * @param int|bool $network_id ID of the network. |
| 1091 | 1214 | * @return bool False if option was not added and true if option was added. |
| 1092 | 1215 | */ |
| 1093 | | function add_site_option( $option, $value ) { |
| | 1216 | function add_network_option( $option, $value, $network_id = false ) { |
| 1094 | 1217 | global $wpdb; |
| 1095 | 1218 | |
| | 1219 | /** If network ID not set, get current network. **/ |
| | 1220 | if( false === $network_id && is_multisite() ){ |
| | 1221 | $current_network = get_current_site(); |
| | 1222 | $network_id = $current_network->id; |
| | 1223 | } |
| | 1224 | /** Make sure network id is an int */ |
| | 1225 | $network_id = (int) $network_id; |
| | 1226 | |
| 1096 | 1227 | wp_protect_special_option( $option ); |
| 1097 | 1228 | |
| 1098 | 1229 | /** |
| … |
… |
function add_site_option( $option, $value ) { |
| 1109 | 1240 | */ |
| 1110 | 1241 | $value = apply_filters( 'pre_add_site_option_' . $option, $value, $option ); |
| 1111 | 1242 | |
| 1112 | | $notoptions_key = "{$wpdb->siteid}:notoptions"; |
| | 1243 | /** |
| | 1244 | * Filter the value of a specific network option before it is added. |
| | 1245 | * |
| | 1246 | * The dynamic portion of the hook name, `$option`, refers to the option name. |
| | 1247 | * |
| | 1248 | * @since 4.4.0 |
| | 1249 | * |
| | 1250 | * @param mixed $value Value of site option. |
| | 1251 | * @param string $option Option name. |
| | 1252 | * @param int $network_id ID of the network. |
| | 1253 | */ |
| | 1254 | $value = apply_filters( 'pre_add_network_option_' . $option, $value, $option, $network_id ); |
| | 1255 | |
| | 1256 | $notoptions_key = "{$network_id}:notoptions"; |
| 1113 | 1257 | |
| 1114 | 1258 | if ( !is_multisite() ) { |
| 1115 | 1259 | $result = add_option( $option, $value ); |
| 1116 | 1260 | } else { |
| 1117 | | $cache_key = "{$wpdb->siteid}:$option"; |
| | 1261 | $cache_key = "{$network_id}:$option"; |
| 1118 | 1262 | |
| 1119 | 1263 | // Make sure the option doesn't already exist. We can check the 'notoptions' cache before we ask for a db query |
| 1120 | 1264 | $notoptions = wp_cache_get( $notoptions_key, 'site-options' ); |
| 1121 | 1265 | if ( ! is_array( $notoptions ) || ! isset( $notoptions[$option] ) ) |
| 1122 | | if ( false !== get_site_option( $option ) ) |
| | 1266 | if ( false !== get_network_option( $option, false, $network_id ) ) |
| 1123 | 1267 | return false; |
| 1124 | 1268 | |
| 1125 | 1269 | $value = sanitize_option( $option, $value ); |
| 1126 | 1270 | |
| 1127 | 1271 | $serialized_value = maybe_serialize( $value ); |
| 1128 | | $result = $wpdb->insert( $wpdb->sitemeta, array('site_id' => $wpdb->siteid, 'meta_key' => $option, 'meta_value' => $serialized_value ) ); |
| | 1272 | $result = $wpdb->insert( $wpdb->sitemeta, array('site_id' => $network_id, 'meta_key' => $option, 'meta_value' => $serialized_value ) ); |
| 1129 | 1273 | |
| 1130 | 1274 | if ( ! $result ) |
| 1131 | 1275 | return false; |
| … |
… |
function add_site_option( $option, $value ) { |
| 1156 | 1300 | do_action( "add_site_option_{$option}", $option, $value ); |
| 1157 | 1301 | |
| 1158 | 1302 | /** |
| | 1303 | * Fires after a specific network option has been successfully added. |
| | 1304 | * |
| | 1305 | * The dynamic portion of the hook name, `$option`, refers to the option name. |
| | 1306 | * |
| | 1307 | * @since 4.4.0 |
| | 1308 | * |
| | 1309 | * @param string $option Name of site option. |
| | 1310 | * @param mixed $value Value of site option. |
| | 1311 | * @param int $network_id ID of the network. |
| | 1312 | */ |
| | 1313 | do_action( "add_network_option_{$option}", $option, $value, $network_id ); |
| | 1314 | |
| | 1315 | /** |
| 1159 | 1316 | * Fires after a site option has been successfully added. |
| 1160 | 1317 | * |
| 1161 | 1318 | * @since 3.0.0 |
| … |
… |
function add_site_option( $option, $value ) { |
| 1165 | 1322 | */ |
| 1166 | 1323 | do_action( "add_site_option", $option, $value ); |
| 1167 | 1324 | |
| | 1325 | /** |
| | 1326 | * Fires after a network option has been successfully added. |
| | 1327 | * |
| | 1328 | * @since 4.4.0 |
| | 1329 | * |
| | 1330 | * @param string $option Name of site option. |
| | 1331 | * @param mixed $value Value of site option. |
| | 1332 | * @param int $network_id ID of the network. |
| | 1333 | */ |
| | 1334 | do_action( "add_network_option", $option, $value, $network_id ); |
| | 1335 | |
| 1168 | 1336 | return true; |
| 1169 | 1337 | } |
| 1170 | 1338 | return false; |
| 1171 | 1339 | } |
| 1172 | 1340 | |
| 1173 | 1341 | /** |
| 1174 | | * Removes site option by name. |
| | 1342 | * Removes network option by name. |
| 1175 | 1343 | * |
| 1176 | | * @since 2.8.0 |
| | 1344 | * @since 4.4.0 |
| 1177 | 1345 | * |
| 1178 | 1346 | * @see delete_option() |
| 1179 | 1347 | * |
| 1180 | 1348 | * @global wpdb $wpdb |
| 1181 | 1349 | * |
| 1182 | | * @param string $option Name of option to remove. Expected to not be SQL-escaped. |
| | 1350 | * @param string $option Name of option to remove. Expected to not be SQL-escaped. |
| | 1351 | * @param int|bool $network_id ID of the network. |
| 1183 | 1352 | * @return bool True, if succeed. False, if failure. |
| 1184 | 1353 | */ |
| 1185 | | function delete_site_option( $option ) { |
| | 1354 | function delete_network_option( $option, $network_id = false ) { |
| 1186 | 1355 | global $wpdb; |
| 1187 | 1356 | |
| | 1357 | /** If network ID not set, get current network. **/ |
| | 1358 | if( false === $network_id && is_multisite() ){ |
| | 1359 | $current_network = get_current_site(); |
| | 1360 | $network_id = $current_network->id; |
| | 1361 | } |
| | 1362 | /** Make sure network id is an int */ |
| | 1363 | $network_id = (int) $network_id; |
| | 1364 | |
| 1188 | 1365 | // ms_protect_special_option( $option ); @todo |
| 1189 | 1366 | |
| 1190 | 1367 | /** |
| … |
… |
function delete_site_option( $option ) { |
| 1199 | 1376 | */ |
| 1200 | 1377 | do_action( 'pre_delete_site_option_' . $option, $option ); |
| 1201 | 1378 | |
| | 1379 | /** |
| | 1380 | * Fires immediately before a specific network option is deleted. |
| | 1381 | * |
| | 1382 | * The dynamic portion of the hook name, `$option`, refers to the option name. |
| | 1383 | * |
| | 1384 | * @since 4.4.0 The `$option` parameter was added |
| | 1385 | * |
| | 1386 | * @param string $option Option name. |
| | 1387 | * @param int $network_id ID of the network. |
| | 1388 | */ |
| | 1389 | do_action( 'pre_delete_network_option_' . $option, $option, $network_id ); |
| | 1390 | |
| 1202 | 1391 | if ( !is_multisite() ) { |
| 1203 | 1392 | $result = delete_option( $option ); |
| 1204 | 1393 | } else { |
| 1205 | | $row = $wpdb->get_row( $wpdb->prepare( "SELECT meta_id FROM {$wpdb->sitemeta} WHERE meta_key = %s AND site_id = %d", $option, $wpdb->siteid ) ); |
| | 1394 | $row = $wpdb->get_row( $wpdb->prepare( "SELECT meta_id FROM {$wpdb->sitemeta} WHERE meta_key = %s AND site_id = %d", $option, $network_id ) ); |
| 1206 | 1395 | if ( is_null( $row ) || !$row->meta_id ) |
| 1207 | 1396 | return false; |
| 1208 | | $cache_key = "{$wpdb->siteid}:$option"; |
| | 1397 | $cache_key = "{$network_id}:$option"; |
| 1209 | 1398 | wp_cache_delete( $cache_key, 'site-options' ); |
| 1210 | 1399 | |
| 1211 | | $result = $wpdb->delete( $wpdb->sitemeta, array( 'meta_key' => $option, 'site_id' => $wpdb->siteid ) ); |
| | 1400 | $result = $wpdb->delete( $wpdb->sitemeta, array( 'meta_key' => $option, 'site_id' => $network_id ) ); |
| 1212 | 1401 | } |
| 1213 | 1402 | |
| 1214 | 1403 | if ( $result ) { |
| … |
… |
function delete_site_option( $option ) { |
| 1226 | 1415 | do_action( "delete_site_option_{$option}", $option ); |
| 1227 | 1416 | |
| 1228 | 1417 | /** |
| | 1418 | * Fires after a specific network option has been deleted. |
| | 1419 | * |
| | 1420 | * The dynamic portion of the hook name, `$option`, refers to the option name. |
| | 1421 | * |
| | 1422 | * @since 4.4.0 |
| | 1423 | * |
| | 1424 | * @param string $option Name of the site option. |
| | 1425 | * @param int $network_id ID of the network. |
| | 1426 | */ |
| | 1427 | do_action( "delete_network_option_{$option}", $option, $network_id ); |
| | 1428 | |
| | 1429 | /** |
| 1229 | 1430 | * Fires after a site option has been deleted. |
| 1230 | 1431 | * |
| 1231 | 1432 | * @since 3.0.0 |
| … |
… |
function delete_site_option( $option ) { |
| 1234 | 1435 | */ |
| 1235 | 1436 | do_action( "delete_site_option", $option ); |
| 1236 | 1437 | |
| | 1438 | /** |
| | 1439 | * Fires after a network option has been deleted. |
| | 1440 | * |
| | 1441 | * @since 4.4.0 |
| | 1442 | * |
| | 1443 | * @param string $option Name of the site option. |
| | 1444 | * @param int $network_id ID of the network. |
| | 1445 | */ |
| | 1446 | do_action( "delete_network_option", $option, $network_id ); |
| | 1447 | |
| 1237 | 1448 | return true; |
| 1238 | 1449 | } |
| 1239 | 1450 | return false; |
| 1240 | 1451 | } |
| 1241 | 1452 | |
| 1242 | 1453 | /** |
| 1243 | | * Update the value of a site option that was already added. |
| | 1454 | * Update the value of a network option that was already added. |
| 1244 | 1455 | * |
| 1245 | | * @since 2.8.0 |
| | 1456 | * @since 4.4.0 |
| 1246 | 1457 | * |
| 1247 | 1458 | * @see update_option() |
| 1248 | 1459 | * |
| … |
… |
function delete_site_option( $option ) { |
| 1250 | 1461 | * |
| 1251 | 1462 | * @param string $option Name of option. Expected to not be SQL-escaped. |
| 1252 | 1463 | * @param mixed $value Option value. Expected to not be SQL-escaped. |
| | 1464 | * @param int|bool $network_id ID of the network. |
| 1253 | 1465 | * @return bool False if value was not updated and true if value was updated. |
| 1254 | 1466 | */ |
| 1255 | | function update_site_option( $option, $value ) { |
| | 1467 | function update_network_option( $option, $value, $network_id = false ) { |
| 1256 | 1468 | global $wpdb; |
| 1257 | 1469 | |
| | 1470 | /** If network ID not set, get current network. **/ |
| | 1471 | if( false === $network_id && is_multisite() ){ |
| | 1472 | $current_network = get_current_site(); |
| | 1473 | $network_id = $current_network->id; |
| | 1474 | } |
| | 1475 | /** Make sure network id is an int */ |
| | 1476 | $network_id = (int) $network_id; |
| | 1477 | |
| 1258 | 1478 | wp_protect_special_option( $option ); |
| 1259 | 1479 | |
| 1260 | | $old_value = get_site_option( $option ); |
| | 1480 | $old_value = get_network_option( $option, false, $network_id ); |
| 1261 | 1481 | |
| 1262 | 1482 | /** |
| 1263 | 1483 | * Filter a specific site option before its value is updated. |
| … |
… |
function update_site_option( $option, $value ) { |
| 1277 | 1497 | if ( $value === $old_value ) |
| 1278 | 1498 | return false; |
| 1279 | 1499 | |
| | 1500 | /** |
| | 1501 | * Filter a specific network option before its value is updated. |
| | 1502 | * |
| | 1503 | * The dynamic portion of the hook name, `$option`, refers to the option name. |
| | 1504 | * |
| | 1505 | * @since 4.4.0 |
| | 1506 | * |
| | 1507 | * @param mixed $value New value of site option. |
| | 1508 | * @param mixed $old_value Old value of site option. |
| | 1509 | * @param string $option Option name. |
| | 1510 | * @param int $network_id ID of the network. |
| | 1511 | */ |
| | 1512 | $value = apply_filters( 'pre_update_network_option_' . $option, $value, $old_value, $option, $network_id ); |
| | 1513 | |
| | 1514 | if ( $value === $old_value ) |
| | 1515 | return false; |
| | 1516 | |
| 1280 | 1517 | if ( false === $old_value ) |
| 1281 | | return add_site_option( $option, $value ); |
| | 1518 | return add_network_option( $option, $value, $network_id ); |
| 1282 | 1519 | |
| 1283 | | $notoptions_key = "{$wpdb->siteid}:notoptions"; |
| | 1520 | $notoptions_key = "{$network_id}:notoptions"; |
| 1284 | 1521 | $notoptions = wp_cache_get( $notoptions_key, 'site-options' ); |
| 1285 | 1522 | if ( is_array( $notoptions ) && isset( $notoptions[$option] ) ) { |
| 1286 | 1523 | unset( $notoptions[$option] ); |
| … |
… |
function update_site_option( $option, $value ) { |
| 1293 | 1530 | $value = sanitize_option( $option, $value ); |
| 1294 | 1531 | |
| 1295 | 1532 | $serialized_value = maybe_serialize( $value ); |
| 1296 | | $result = $wpdb->update( $wpdb->sitemeta, array( 'meta_value' => $serialized_value ), array( 'site_id' => $wpdb->siteid, 'meta_key' => $option ) ); |
| | 1533 | $result = $wpdb->update( $wpdb->sitemeta, array( 'meta_value' => $serialized_value ), array( 'site_id' => $network_id, 'meta_key' => $option ) ); |
| 1297 | 1534 | |
| 1298 | 1535 | if ( $result ) { |
| 1299 | | $cache_key = "{$wpdb->siteid}:$option"; |
| | 1536 | $cache_key = "{$network_id}:$option"; |
| 1300 | 1537 | wp_cache_set( $cache_key, $value, 'site-options' ); |
| 1301 | 1538 | } |
| 1302 | 1539 | } |
| … |
… |
function update_site_option( $option, $value ) { |
| 1317 | 1554 | */ |
| 1318 | 1555 | do_action( "update_site_option_{$option}", $option, $value, $old_value ); |
| 1319 | 1556 | |
| | 1557 | |
| | 1558 | /** |
| | 1559 | * Fires after the value of a specific network option has been successfully updated. |
| | 1560 | * |
| | 1561 | * The dynamic portion of the hook name, `$option`, refers to the option name. |
| | 1562 | * |
| | 1563 | * @since 4.4.0 |
| | 1564 | * |
| | 1565 | * @param string $option Name of site option. |
| | 1566 | * @param mixed $value Current value of site option. |
| | 1567 | * @param mixed $old_value Old value of site option. |
| | 1568 | * @param int $network_id ID of the network. |
| | 1569 | */ |
| | 1570 | do_action( "update_network_option_{$option}", $option, $value, $old_value, $network_id ); |
| | 1571 | |
| | 1572 | /** |
| | 1573 | * Fires after the value of a specific network option has been successfully updated. |
| | 1574 | * |
| | 1575 | * The dynamic portion of the hook name, `$option`, refers to the option name. |
| | 1576 | * |
| | 1577 | * @since 4.4.0 |
| | 1578 | * |
| | 1579 | * @param string $option Name of site option. |
| | 1580 | * @param mixed $value Current value of site option. |
| | 1581 | * @param mixed $old_value Old value of site option. |
| | 1582 | * @param int $network_id ID of the network. |
| | 1583 | */ |
| | 1584 | do_action( "update_network_option_{$option}", $option, $value, $old_value, $network_id ); |
| | 1585 | |
| 1320 | 1586 | /** |
| 1321 | 1587 | * Fires after the value of a site option has been successfully updated. |
| 1322 | 1588 | * |
| … |
… |
function update_site_option( $option, $value ) { |
| 1328 | 1594 | */ |
| 1329 | 1595 | do_action( "update_site_option", $option, $value, $old_value ); |
| 1330 | 1596 | |
| | 1597 | /** |
| | 1598 | * Fires after the value of a network option has been successfully updated. |
| | 1599 | * |
| | 1600 | * @since 4.4.0 |
| | 1601 | * |
| | 1602 | * @param string $option Name of site option. |
| | 1603 | * @param mixed $value Current value of site option. |
| | 1604 | * @param mixed $old_value Old value of site option. |
| | 1605 | * @param int $network_id ID of the network. |
| | 1606 | */ |
| | 1607 | do_action( "update_network_option", $option, $value, $old_value, $network_id ); |
| | 1608 | |
| 1331 | 1609 | return true; |
| 1332 | 1610 | } |
| 1333 | 1611 | return false; |
| … |
… |
function delete_site_transient( $transient ) { |
| 1359 | 1637 | } else { |
| 1360 | 1638 | $option_timeout = '_site_transient_timeout_' . $transient; |
| 1361 | 1639 | $option = '_site_transient_' . $transient; |
| 1362 | | $result = delete_site_option( $option ); |
| | 1640 | $result = delete_network_option( $option ); |
| 1363 | 1641 | if ( $result ) |
| 1364 | | delete_site_option( $option_timeout ); |
| | 1642 | delete_network_option( $option_timeout ); |
| 1365 | 1643 | } |
| 1366 | 1644 | if ( $result ) { |
| 1367 | 1645 | |
| … |
… |
function get_site_transient( $transient ) { |
| 1422 | 1700 | $transient_option = '_site_transient_' . $transient; |
| 1423 | 1701 | if ( ! in_array( $transient, $no_timeout ) ) { |
| 1424 | 1702 | $transient_timeout = '_site_transient_timeout_' . $transient; |
| 1425 | | $timeout = get_site_option( $transient_timeout ); |
| | 1703 | $timeout = get_network_option( $transient_timeout ); |
| 1426 | 1704 | if ( false !== $timeout && $timeout < time() ) { |
| 1427 | | delete_site_option( $transient_option ); |
| 1428 | | delete_site_option( $transient_timeout ); |
| | 1705 | delete_network_option( $transient_option ); |
| | 1706 | delete_network_option( $transient_timeout ); |
| 1429 | 1707 | $value = false; |
| 1430 | 1708 | } |
| 1431 | 1709 | } |
| 1432 | 1710 | |
| 1433 | 1711 | if ( ! isset( $value ) ) |
| 1434 | | $value = get_site_option( $transient_option ); |
| | 1712 | $value = get_network_option( $transient_option ); |
| 1435 | 1713 | } |
| 1436 | 1714 | |
| 1437 | 1715 | /** |
| … |
… |
function set_site_transient( $transient, $value, $expiration = 0 ) { |
| 1486 | 1764 | } else { |
| 1487 | 1765 | $transient_timeout = '_site_transient_timeout_' . $transient; |
| 1488 | 1766 | $option = '_site_transient_' . $transient; |
| 1489 | | if ( false === get_site_option( $option ) ) { |
| | 1767 | if ( false === get_network_option( $option ) ) { |
| 1490 | 1768 | if ( $expiration ) |
| 1491 | | add_site_option( $transient_timeout, time() + $expiration ); |
| 1492 | | $result = add_site_option( $option, $value ); |
| | 1769 | add_network_option( $transient_timeout, time() + $expiration ); |
| | 1770 | $result = add_network_option( $option, $value ); |
| 1493 | 1771 | } else { |
| 1494 | 1772 | if ( $expiration ) |
| 1495 | | update_site_option( $transient_timeout, time() + $expiration ); |
| 1496 | | $result = update_site_option( $option, $value ); |
| | 1773 | update_network_option( $transient_timeout, time() + $expiration ); |
| | 1774 | $result = update_network_option( $option, $value ); |
| 1497 | 1775 | } |
| 1498 | 1776 | } |
| 1499 | 1777 | if ( $result ) { |
-
diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php
index afccae9..24f77e3 100644
|
a
|
b
|
function wp_salt( $scheme = 'auth' ) { |
| 1961 | 1961 | if ( defined( $const ) && constant( $const ) && empty( $duplicated_keys[ constant( $const ) ] ) ) { |
| 1962 | 1962 | $values[ $type ] = constant( $const ); |
| 1963 | 1963 | } elseif ( ! $values[ $type ] ) { |
| 1964 | | $values[ $type ] = get_site_option( "{$scheme}_{$type}" ); |
| | 1964 | $values[ $type ] = get_network_option( "{$scheme}_{$type}" ); |
| 1965 | 1965 | if ( ! $values[ $type ] ) { |
| 1966 | 1966 | $values[ $type ] = wp_generate_password( 64, true, true ); |
| 1967 | | update_site_option( "{$scheme}_{$type}", $values[ $type ] ); |
| | 1967 | update_network_option( "{$scheme}_{$type}", $values[ $type ] ); |
| 1968 | 1968 | } |
| 1969 | 1969 | } |
| 1970 | 1970 | } |
| 1971 | 1971 | } else { |
| 1972 | 1972 | if ( ! $values['key'] ) { |
| 1973 | | $values['key'] = get_site_option( 'secret_key' ); |
| | 1973 | $values['key'] = get_network_option( 'secret_key' ); |
| 1974 | 1974 | if ( ! $values['key'] ) { |
| 1975 | 1975 | $values['key'] = wp_generate_password( 64, true, true ); |
| 1976 | | update_site_option( 'secret_key', $values['key'] ); |
| | 1976 | update_network_option( 'secret_key', $values['key'] ); |
| 1977 | 1977 | } |
| 1978 | 1978 | } |
| 1979 | 1979 | $values['salt'] = hash_hmac( 'md5', $scheme, $values['key'] ); |
-
diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php
index a3a1a56..98a8e5f 100644
|
a
|
b
|
function script_concat_settings() { |
| 1149 | 1149 | |
| 1150 | 1150 | if ( ! isset($compress_scripts) ) { |
| 1151 | 1151 | $compress_scripts = defined('COMPRESS_SCRIPTS') ? COMPRESS_SCRIPTS : true; |
| 1152 | | if ( $compress_scripts && ( ! get_site_option('can_compress_scripts') || $compressed_output ) ) |
| | 1152 | if ( $compress_scripts && ( ! get_network_option('can_compress_scripts') || $compressed_output ) ) |
| 1153 | 1153 | $compress_scripts = false; |
| 1154 | 1154 | } |
| 1155 | 1155 | |
| 1156 | 1156 | if ( ! isset($compress_css) ) { |
| 1157 | 1157 | $compress_css = defined('COMPRESS_CSS') ? COMPRESS_CSS : true; |
| 1158 | | if ( $compress_css && ( ! get_site_option('can_compress_scripts') || $compressed_output ) ) |
| | 1158 | if ( $compress_css && ( ! get_network_option('can_compress_scripts') || $compressed_output ) ) |
| 1159 | 1159 | $compress_css = false; |
| 1160 | 1160 | } |
| 1161 | 1161 | } |
-
diff --git a/wp-includes/user-functions.php b/wp-includes/user-functions.php
index 8015d1c..bbe1bcb 100644
|
a
|
b
|
function _get_additional_user_keys( $user ) { |
| 1773 | 1773 | */ |
| 1774 | 1774 | function wp_get_user_contact_methods( $user = null ) { |
| 1775 | 1775 | $methods = array(); |
| 1776 | | if ( get_site_option( 'initial_db_version' ) < 23588 ) { |
| | 1776 | if ( get_network_option( 'initial_db_version' ) < 23588 ) { |
| 1777 | 1777 | $methods = array( |
| 1778 | 1778 | 'aim' => __( 'AIM' ), |
| 1779 | 1779 | 'yim' => __( 'Yahoo IM' ), |
-
diff --git a/wp-signup.php b/wp-signup.php
index fa88ba9..f939dc9 100644
|
a
|
b
|
add_action( 'wp_head', 'wp_no_robots' ); |
| 7 | 7 | |
| 8 | 8 | require( dirname( __FILE__ ) . '/wp-blog-header.php' ); |
| 9 | 9 | |
| 10 | | if ( is_array( get_site_option( 'illegal_names' )) && isset( $_GET[ 'new' ] ) && in_array( $_GET[ 'new' ], get_site_option( 'illegal_names' ) ) ) { |
| | 10 | if ( is_array( get_network_option( 'illegal_names' )) && isset( $_GET[ 'new' ] ) && in_array( $_GET[ 'new' ], get_network_option( 'illegal_names' ) ) ) { |
| 11 | 11 | wp_redirect( network_home_url() ); |
| 12 | 12 | die(); |
| 13 | 13 | } |
| … |
… |
function confirm_blog_signup( $domain, $path, $blog_title, $user_name = '', $use |
| 643 | 643 | } |
| 644 | 644 | |
| 645 | 645 | // Main |
| 646 | | $active_signup = get_site_option( 'registration', 'none' ); |
| | 646 | $active_signup = get_network_option( 'registration', 'none' ); |
| 647 | 647 | /** |
| 648 | 648 | * Filter the type of site sign-up. |
| 649 | 649 | * |