|
1 | 1 | <?php
|
| 2 | +// This is a single network configuration and the network is defined in config.php |
| 3 | +if ( defined( 'DOMAIN_CURRENT_SITE' ) && defined( 'PATH_CURRENT_SITE' ) ) { |
| 4 | + $current_site = new stdClass; |
| 5 | + $current_site->id = defined( 'SITE_ID_CURRENT_SITE' ) ? SITE_ID_CURRENT_SITE : 1; |
| 6 | + $current_site->blog_id = defined( 'BLOG_ID_CURRENT_SITE' ) ? BLOG_ID_CURRENT_SITE : 1; |
| 7 | + $current_site->cookie_domain = defined( 'COOKIE_DOMAIN' ) ? COOKIE_DOMAIN : '.jquery.com'; |
| 8 | + $current_site->domain = DOMAIN_CURRENT_SITE; |
| 9 | + $current_site->path = PATH_CURRENT_SITE; |
| 10 | + $current_site->site_name = 'jQuery'; |
| 11 | +} |
2 | 12 |
|
3 | 13 | if ( isset( $blog_id ) ) {
|
4 |
| - $current_site = wpmu_current_site(); |
5 |
| - if ( ! is_object( $current_site ) ) |
6 |
| - $current_site = new stdClass; |
7 |
| - if ( ! isset( $current_site->site_name ) ) |
8 |
| - $current_site->site_name = 'jQuery'; |
9 | 14 | $current_blog = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE blog_id = %d", $blog_id ) );
|
10 | 15 |
|
| 16 | + // If for some reason this became a multi-network configuration, populate the site's network. |
| 17 | + if ( is_object( $current_blog ) && $current_blog->site_id != $current_site->id ) { |
| 18 | + $current_site = $wpdb->get_row( $wpdb->prepare( "SELECT * from $wpdb->site WHERE id = %d LIMIT 0,1", $current_blog->site_id ) ); |
| 19 | + $current_site->site_name = 'jQuery'; |
| 20 | + } |
| 21 | + |
11 | 22 | // Can't find the site in the DB:
|
12 | 23 | if ( ! is_object( $current_blog ) ) {
|
13 | 24 | $current_blog = new stdClass;
|
|
0 commit comments