WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/08/2015 09:44:11 PM (4 years ago)
Author:
jeremyfelt
Message:

Make $blog_id explicitly global.

$blog_id is used in both single and multisite configurations as a global variable, though has never been explicitly marked as such in the global scope. This can cause confusion depending on how core is loaded.

Fixes #34217.

File:
1 edited

Legend:

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

    r34928 r34961  
    2929global $wp_version, $wp_db_version, $tinymce_version, $required_php_version, $required_mysql_version;
    3030require( ABSPATH . WPINC . '/version.php' );
     31
     32/**
     33 * If not already configured, `$blog_id` will default to 1 in a single site
     34 * configuration. In multisite, it will be overridden by default in ms-settings.php.
     35 *
     36 * @global int $blog_id
     37 * @since 2.0.0
     38 */
     39global $blog_id;
    3140
    3241// Set initial default constants including WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_DEBUG, SCRIPT_DEBUG, WP_CONTENT_DIR and WP_CACHE.
Note: See TracChangeset for help on using the changeset viewer.