Make WordPress Core


Ignore:
Timestamp:
10/02/2017 01:43:48 AM (7 years ago)
Author:
jeremyfelt
Message:

Multisite: Use get_current_blog_id() instead of $wpdb->blogid.

get_current_blog_id() is more appropriate for determining the ID of the current site in most cases. This eliminates the need for the global $wpdb in several functions and is better than the implicit global used in admin pages.

Props bnap00, spacedmonkey.
Fixes #41684.

File:
1 edited

Legend:

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

    r38961 r41661  
    1818if ( isset( $_GET['h'] ) && $_GET['h'] != '' && get_option( 'delete_blog_hash' ) != false ) {
    1919    if ( hash_equals( get_option( 'delete_blog_hash' ), $_GET['h'] ) ) {
    20         wpmu_delete_blog( $wpdb->blogid );
     20        wpmu_delete_blog( get_current_blog_id() );
    2121        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 {
Note: See TracChangeset for help on using the changeset viewer.