Changeset 38814 for trunk/src/wp-includes/ms-functions.php
- Timestamp:
- 10/19/2016 04:46:14 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ms-functions.php
r38655 r38814 547 547 global $wpdb, $domain; 548 548 549 $current_ site = get_current_site();550 $base = $current_ site->path;549 $current_network = get_network(); 550 $base = $current_network->path; 551 551 552 552 $blog_title = strip_tags( $blog_title ); … … 581 581 582 582 // do not allow users to create a blog that conflicts with a page on the main blog. 583 if ( !is_subdomain_install() && $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM " . $wpdb->get_blog_prefix( $current_ site->blog_id ) . "posts WHERE post_type = 'page' AND post_name = %s", $blogname ) ) )583 if ( !is_subdomain_install() && $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM " . $wpdb->get_blog_prefix( $current_network->site_id ) . "posts WHERE post_type = 'page' AND post_name = %s", $blogname ) ) ) 584 584 $errors->add( 'blogname', __( 'Sorry, you may not use that site name.' ) ); 585 585 … … 613 613 $path = $base.$blogname.'/'; 614 614 } 615 if ( domain_exists($mydomain, $path, $current_ site->id) )615 if ( domain_exists($mydomain, $path, $current_network->id) ) 616 616 $errors->add( 'blogname', __( 'Sorry, that site already exists!' ) ); 617 617 … … 790 790 791 791 // Send email with activation link. 792 if ( !is_subdomain_install() || get_current_ site()->id!= 1 )792 if ( !is_subdomain_install() || get_current_network_id() != 1 ) 793 793 $activate_url = network_site_url("wp-activate.php?key=$key"); 794 794 else … … 1335 1335 */ 1336 1336 function install_blog( $blog_id, $blog_title = '' ) { 1337 global $wpdb, $wp_roles , $current_site;1337 global $wpdb, $wp_roles; 1338 1338 1339 1339 // Cast for security … … 1364 1364 $siteurl = set_url_scheme( $siteurl, 'https' ); 1365 1365 } 1366 if ( 'https' === parse_url( get_home_url( $current_site->blog_id ), PHP_URL_SCHEME ) ) {1366 if ( 'https' === parse_url( get_home_url( get_network()->site_id ), PHP_URL_SCHEME ) ) { 1367 1367 $home = set_url_scheme( $home, 'https' ); 1368 1368 } … … 1376 1376 update_option( 'upload_path', UPLOADBLOGSDIR . "/$blog_id/files" ); 1377 1377 else 1378 update_option( 'upload_path', get_blog_option( get_ current_site()->blog_id, 'upload_path' ) );1378 update_option( 'upload_path', get_blog_option( get_network()->site_id, 'upload_path' ) ); 1379 1379 1380 1380 update_option( 'blogname', wp_unslash( $blog_title ) ); … … 1431 1431 */ 1432 1432 function wpmu_welcome_notification( $blog_id, $user_id, $password, $title, $meta = array() ) { 1433 $current_ site = get_current_site();1433 $current_network = get_network(); 1434 1434 1435 1435 /** … … 1471 1471 $user = get_userdata( $user_id ); 1472 1472 1473 $welcome_email = str_replace( 'SITE_NAME', $current_ site->site_name, $welcome_email );1473 $welcome_email = str_replace( 'SITE_NAME', $current_network->site_name, $welcome_email ); 1474 1474 $welcome_email = str_replace( 'BLOG_TITLE', $title, $welcome_email ); 1475 1475 $welcome_email = str_replace( 'BLOG_URL', $url, $welcome_email ); … … 1501 1501 $message = $welcome_email; 1502 1502 1503 if ( empty( $current_ site->site_name ) )1504 $current_ site->site_name = 'WordPress';1503 if ( empty( $current_network->site_name ) ) 1504 $current_network->site_name = 'WordPress'; 1505 1505 1506 1506 /** … … 1511 1511 * @param string $subject Subject of the email. 1512 1512 */ 1513 $subject = apply_filters( 'update_welcome_subject', sprintf( __( 'New %1$s Site: %2$s' ), $current_ site->site_name, wp_unslash( $title ) ) );1513 $subject = apply_filters( 'update_welcome_subject', sprintf( __( 'New %1$s Site: %2$s' ), $current_network->site_name, wp_unslash( $title ) ) ); 1514 1514 wp_mail( $user->user_email, wp_specialchars_decode( $subject ), $message, $message_headers ); 1515 1515 return true; … … 1532 1532 */ 1533 1533 function wpmu_welcome_user_notification( $user_id, $password, $meta = array() ) { 1534 $current_ site = get_current_site();1534 $current_network = get_network(); 1535 1535 1536 1536 /** … … 1565 1565 */ 1566 1566 $welcome_email = apply_filters( 'update_welcome_user_email', $welcome_email, $user_id, $password, $meta ); 1567 $welcome_email = str_replace( 'SITE_NAME', $current_ site->site_name, $welcome_email );1567 $welcome_email = str_replace( 'SITE_NAME', $current_network->site_name, $welcome_email ); 1568 1568 $welcome_email = str_replace( 'USERNAME', $user->user_login, $welcome_email ); 1569 1569 $welcome_email = str_replace( 'PASSWORD', $password, $welcome_email ); … … 1579 1579 $message = $welcome_email; 1580 1580 1581 if ( empty( $current_ site->site_name ) )1582 $current_ site->site_name = 'WordPress';1581 if ( empty( $current_network->site_name ) ) 1582 $current_network->site_name = 'WordPress'; 1583 1583 1584 1584 /** … … 1589 1589 * @param string $subject Subject of the email. 1590 1590 */ 1591 $subject = apply_filters( 'update_welcome_user_subject', sprintf( __( 'New %1$s User: %2$s' ), $current_ site->site_name, $user->user_login) );1591 $subject = apply_filters( 'update_welcome_user_subject', sprintf( __( 'New %1$s User: %2$s' ), $current_network->site_name, $user->user_login) ); 1592 1592 wp_mail( $user->user_email, wp_specialchars_decode( $subject ), $message, $message_headers ); 1593 1593 return true; … … 1878 1878 */ 1879 1879 function redirect_this_site( $deprecated = '' ) { 1880 return array( get_ current_site()->domain );1880 return array( get_network()->domain ); 1881 1881 } 1882 1882 … … 2025 2025 $blog_id = $meta[ 'add_to_blog' ]; 2026 2026 $role = $meta[ 'new_role' ]; 2027 remove_user_from_blog($user_id, get_ current_site()->blog_id); // remove user from main blog.2027 remove_user_from_blog($user_id, get_network()->site_id); // remove user from main blog. 2028 2028 add_user_to_blog( $blog_id, $user_id, $role ); 2029 2029 update_user_meta( $user_id, 'primary_blog', $blog_id ); … … 2039 2039 */ 2040 2040 function fix_phpmailer_messageid( $phpmailer ) { 2041 $phpmailer->Hostname = get_ current_site()->domain;2041 $phpmailer->Hostname = get_network()->domain; 2042 2042 } 2043 2043
Note: See TracChangeset
for help on using the changeset viewer.