WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/19/2016 04:46:14 AM (3 years ago)
Author:
jeremyfelt
Message:

Multisite: Use get_network() and get_current_network_id() for current network data.

get_network() falls back to the current network when called without any arguments. Between this and get_current_network_id(), we can replace almost all instances of the global $current_site and all instances of get_current_site().

This effectively deprecates get_current_site(), something that we'll do in a future ticket.

Props flixos90.
Fixes #37414.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/ms-delete-site.php

    r38633 r38814  
    1919    if ( hash_equals( get_option( 'delete_blog_hash' ), $_GET['h'] ) ) {
    2020        wpmu_delete_blog( $wpdb->blogid );
    21         wp_die( sprintf( __( 'Thank you for using %s, your site has been deleted. Happy trails to you until we meet again.' ), $current_site->site_name ) );
     21        wp_die( sprintf( __( 'Thank you for using %s, your site has been deleted. Happy trails to you until we meet again.' ), get_network()->site_name ) );
    2222    } else {
    2323        wp_die( __( "I'm sorry, the link you clicked is stale. Please select another option." ) );
     
    7171    $content = str_replace( '###USERNAME###', $user->user_login, $content );
    7272    $content = str_replace( '###URL_DELETE###', $url_delete, $content );
    73     $content = str_replace( '###SITE_NAME###', $current_site->site_name, $content );
     73    $content = str_replace( '###SITE_NAME###', get_network()->site_name, $content );
    7474
    7575    wp_mail( get_option( 'admin_email' ), "[ " . wp_specialchars_decode( get_option( 'blogname' ) ) . " ] ".__( 'Delete My Site' ), $content );
     
    8080<?php } else {
    8181    ?>
    82     <p><?php printf( __( 'If you do not want to use your %s site any more, you can delete it using the form below. When you click <strong>Delete My Site Permanently</strong> you will be sent an email with a link in it. Click on this link to delete your site.'), $current_site->site_name); ?></p>
     82    <p><?php printf( __( 'If you do not want to use your %s site any more, you can delete it using the form below. When you click <strong>Delete My Site Permanently</strong> you will be sent an email with a link in it. Click on this link to delete your site.'), get_network()->site_name); ?></p>
    8383    <p><?php _e( 'Remember, once deleted your site cannot be restored.' ) ?></p>
    8484
Note: See TracChangeset for help on using the changeset viewer.