Make WordPress Core


Ignore:
Timestamp:
01/25/2016 09:51:01 PM (8 years ago)
Author:
jeremyfelt
Message:

Multisite: Introduce the WP_Site class.

  • A WP_Site object initially matches a row from wp_blogs.
  • A site can be retrieved by its ID through WP_Site::get_instance().
  • Adds sites to the global cache group and captures instance lookups.
  • The multisite bootstrap now ensures $current_blog is an instance of WP_Site.

Props johnjamesjacoby, jeremyfelt.
See #32450.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-settings.php

    r35782 r36393  
    1313/** WP_Network class */
    1414require_once( ABSPATH . WPINC . '/class-wp-network.php' );
     15
     16/** WP_Site class */
     17require_once( ABSPATH . WPINC . '/class-wp-site.php' );
    1518
    1619/** Multisite loader */
     
    223226}
    224227
     228if ( ! $current_blog instanceof WP_Site ) {
     229    $current_blog = new WP_Site( $current_blog );
     230}
     231
    225232// Define upload directory constants
    226233ms_upload_constants();
Note: See TracChangeset for help on using the changeset viewer.