Changeset 34912 for trunk/src/wp-includes/ms-functions.php
- Timestamp:
- 10/07/2015 05:11:01 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ms-functions.php
r34854 r34912 101 101 */ 102 102 function get_user_count() { 103 return get_ network_option( 'user_count' );103 return get_site_option( 'user_count' ); 104 104 } 105 105 … … 118 118 _deprecated_argument( __FUNCTION__, '3.1' ); 119 119 120 return get_ network_option( 'blog_count' );120 return get_site_option( 'blog_count' ); 121 121 } 122 122 … … 345 345 */ 346 346 function is_email_address_unsafe( $user_email ) { 347 $banned_names = get_ network_option( 'banned_email_domains' );347 $banned_names = get_site_option( 'banned_email_domains' ); 348 348 if ( $banned_names && ! is_array( $banned_names ) ) 349 349 $banned_names = explode( "\n", $banned_names ); … … 423 423 $errors->add('user_name', __( 'Please enter a username.' ) ); 424 424 425 $illegal_names = get_ network_option( 'illegal_names' );425 $illegal_names = get_site_option( 'illegal_names' ); 426 426 if ( ! is_array( $illegal_names ) ) { 427 427 $illegal_names = array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' ); 428 add_ network_option( 'illegal_names', $illegal_names );428 add_site_option( 'illegal_names', $illegal_names ); 429 429 } 430 430 if ( in_array( $user_name, $illegal_names ) ) … … 451 451 $errors->add('user_email', __( 'Please enter a valid email address.' ) ); 452 452 453 $limited_email_domains = get_ network_option( 'limited_email_domains' );453 $limited_email_domains = get_site_option( 'limited_email_domains' ); 454 454 if ( is_array( $limited_email_domains ) && ! empty( $limited_email_domains ) ) { 455 455 $emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) ); … … 545 545 546 546 $errors = new WP_Error(); 547 $illegal_names = get_ network_option( 'illegal_names' );547 $illegal_names = get_site_option( 'illegal_names' ); 548 548 if ( $illegal_names == false ) { 549 549 $illegal_names = array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' ); 550 add_ network_option( 'illegal_names', $illegal_names );550 add_site_option( 'illegal_names', $illegal_names ); 551 551 } 552 552 … … 790 790 791 791 $activate_url = esc_url($activate_url); 792 $admin_email = get_ network_option( 'admin_email' );792 $admin_email = get_site_option( 'admin_email' ); 793 793 if ( $admin_email == '' ) 794 794 $admin_email = 'support@' . $_SERVER['SERVER_NAME']; 795 $from_name = get_ network_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_network_option( 'site_name' ) );795 $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) ); 796 796 $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; 797 797 $message = sprintf( … … 883 883 884 884 // Send email with activation link. 885 $admin_email = get_ network_option( 'admin_email' );885 $admin_email = get_site_option( 'admin_email' ); 886 886 if ( $admin_email == '' ) 887 887 $admin_email = 'support@' . $_SERVER['SERVER_NAME']; 888 $from_name = get_ network_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_network_option( 'site_name' ) );888 $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) ); 889 889 $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; 890 890 $message = sprintf( … … 1125 1125 } 1126 1126 1127 add_option( 'WPLANG', get_ network_option( 'WPLANG' ) );1127 add_option( 'WPLANG', get_site_option( 'WPLANG' ) ); 1128 1128 update_option( 'blog_public', (int) $meta['public'] ); 1129 1129 … … 1161 1161 */ 1162 1162 function newblog_notify_siteadmin( $blog_id, $deprecated = '' ) { 1163 if ( get_ network_option( 'registrationnotification' ) != 'yes' )1163 if ( get_site_option( 'registrationnotification' ) != 'yes' ) 1164 1164 return false; 1165 1165 1166 $email = get_ network_option( 'admin_email' );1166 $email = get_site_option( 'admin_email' ); 1167 1167 if ( is_email($email) == false ) 1168 1168 return false; … … 1206 1206 */ 1207 1207 function newuser_notify_siteadmin( $user_id ) { 1208 if ( get_ network_option( 'registrationnotification' ) != 'yes' )1208 if ( get_site_option( 'registrationnotification' ) != 'yes' ) 1209 1209 return false; 1210 1210 1211 $email = get_ network_option( 'admin_email' );1211 $email = get_site_option( 'admin_email' ); 1212 1212 1213 1213 if ( is_email($email) == false ) … … 1345 1345 update_option( 'home', $url ); 1346 1346 1347 if ( get_ network_option( 'ms_files_rewriting' ) )1347 if ( get_site_option( 'ms_files_rewriting' ) ) 1348 1348 update_option( 'upload_path', UPLOADBLOGSDIR . "/$blog_id/files" ); 1349 1349 else … … 1421 1421 return false; 1422 1422 1423 $welcome_email = get_ network_option( 'welcome_email' );1423 $welcome_email = get_site_option( 'welcome_email' ); 1424 1424 if ( $welcome_email == false ) { 1425 1425 /* translators: Do not translate USERNAME, SITE_NAME, BLOG_URL, PASSWORD: those are placeholders. */ … … 1464 1464 */ 1465 1465 $welcome_email = apply_filters( 'update_welcome_email', $welcome_email, $blog_id, $user_id, $password, $title, $meta ); 1466 $admin_email = get_ network_option( 'admin_email' );1466 $admin_email = get_site_option( 'admin_email' ); 1467 1467 1468 1468 if ( $admin_email == '' ) 1469 1469 $admin_email = 'support@' . $_SERVER['SERVER_NAME']; 1470 1470 1471 $from_name = get_ network_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_network_option( 'site_name' ) );1471 $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) ); 1472 1472 $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; 1473 1473 $message = $welcome_email; … … 1520 1520 return false; 1521 1521 1522 $welcome_email = get_ network_option( 'welcome_user_email' );1522 $welcome_email = get_site_option( 'welcome_user_email' ); 1523 1523 1524 1524 $user = get_userdata( $user_id ); … … 1542 1542 $welcome_email = str_replace( 'LOGINLINK', wp_login_url(), $welcome_email ); 1543 1543 1544 $admin_email = get_ network_option( 'admin_email' );1544 $admin_email = get_site_option( 'admin_email' ); 1545 1545 1546 1546 if ( $admin_email == '' ) 1547 1547 $admin_email = 'support@' . $_SERVER['SERVER_NAME']; 1548 1548 1549 $from_name = get_ network_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_network_option( 'site_name' ) );1549 $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) ); 1550 1550 $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; 1551 1551 $message = $welcome_email; … … 1719 1719 */ 1720 1720 function check_upload_mimes( $mimes ) { 1721 $site_exts = explode( ' ', get_ network_option( 'upload_filetypes', 'jpg jpeg png gif' ) );1721 $site_exts = explode( ' ', get_site_option( 'upload_filetypes', 'jpg jpeg png gif' ) ); 1722 1722 $site_mimes = array(); 1723 1723 foreach ( $site_exts as $ext ) { … … 1860 1860 */ 1861 1861 function upload_is_file_too_big( $upload ) { 1862 if ( ! is_array( $upload ) || defined( 'WP_IMPORTING' ) || get_ network_option( 'upload_space_check_disabled' ) )1862 if ( ! is_array( $upload ) || defined( 'WP_IMPORTING' ) || get_site_option( 'upload_space_check_disabled' ) ) 1863 1863 return $upload; 1864 1864 1865 if ( strlen( $upload['bits'] ) > ( 1024 * get_ network_option( 'fileupload_maxk', 1500 ) ) )1866 return sprintf( __( 'This file is too big. Files must be less than %d KB in size.' ) . '<br />', get_ network_option( 'fileupload_maxk', 1500 ));1865 if ( strlen( $upload['bits'] ) > ( 1024 * get_site_option( 'fileupload_maxk', 1500 ) ) ) 1866 return sprintf( __( 'This file is too big. Files must be less than %d KB in size.' ) . '<br />', get_site_option( 'fileupload_maxk', 1500 )); 1867 1867 1868 1868 return $upload; … … 2077 2077 */ 2078 2078 function users_can_register_signup_filter() { 2079 $registration = get_ network_option( 'registration');2079 $registration = get_site_option('registration'); 2080 2080 return ( $registration == 'all' || $registration == 'user' ); 2081 2081 } … … 2106 2106 2107 2107 --The Team @ SITE_NAME' ); 2108 update_ network_option( 'welcome_user_email', $text );2108 update_site_option( 'welcome_user_email', $text ); 2109 2109 } 2110 2110 return $text; … … 2232 2232 2233 2233 $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) ); 2234 update_ network_option( 'blog_count', $count );2234 update_site_option( 'blog_count', $count ); 2235 2235 } 2236 2236 … … 2246 2246 2247 2247 $count = $wpdb->get_var( "SELECT COUNT(ID) as c FROM $wpdb->users WHERE spam = '0' AND deleted = '0'" ); 2248 update_ network_option( 'user_count', $count );2248 update_site_option( 'user_count', $count ); 2249 2249 } 2250 2250 … … 2284 2284 2285 2285 if ( ! is_numeric( $space_allowed ) ) 2286 $space_allowed = get_ network_option( 'blog_upload_space' );2286 $space_allowed = get_site_option( 'blog_upload_space' ); 2287 2287 2288 2288 if ( empty( $space_allowed ) || ! is_numeric( $space_allowed ) ) … … 2312 2312 } 2313 2313 $space_allowed = $allowed * 1024 * 1024; 2314 if ( get_ network_option( 'upload_space_check_disabled' ) )2314 if ( get_site_option( 'upload_space_check_disabled' ) ) 2315 2315 return $space_allowed; 2316 2316 … … 2330 2330 */ 2331 2331 function is_upload_space_available() { 2332 if ( get_ network_option( 'upload_space_check_disabled' ) )2332 if ( get_site_option( 'upload_space_check_disabled' ) ) 2333 2333 return true; 2334 2334 … … 2342 2342 */ 2343 2343 function upload_size_limit_filter( $size ) { 2344 $fileupload_maxk = 1024 * get_ network_option( 'fileupload_maxk', 1500 );2345 if ( get_ network_option( 'upload_space_check_disabled' ) )2344 $fileupload_maxk = 1024 * get_site_option( 'fileupload_maxk', 1500 ); 2345 if ( get_site_option( 'upload_space_check_disabled' ) ) 2346 2346 return min( $size, $fileupload_maxk ); 2347 2347
Note: See TracChangeset
for help on using the changeset viewer.