Skip to content

Commit 362dd81

Browse files
committed
Docs: Systematically add missing @global annotations for global variables
**Trac Ticket:** https://core.trac.wordpress.org/ticket/64224 **Why this change?** This change adds missing @global documentation tags to functions in - src/wp-admin/includes/misc.php - src/wp-admin/includes/template.php - src/wp-admin/includes/schema.php - src/wp-admin/install.php This aligns the codebase with the WordPress PHP Documentation Standards, ensuring that global variables used within functions are properly documented for better static analysis and code clarity. Files Changed: - src/wp-admin/includes/misc.php - src/wp-admin/includes/template.php - src/wp-admin/includes/schema.php - src/wp-admin/install.php
1 parent e36be00 commit 362dd81

4 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/wp-admin/includes/misc.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,9 @@ function wp_make_plugin_file_tree( $plugin_editable_files ) {
492492
* @since 4.9.0
493493
* @access private
494494
*
495+
* @global string $file Path to the file being edited.
496+
* @global string $plugin Path to the plugin file relative to the plugins directory.
497+
*
495498
* @param array|string $tree List of file/folder paths, or filename.
496499
* @param string $label Name of file or folder to print.
497500
* @param int $level The aria-level for the current iteration.

src/wp-admin/includes/schema.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
* Declare these as global in case schema.php is included from a function.
1313
*
1414
* @global wpdb $wpdb WordPress database abstraction object.
15-
* @global array $wp_queries
16-
* @global string $charset_collate
15+
* @global array $wp_queries Global database queries array.
16+
* @global string $charset_collate Database charset and collation.
1717
*/
1818
global $wpdb, $wp_queries, $charset_collate;
1919

src/wp-admin/includes/template.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1628,6 +1628,8 @@ function do_accordion_sections( $screen, $context, $data_object ) {
16281628
* @type string $after_section HTML content to append to the section's HTML output. Default empty.
16291629
* @type string $section_class The class name to use for the section. Default empty.
16301630
* }
1631+
*
1632+
* @global array $wp_settings_sections Global settings sections array.
16311633
*/
16321634
function add_settings_section( $id, $title, $callback, $page, $args = array() ) {
16331635
global $wp_settings_sections;

src/wp-admin/install.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ function display_setup_form( $error = null ) {
342342
/**
343343
* @global string $wp_local_package Locale code of the package.
344344
* @global WP_Locale $wp_locale WordPress date and time locale object.
345+
* @global wpdb $wpdb WordPress database abstraction object.
345346
*/
346347
$language = '';
347348
if ( ! empty( $_REQUEST['language'] ) ) {

0 commit comments

Comments
 (0)