Skip to content

Commit

Permalink
Docs: Correct the placement of @global tags in various files.
Browse files Browse the repository at this point in the history
Follow-up to [6589], [8598], [10798], [25490], [25594], [31192], [31194], [35718], [37437], [44169], [44948], [45247], [56763], [56773], [57370], [57503].

Props shailu25.
Fixes #61295.

git-svn-id: https://develop.svn.wordpress.org/trunk@58200 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed May 26, 2024
1 parent aea04bd commit 1025e34
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/wp-admin/export.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ function export_add_js() {
/**
* Creates the date options fields for exporting a given post type.
*
* @since 3.1.0
*
* @global wpdb $wpdb WordPress database abstraction object.
* @global WP_Locale $wp_locale WordPress date and time locale object.
*
* @since 3.1.0
*
* @param string $post_type The post type. Default 'post'.
*/
function export_date_options( $post_type = 'post' ) {
Expand Down
3 changes: 1 addition & 2 deletions src/wp-includes/class-wp-locale.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,14 @@ public function get_meridiem( $meridiem ) {
*
* For backward compatibility only.
*
* @since 2.1.0
* @deprecated For backward compatibility only.
*
* @global array $weekday
* @global array $weekday_initial
* @global array $weekday_abbrev
* @global array $month
* @global array $month_abbrev
*
* @since 2.1.0
*/
public function register_globals() {
$GLOBALS['weekday'] = $this->weekday;
Expand Down
4 changes: 2 additions & 2 deletions src/wp-includes/feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -697,10 +697,10 @@ function self_link() {
* If viewing a comment feed, the time of the most recently modified
* comment will be returned.
*
* @global WP_Query $wp_query WordPress Query object.
*
* @since 5.2.0
*
* @global WP_Query $wp_query WordPress Query object.
*
* @param string $format Date format string to return the time in.
* @return string|false The time in requested format, or false on failure.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/wp-includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4762,10 +4762,10 @@ function wp_is_serving_rest_request() {
* the description. Probably should create a Codex page for it, so that it is
* available.
*
* @since 2.2.0
*
* @global array $wpsmiliestrans
* @global array $wp_smiliessearch
*
* @since 2.2.0
*/
function smilies_init() {
global $wpsmiliestrans, $wp_smiliessearch;
Expand Down
12 changes: 6 additions & 6 deletions src/wp-includes/functions.wp-scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
/**
* Initializes $wp_scripts if it has not been set.
*
* @global WP_Scripts $wp_scripts
*
* @since 4.2.0
*
* @global WP_Scripts $wp_scripts
*
* @return WP_Scripts WP_Scripts instance.
*/
function wp_scripts() {
Expand Down Expand Up @@ -77,10 +77,10 @@ function _wp_scripts_maybe_doing_it_wrong( $function_name, $handle = '' ) {
* hook to register/enqueue new scripts.
*
* @see WP_Scripts::do_item()
* @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts.
*
* @since 2.1.0
*
* @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts.
*
* @param string|string[]|false $handles Optional. Scripts to be printed. Default 'false'.
* @return string[] On success, an array of handles of processed WP_Dependencies items; otherwise, an empty array.
*/
Expand Down Expand Up @@ -234,11 +234,11 @@ function wp_localize_script( $handle, $object_name, $l10n ) {
* Works only if the script has already been registered.
*
* @see WP_Scripts::set_translations()
* @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts.
*
* @since 5.0.0
* @since 5.1.0 The `$domain` parameter was made optional.
*
* @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts.
*
* @param string $handle Script handle the textdomain will be attached to.
* @param string $domain Optional. Text domain. Default 'default'.
* @param string $path Optional. The full file path to the directory containing translation files.
Expand Down
8 changes: 4 additions & 4 deletions src/wp-includes/functions.wp-styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
/**
* Initializes $wp_styles if it has not been set.
*
* @global WP_Styles $wp_styles
*
* @since 4.2.0
*
* @global WP_Styles $wp_styles
*
* @return WP_Styles WP_Styles instance.
*/
function wp_styles() {
Expand All @@ -34,10 +34,10 @@ function wp_styles() {
* passing an array with one string prints that style,
* and passing an array of strings prints those styles.
*
* @global WP_Styles $wp_styles The WP_Styles object for printing styles.
*
* @since 2.6.0
*
* @global WP_Styles $wp_styles The WP_Styles object for printing styles.
*
* @param string|bool|array $handles Styles to be printed. Default 'false'.
* @return string[] On success, an array of handles of processed WP_Dependencies items; otherwise, an empty array.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/wp-includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -7936,10 +7936,10 @@ function _prime_post_caches( $ids, $update_term_cache = true, $update_meta_cache
/**
* Prime the cache containing the parent ID of various post objects.
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @since 6.4.0
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param int[] $ids ID list.
*/
function _prime_post_parent_id_caches( array $ids ) {
Expand Down
4 changes: 2 additions & 2 deletions src/wp-includes/script-modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* This function provides access to the WP_Script_Modules instance, creating one
* if it doesn't exist yet.
*
* @global WP_Script_Modules $wp_script_modules
*
* @since 6.5.0
*
* @global WP_Script_Modules $wp_script_modules
*
* @return WP_Script_Modules The main WP_Script_Modules instance.
*/
function wp_script_modules(): WP_Script_Modules {
Expand Down
14 changes: 11 additions & 3 deletions src/wp-includes/widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,35 @@
/**
* Stores the sidebars, since many themes can have more than one.
*
* @global array $wp_registered_sidebars The registered sidebars.
* @since 2.2.0
*
* @global array $wp_registered_sidebars The registered sidebars.
*/
$wp_registered_sidebars = array();

/**
* Stores the registered widgets.
*
* @global array $wp_registered_widgets The registered widgets.
* @since 2.2.0
*
* @global array $wp_registered_widgets The registered widgets.
*/
$wp_registered_widgets = array();

/**
* Stores the registered widget controls (options).
*
* @global array $wp_registered_widget_controls The registered widget controls.
* @since 2.2.0
*
* @global array $wp_registered_widget_controls The registered widget controls.
*/
$wp_registered_widget_controls = array();

/**
* Stores the registered widget updates.
*
* @since 2.8.0
*
* @global array $wp_registered_widget_updates The registered widget updates.
*/
$wp_registered_widget_updates = array();
Expand Down
3 changes: 2 additions & 1 deletion src/wp-includes/widgets/class-wp-nav-menu-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@ public function update( $new_instance, $old_instance ) {
*
* @since 3.0.0
*
* @param array $instance Current settings.
* @global WP_Customize_Manager $wp_customize
*
* @param array $instance Current settings.
*/
public function form( $instance ) {
global $wp_customize;
Expand Down

0 comments on commit 1025e34

Please sign in to comment.