Docs: Add missing description for `$pagenow` global in various functions.

See #54729, #55499.
Built from https://develop.svn.wordpress.org/trunk@53060


git-svn-id: http://core.svn.wordpress.org/trunk@52649 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2022-04-04 18:26:06 +00:00
parent 955e2c007b
commit 9fb5112732
23 changed files with 43 additions and 38 deletions

View File

@ -18,7 +18,7 @@ if ( ! defined( 'WP_ADMIN' ) ) {
* @global string $hook_suffix * @global string $hook_suffix
* @global WP_Screen $current_screen WordPress current screen object. * @global WP_Screen $current_screen WordPress current screen object.
* @global WP_Locale $wp_locale WordPress date and time locale 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 string $update_title
* @global int $total_update_count * @global int $total_update_count
* @global string $parent_file * @global string $parent_file

View File

@ -116,11 +116,11 @@ $time_format = __( 'g:i a' );
wp_enqueue_script( 'common' ); wp_enqueue_script( 'common' );
/** /**
* $pagenow is set in vars.php * $pagenow is set in vars.php.
* $wp_importers is sometimes set in wp-admin/includes/import.php * $wp_importers is sometimes set in wp-admin/includes/import.php.
* The remaining variables are imported as globals elsewhere, declared as globals here * 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 array $wp_importers
* @global string $hook_suffix * @global string $hook_suffix
* @global string $plugin_page * @global string $plugin_page
@ -376,7 +376,7 @@ if ( isset( $plugin_page ) ) {
* The load-* hook fires in a number of contexts. This hook is for core screens. * 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 * 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 * 'post-new.php' etc. A complete hook for the latter would be
* 'load-post-new.php'. * 'load-post-new.php'.
* *

View File

@ -327,7 +327,7 @@ function wp_update_link( $linkdata ) {
* @since 3.5.0 * @since 3.5.0
* @access private * @access private
* *
* @global string $pagenow * @global string $pagenow The filename of the current screen.
*/ */
function wp_link_manager_disabled_message() { function wp_link_manager_disabled_message() {
global $pagenow; global $pagenow;

View File

@ -2146,7 +2146,7 @@ function get_filesystem_method( $args = array(), $context = '', $allow_relaxed_f
* @since 2.5.0 * @since 2.5.0
* @since 4.6.0 The `$context` parameter default changed from `false` to an empty string. * @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 $form_post The URL to post the form to.
* @param string $type Optional. Chosen type of filesystem. Default empty. * @param string $type Optional. Chosen type of filesystem. Default empty.

View File

@ -1276,7 +1276,7 @@ function wp_refresh_heartbeat_nonces( $response ) {
* *
* @since 3.8.0 * @since 3.8.0
* *
* @global string $pagenow * @global string $pagenow The filename of the current screen.
* *
* @param array $settings An array of Heartbeat settings. * @param array $settings An array of Heartbeat settings.
* @return array Filtered Heartbeat settings. * @return array Filtered Heartbeat settings.

View File

@ -692,7 +692,7 @@ function mu_dropdown_languages( $lang_files = array(), $current = '' ) {
* @since 3.0.0 * @since 3.0.0
* *
* @global int $wp_db_version WordPress database version. * @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. * @return void|false Void on success. False if the current user is not a super admin.
*/ */
@ -1029,7 +1029,7 @@ jQuery( function($) {
* *
* @since 4.6.0 * @since 4.6.0
* *
* @global string $pagenow * @global string $pagenow The filename of the current screen.
* *
* @param array $args { * @param array $args {
* Optional. Array or string of Query parameters. Default empty array. * Optional. Array or string of Query parameters. Default empty array.

View File

@ -1858,7 +1858,7 @@ function menu_page_url( $menu_slug, $echo = true ) {
* @global string $parent_file * @global string $parent_file
* @global array $menu * @global array $menu
* @global array $submenu * @global array $submenu
* @global string $pagenow * @global string $pagenow The filename of the current screen.
* @global string $typenow * @global string $typenow
* @global string $plugin_page * @global string $plugin_page
* @global array $_wp_real_parent_file * @global array $_wp_real_parent_file
@ -1949,7 +1949,7 @@ function get_admin_page_parent( $parent = '' ) {
* @global string $title * @global string $title
* @global array $menu * @global array $menu
* @global array $submenu * @global array $submenu
* @global string $pagenow * @global string $pagenow The filename of the current screen.
* @global string $plugin_page * @global string $plugin_page
* @global string $typenow * @global string $typenow
* *
@ -2084,7 +2084,7 @@ function get_plugin_page_hookname( $plugin_page, $parent_page ) {
* *
* @since 1.5.0 * @since 1.5.0
* *
* @global string $pagenow * @global string $pagenow The filename of the current screen.
* @global array $menu * @global array $menu
* @global array $submenu * @global array $submenu
* @global array $_wp_menu_nopriv * @global array $_wp_menu_nopriv
@ -2467,7 +2467,7 @@ function resume_plugin( $plugin, $redirect = '' ) {
* *
* @since 5.2.0 * @since 5.2.0
* *
* @global string $pagenow * @global string $pagenow The filename of the current screen.
*/ */
function paused_plugins_notice() { function paused_plugins_notice() {
if ( 'plugins.php' === $GLOBALS['pagenow'] ) { if ( 'plugins.php' === $GLOBALS['pagenow'] ) {
@ -2500,8 +2500,8 @@ function paused_plugins_notice() {
* @since 5.8.0 * @since 5.8.0
* @access private * @access private
* *
* @global string $pagenow * @global string $pagenow The filename of the current screen.
* @global string $wp_version * @global string $wp_version The WordPress version string.
*/ */
function deactivated_plugins_notice() { function deactivated_plugins_notice() {
if ( 'plugins.php' === $GLOBALS['pagenow'] ) { if ( 'plugins.php' === $GLOBALS['pagenow'] ) {

View File

@ -1185,7 +1185,7 @@ function resume_theme( $theme, $redirect = '' ) {
* *
* @since 5.2.0 * @since 5.2.0
* *
* @global string $pagenow * @global string $pagenow The filename of the current screen.
*/ */
function paused_themes_notice() { function paused_themes_notice() {
if ( 'themes.php' === $GLOBALS['pagenow'] ) { if ( 'themes.php' === $GLOBALS['pagenow'] ) {

View File

@ -1554,7 +1554,7 @@ function _copy_dir( $from, $to, $skip_list = array() ) {
* @since 3.3.0 * @since 3.3.0
* *
* @global string $wp_version The WordPress version string. * @global string $wp_version The WordPress version string.
* @global string $pagenow * @global string $pagenow The filename of the current screen.
* @global string $action * @global string $action
* *
* @param string $new_version * @param string $new_version

View File

@ -277,16 +277,16 @@ function core_update_footer( $msg = '' ) {
/** /**
* @since 2.3.0 * @since 2.3.0
* *
* @global string $pagenow * @global string $pagenow The filename of the current screen.
* @return void|false * @return void|false
*/ */
function update_nag() { function update_nag() {
global $pagenow;
if ( is_multisite() && ! current_user_can( 'update_core' ) ) { if ( is_multisite() && ! current_user_can( 'update_core' ) ) {
return false; return false;
} }
global $pagenow;
if ( 'update-core.php' === $pagenow ) { if ( 'update-core.php' === $pagenow ) {
return; return;
} }

View File

@ -510,10 +510,11 @@ function default_password_nag_edit_user( $user_ID, $old_data ) {
/** /**
* @since 2.8.0 * @since 2.8.0
* *
* @global string $pagenow * @global string $pagenow The filename of the current screen.
*/ */
function default_password_nag() { function default_password_nag() {
global $pagenow; global $pagenow;
// Short-circuit it. // Short-circuit it.
if ( 'profile.php' === $pagenow || ! get_user_option( 'default_password_nag' ) ) { if ( 'profile.php' === $pagenow || ! get_user_option( 'default_password_nag' ) ) {
return; return;

View File

@ -1233,7 +1233,7 @@ function show_admin_bar( $show ) {
* @since 3.1.0 * @since 3.1.0
* *
* @global bool $show_admin_bar * @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. * @return bool Whether the admin bar should be showing.
*/ */

View File

@ -500,7 +500,7 @@ final class WP_Customize_Manager {
* *
* @since 3.4.0 * @since 3.4.0
* *
* @global string $pagenow * @global string $pagenow The filename of the current screen.
*/ */
public function setup_theme() { public function setup_theme() {
global $pagenow; global $pagenow;
@ -607,7 +607,7 @@ final class WP_Customize_Manager {
* *
* @since 4.9.0 * @since 4.9.0
* *
* @global string $pagenow * @global string $pagenow The filename of the current screen.
*/ */
public function establish_loaded_changeset() { public function establish_loaded_changeset() {
global $pagenow; global $pagenow;
@ -3285,7 +3285,7 @@ final class WP_Customize_Manager {
* *
* @since 4.9.0 * @since 4.9.0
* *
* @global string $pagenow * @global string $pagenow The filename of the current screen.
* *
* @param array $settings Current settings to filter. * @param array $settings Current settings to filter.
* @return array Heartbeat settings. * @return array Heartbeat settings.

View File

@ -65,7 +65,7 @@ class WP_Recovery_Mode_Link_Service {
* *
* @since 5.2.0 * @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. * @param int $ttl Number of seconds the link should be valid for.
*/ */

View File

@ -8399,7 +8399,7 @@ function clean_dirsize_cache( $path ) {
* *
* @since 5.2.0 * @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. * @param string $required Minimum required WordPress version.
* @return bool True if required version is compatible or empty, false if not. * @return bool True if required version is compatible or empty, false if not.

View File

@ -258,7 +258,7 @@ function wp_set_script_translations( $handle, $domain = 'default', $path = null
* *
* @since 2.1.0 * @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. * @param string $handle Name of the script to be removed.
*/ */

View File

@ -114,7 +114,7 @@ function get_user_locale( $user_id = 0 ) {
* *
* @since 5.0.0 * @since 5.0.0
* *
* @global string $pagenow * @global string $pagenow The filename of the current screen.
* *
* @return string The determined locale. * @return string The determined locale.
*/ */

View File

@ -886,6 +886,8 @@ function wp_skip_paused_plugins( array $plugins ) {
* @since 5.1.0 * @since 5.1.0
* @access private * @access private
* *
* @global string $pagenow The filename of the current screen.
*
* @return string[] Array of absolute paths to theme directories. * @return string[] Array of absolute paths to theme directories.
*/ */
function wp_get_active_and_valid_themes() { function wp_get_active_and_valid_themes() {
@ -966,7 +968,7 @@ function wp_is_recovery_mode() {
* *
* @since 5.2.0 * @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. * @return bool True if the current endpoint should be protected.
*/ */
@ -1746,7 +1748,7 @@ function wp_is_xml_request() {
* *
* @since 5.6.1 * @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'. * @param string $context The context to check for protection. Accepts 'login', 'admin', and 'front'.
* Defaults to the current context. * Defaults to the current context.

View File

@ -6577,7 +6577,7 @@ function wp_update_attachment_metadata( $attachment_id, $data ) {
* *
* @since 2.1.0 * @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. * @param int $attachment_id Optional. Attachment post ID. Defaults to global $post.
* @return string|false Attachment URL, otherwise false. * @return string|false Attachment URL, otherwise false.

View File

@ -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. * Inject the block editor assets that need to be loaded into the editor's iframe as an inline script.
* *
* @since 5.8.0 * @since 5.8.0
*
* @global string $pagenow The filename of the current screen.
*/ */
function wp_add_iframed_editor_assets_html() { function wp_add_iframed_editor_assets_html() {
global $pagenow; global $pagenow;

View File

@ -3712,7 +3712,7 @@ All at ###SITENAME###
* @since 3.0.0 * @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. * @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() { function new_user_email_admin_notice() {
global $pagenow; global $pagenow;

View File

@ -2,8 +2,8 @@
/** /**
* Creates common globals for the rest of WordPress * Creates common globals for the rest of WordPress
* *
* Sets $pagenow global which is the current page. Checks * Sets $pagenow global which is the filename of the current screen.
* for the browser to set which one is currently being used. * Checks for the browser to set which one is currently being used.
* *
* Detects which user environment WordPress is being used on. * Detects which user environment WordPress is being used on.
* Only attempts to check for Apache, Nginx and IIS -- three web * Only attempts to check for Apache, Nginx and IIS -- three web

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.0-alpha-53059'; $wp_version = '6.0-alpha-53060';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.