Skip to content

Commit

Permalink
Docs: Add missing description for $pagenow global in various functi…
Browse files Browse the repository at this point in the history
…ons.

See #54729, #55499.

git-svn-id: https://develop.svn.wordpress.org/trunk@53060 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Apr 4, 2022
1 parent 74f4d6b commit 8277055
Show file tree
Hide file tree
Showing 22 changed files with 42 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/wp-admin/admin-header.php
Expand Up @@ -18,7 +18,7 @@
* @global string $hook_suffix
* @global WP_Screen $current_screen WordPress current screen object.
* @global WP_Locale $wp_locale WordPress date and time locale object.
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
* @global string $update_title
* @global int $total_update_count
* @global string $parent_file
Expand Down
10 changes: 5 additions & 5 deletions src/wp-admin/admin.php
Expand Up @@ -116,11 +116,11 @@
wp_enqueue_script( 'common' );

/**
* $pagenow is set in vars.php
* $wp_importers is sometimes set in wp-admin/includes/import.php
* The remaining variables are imported as globals elsewhere, declared as globals here
* $pagenow is set in vars.php.
* $wp_importers is sometimes set in wp-admin/includes/import.php.
* The remaining variables are imported as globals elsewhere, declared as globals here.
*
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
* @global array $wp_importers
* @global string $hook_suffix
* @global string $plugin_page
Expand Down Expand Up @@ -376,7 +376,7 @@
* The load-* hook fires in a number of contexts. This hook is for core screens.
*
* The dynamic portion of the hook name, `$pagenow`, is a global variable
* referring to the filename of the current page, such as 'admin.php',
* referring to the filename of the current screen, such as 'admin.php',
* 'post-new.php' etc. A complete hook for the latter would be
* 'load-post-new.php'.
*
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/bookmark.php
Expand Up @@ -327,7 +327,7 @@ function wp_update_link( $linkdata ) {
* @since 3.5.0
* @access private
*
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
*/
function wp_link_manager_disabled_message() {
global $pagenow;
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/file.php
Expand Up @@ -2146,7 +2146,7 @@ function get_filesystem_method( $args = array(), $context = '', $allow_relaxed_f
* @since 2.5.0
* @since 4.6.0 The `$context` parameter default changed from `false` to an empty string.
*
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
*
* @param string $form_post The URL to post the form to.
* @param string $type Optional. Chosen type of filesystem. Default empty.
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/misc.php
Expand Up @@ -1276,7 +1276,7 @@ function wp_refresh_heartbeat_nonces( $response ) {
*
* @since 3.8.0
*
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
*
* @param array $settings An array of Heartbeat settings.
* @return array Filtered Heartbeat settings.
Expand Down
4 changes: 2 additions & 2 deletions src/wp-admin/includes/ms.php
Expand Up @@ -692,7 +692,7 @@ function mu_dropdown_languages( $lang_files = array(), $current = '' ) {
* @since 3.0.0
*
* @global int $wp_db_version WordPress database version.
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
*
* @return void|false Void on success. False if the current user is not a super admin.
*/
Expand Down Expand Up @@ -1029,7 +1029,7 @@ function network_settings_add_js() {
*
* @since 4.6.0
*
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
*
* @param array $args {
* Optional. Array or string of Query parameters. Default empty array.
Expand Down
12 changes: 6 additions & 6 deletions src/wp-admin/includes/plugin.php
Expand Up @@ -1858,7 +1858,7 @@ function menu_page_url( $menu_slug, $echo = true ) {
* @global string $parent_file
* @global array $menu
* @global array $submenu
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
* @global string $typenow
* @global string $plugin_page
* @global array $_wp_real_parent_file
Expand Down Expand Up @@ -1949,7 +1949,7 @@ function get_admin_page_parent( $parent = '' ) {
* @global string $title
* @global array $menu
* @global array $submenu
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
* @global string $plugin_page
* @global string $typenow
*
Expand Down Expand Up @@ -2084,7 +2084,7 @@ function get_plugin_page_hookname( $plugin_page, $parent_page ) {
*
* @since 1.5.0
*
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
* @global array $menu
* @global array $submenu
* @global array $_wp_menu_nopriv
Expand Down Expand Up @@ -2467,7 +2467,7 @@ function resume_plugin( $plugin, $redirect = '' ) {
*
* @since 5.2.0
*
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
*/
function paused_plugins_notice() {
if ( 'plugins.php' === $GLOBALS['pagenow'] ) {
Expand Down Expand Up @@ -2500,8 +2500,8 @@ function paused_plugins_notice() {
* @since 5.8.0
* @access private
*
* @global string $pagenow
* @global string $wp_version
* @global string $pagenow The filename of the current screen.
* @global string $wp_version The WordPress version string.
*/
function deactivated_plugins_notice() {
if ( 'plugins.php' === $GLOBALS['pagenow'] ) {
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/theme.php
Expand Up @@ -1185,7 +1185,7 @@ function resume_theme( $theme, $redirect = '' ) {
*
* @since 5.2.0
*
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
*/
function paused_themes_notice() {
if ( 'themes.php' === $GLOBALS['pagenow'] ) {
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/update-core.php
Expand Up @@ -1554,7 +1554,7 @@ function _copy_dir( $from, $to, $skip_list = array() ) {
* @since 3.3.0
*
* @global string $wp_version The WordPress version string.
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
* @global string $action
*
* @param string $new_version
Expand Down
6 changes: 3 additions & 3 deletions src/wp-admin/includes/update.php
Expand Up @@ -277,16 +277,16 @@ function core_update_footer( $msg = '' ) {
/**
* @since 2.3.0
*
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
* @return void|false
*/
function update_nag() {
global $pagenow;

if ( is_multisite() && ! current_user_can( 'update_core' ) ) {
return false;
}

global $pagenow;

if ( 'update-core.php' === $pagenow ) {
return;
}
Expand Down
3 changes: 2 additions & 1 deletion src/wp-admin/includes/user.php
Expand Up @@ -510,10 +510,11 @@ function default_password_nag_edit_user( $user_ID, $old_data ) {
/**
* @since 2.8.0
*
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
*/
function default_password_nag() {
global $pagenow;

// Short-circuit it.
if ( 'profile.php' === $pagenow || ! get_user_option( 'default_password_nag' ) ) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/admin-bar.php
Expand Up @@ -1233,7 +1233,7 @@ function show_admin_bar( $show ) {
* @since 3.1.0
*
* @global bool $show_admin_bar
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
*
* @return bool Whether the admin bar should be showing.
*/
Expand Down
6 changes: 3 additions & 3 deletions src/wp-includes/class-wp-customize-manager.php
Expand Up @@ -500,7 +500,7 @@ public function wp_die_handler() {
*
* @since 3.4.0
*
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
*/
public function setup_theme() {
global $pagenow;
Expand Down Expand Up @@ -607,7 +607,7 @@ public function setup_theme() {
*
* @since 4.9.0
*
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
*/
public function establish_loaded_changeset() {
global $pagenow;
Expand Down Expand Up @@ -3285,7 +3285,7 @@ public function refresh_changeset_lock( $changeset_post_id ) {
*
* @since 4.9.0
*
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
*
* @param array $settings Current settings to filter.
* @return array Heartbeat settings.
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/class-wp-recovery-mode-link-service.php
Expand Up @@ -65,7 +65,7 @@ public function generate_url() {
*
* @since 5.2.0
*
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
*
* @param int $ttl Number of seconds the link should be valid for.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/functions.php
Expand Up @@ -8399,7 +8399,7 @@ function clean_dirsize_cache( $path ) {
*
* @since 5.2.0
*
* @global string $wp_version WordPress version.
* @global string $wp_version The WordPress version string.
*
* @param string $required Minimum required WordPress version.
* @return bool True if required version is compatible or empty, false if not.
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/functions.wp-scripts.php
Expand Up @@ -258,7 +258,7 @@ function wp_set_script_translations( $handle, $domain = 'default', $path = null
*
* @since 2.1.0
*
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
*
* @param string $handle Name of the script to be removed.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/l10n.php
Expand Up @@ -114,7 +114,7 @@ function get_user_locale( $user_id = 0 ) {
*
* @since 5.0.0
*
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
*
* @return string The determined locale.
*/
Expand Down
6 changes: 4 additions & 2 deletions src/wp-includes/load.php
Expand Up @@ -886,6 +886,8 @@ function wp_skip_paused_plugins( array $plugins ) {
* @since 5.1.0
* @access private
*
* @global string $pagenow The filename of the current screen.
*
* @return string[] Array of absolute paths to theme directories.
*/
function wp_get_active_and_valid_themes() {
Expand Down Expand Up @@ -966,7 +968,7 @@ function wp_is_recovery_mode() {
*
* @since 5.2.0
*
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
*
* @return bool True if the current endpoint should be protected.
*/
Expand Down Expand Up @@ -1746,7 +1748,7 @@ function wp_is_xml_request() {
*
* @since 5.6.1
*
* @global string $pagenow The current page.
* @global string $pagenow The filename of the current screen.
*
* @param string $context The context to check for protection. Accepts 'login', 'admin', and 'front'.
* Defaults to the current context.
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/post.php
Expand Up @@ -6577,7 +6577,7 @@ function wp_update_attachment_metadata( $attachment_id, $data ) {
*
* @since 2.1.0
*
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
*
* @param int $attachment_id Optional. Attachment post ID. Defaults to global $post.
* @return string|false Attachment URL, otherwise false.
Expand Down
2 changes: 2 additions & 0 deletions src/wp-includes/script-loader.php
Expand Up @@ -2847,6 +2847,8 @@ function _wp_normalize_relative_css_links( $css, $stylesheet_url ) {
* Inject the block editor assets that need to be loaded into the editor's iframe as an inline script.
*
* @since 5.8.0
*
* @global string $pagenow The filename of the current screen.
*/
function wp_add_iframed_editor_assets_html() {
global $pagenow;
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/user.php
Expand Up @@ -3712,7 +3712,7 @@ function send_confirmation_on_profile_email() {
* @since 3.0.0
* @since 4.9.0 This function was moved from wp-admin/includes/ms.php so it's no longer Multisite specific.
*
* @global string $pagenow
* @global string $pagenow The filename of the current screen.
*/
function new_user_email_admin_notice() {
global $pagenow;
Expand Down
4 changes: 2 additions & 2 deletions src/wp-includes/vars.php
Expand Up @@ -2,8 +2,8 @@
/**
* Creates common globals for the rest of WordPress
*
* Sets $pagenow global which is the current page. Checks
* for the browser to set which one is currently being used.
* Sets $pagenow global which is the filename of the current screen.
* Checks for the browser to set which one is currently being used.
*
* Detects which user environment WordPress is being used on.
* Only attempts to check for Apache, Nginx and IIS -- three web
Expand Down

0 comments on commit 8277055

Please sign in to comment.