Skip to content

Commit

Permalink
Docs: Correct the placement of @global tags in wp-settings.php.
Browse files Browse the repository at this point in the history
Props shailu25, mukesh27.
Fixes #60146.

git-svn-id: https://develop.svn.wordpress.org/trunk@57320 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Jan 20, 2024
1 parent edcc85c commit 74abf14
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions src/wp-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@
* If not already configured, `$blog_id` will default to 1 in a single site
* configuration. In multisite, it will be overridden by default in ms-settings.php.
*
* @global int $blog_id
* @since 2.0.0
*
* @global int $blog_id
*/
global $blog_id;

Expand Down Expand Up @@ -116,8 +117,9 @@
require ABSPATH . WPINC . '/pomo/mo.php';

/**
* @global wpdb $wpdb WordPress database abstraction object.
* @since 0.71
*
* @global wpdb $wpdb WordPress database abstraction object.
*/
global $wpdb;
// Include the wpdb class and, if present, a db.php database drop-in.
Expand Down Expand Up @@ -524,49 +526,55 @@
/**
* WordPress Query object
*
* @global WP_Query $wp_the_query WordPress Query object.
* @since 2.0.0
*
* @global WP_Query $wp_the_query WordPress Query object.
*/
$GLOBALS['wp_the_query'] = new WP_Query();

/**
* Holds the reference to {@see $wp_the_query}.
* Use this global for WordPress queries
*
* @global WP_Query $wp_query WordPress Query object.
* @since 1.5.0
*
* @global WP_Query $wp_query WordPress Query object.
*/
$GLOBALS['wp_query'] = $GLOBALS['wp_the_query'];

/**
* Holds the WordPress Rewrite object for creating pretty URLs
*
* @global WP_Rewrite $wp_rewrite WordPress rewrite component.
* @since 1.5.0
*
* @global WP_Rewrite $wp_rewrite WordPress rewrite component.
*/
$GLOBALS['wp_rewrite'] = new WP_Rewrite();

/**
* WordPress Object
*
* @global WP $wp Current WordPress environment instance.
* @since 2.0.0
*
* @global WP $wp Current WordPress environment instance.
*/
$GLOBALS['wp'] = new WP();

/**
* WordPress Widget Factory Object
*
* @global WP_Widget_Factory $wp_widget_factory
* @since 2.8.0
*
* @global WP_Widget_Factory $wp_widget_factory
*/
$GLOBALS['wp_widget_factory'] = new WP_Widget_Factory();

/**
* WordPress User Roles
*
* @global WP_Roles $wp_roles WordPress role management object.
* @since 2.0.0
*
* @global WP_Roles $wp_roles WordPress role management object.
*/
$GLOBALS['wp_roles'] = new WP_Roles();

Expand All @@ -593,8 +601,9 @@
/**
* WordPress Locale object for loading locale domain date and various strings.
*
* @global WP_Locale $wp_locale WordPress date and time locale object.
* @since 2.1.0
*
* @global WP_Locale $wp_locale WordPress date and time locale object.
*/
$GLOBALS['wp_locale'] = new WP_Locale();

Expand Down

0 comments on commit 74abf14

Please sign in to comment.