Skip to content

Commit 369fb0d

Browse files
t-hamanoclaude
andcommitted
Use richer types for the admin page @global annotations.
Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 4b081fe commit 369fb0d

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

‎src/wp-admin/includes/plugin.php‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,13 +1474,13 @@ function add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $call
14741474
* @since 1.5.0
14751475
* @since 5.3.0 Added the `$position` parameter.
14761476
*
1477-
* @global array $submenu
1478-
* @global array $menu
1479-
* @global array $_wp_real_parent_file
1480-
* @global bool $_wp_submenu_nopriv
1481-
* @global array $_wp_nopriv_pages
1482-
* @global array $_registered_pages
1483-
* @global array $_parent_pages
1477+
* @global array $submenu
1478+
* @global array $menu
1479+
* @global array $_wp_real_parent_file
1480+
* @global array<string, array<string, true>> $_wp_submenu_nopriv
1481+
* @global array<string, true> $_wp_nopriv_pages
1482+
* @global array<string, true> $_registered_pages
1483+
* @global array $_parent_pages
14841484
*
14851485
* @param string $parent_slug The slug name for the parent menu (or the file name of a standard
14861486
* WordPress admin page).
@@ -2149,7 +2149,7 @@ function get_plugin_page_hook( $plugin_page, $parent_page ) {
21492149
*
21502150
* @since 7.2.0
21512151
*
2152-
* @global string $plugin_page The plugin page slug being loaded.
2152+
* @global string|null $plugin_page The plugin page slug being loaded.
21532153
* @global array<string, true> $_registered_pages Array of all registered admin page hooks.
21542154
* @global array<string, true> $_wp_menu_nopriv Array of top-level menu slugs the current user cannot access.
21552155
* @global array<string, array<string, true>> $_wp_submenu_nopriv Array of submenu slugs the current user cannot access, keyed by parent slug.
@@ -2228,8 +2228,8 @@ function get_plugin_page_hookname( $plugin_page, $parent_page ) {
22282228
* @global array $submenu The admin submenu items, keyed by parent slug.
22292229
* @global array<string, true> $_wp_menu_nopriv Array of top-level menu slugs the current user cannot access.
22302230
* @global array<string, array<string, true>> $_wp_submenu_nopriv Array of submenu slugs the current user cannot access, keyed by parent slug.
2231-
* @global string $plugin_page The plugin page slug being loaded.
2232-
* @global array $_registered_pages Array of all registered admin page hooks.
2231+
* @global string|null $plugin_page The plugin page slug being loaded.
2232+
* @global array<string, true> $_registered_pages Array of all registered admin page hooks.
22332233
*
22342234
* @return bool True if the current user can access the admin page, false otherwise.
22352235
*/

0 commit comments

Comments
 (0)