diff --git a/src/wp-admin/includes/plugin.php b/src/wp-admin/includes/plugin.php index 7774ddf798..83de6b68e9 100644 --- a/src/wp-admin/includes/plugin.php +++ b/src/wp-admin/includes/plugin.php @@ -1004,6 +1004,11 @@ function uninstall_plugin($plugin) { * The function which is hooked in to handle the output of the page must check * that the user has the required capability as well. * + * @global array $menu + * @global array $admin_page_hooks + * @global array $_registered_pages + * @global array $_parent_pages + * * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected * @param string $menu_title The text to be used for the menu * @param string $capability The capability required for this menu to be displayed to the user. @@ -1062,6 +1067,8 @@ function add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $func * The function which is hooked in to handle the output of the page must check * that the user has the required capability as well. * + * @global int $_wp_last_object_menu + * * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected * @param string $menu_title The text to be used for the menu * @param string $capability The capability required for this menu to be displayed to the user. @@ -1088,6 +1095,8 @@ function add_object_page( $page_title, $menu_title, $capability, $menu_slug, $fu * The function which is hooked in to handle the output of the page must check * that the user has the required capability as well. * + * @global int $_wp_last_utility_menu + * * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected * @param string $menu_title The text to be used for the menu * @param string $capability The capability required for this menu to be displayed to the user. @@ -1114,6 +1123,13 @@ function add_utility_page( $page_title, $menu_title, $capability, $menu_slug, $f * The function which is hooked in to handle the output of the page must check * that the user has the required capability as well. * + * @global array $submenu + * @global array $menu + * @global type $_wp_real_parent_file + * @global bool $_wp_submenu_nopriv + * @global array $_registered_pages + * @global array $_parent_pages + * * @param string $parent_slug The slug name for the parent menu (or the file name of a standard WordPress admin page) * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected * @param string $menu_title The text to be used for the menu @@ -1124,12 +1140,8 @@ function add_utility_page( $page_title, $menu_title, $capability, $menu_slug, $f * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required. */ function add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function = '' ) { - global $submenu; - global $menu; - global $_wp_real_parent_file; - global $_wp_submenu_nopriv; - global $_registered_pages; - global $_parent_pages; + global $submenu, $menu, $_wp_real_parent_file, $_wp_submenu_nopriv, + $_registered_pages, $_parent_pages; $menu_slug = plugin_basename( $menu_slug ); $parent_slug = plugin_basename( $parent_slug); @@ -1415,6 +1427,8 @@ function add_comments_page( $page_title, $menu_title, $capability, $menu_slug, $ * * @since 3.1.0 * + * @global array $menu + * * @param string $menu_slug The slug of the menu * @return array|bool The removed menu on success, False if not found */ @@ -1436,6 +1450,8 @@ function remove_menu_page( $menu_slug ) { * * @since 3.1.0 * + * @global array $submenu + * * @param string $menu_slug The slug for the parent menu * @param string $submenu_slug The slug of the submenu * @return array|bool The removed submenu on success, False if not found @@ -1463,6 +1479,8 @@ function remove_submenu_page( $menu_slug, $submenu_slug ) { * * @since 3.0.0 * + * @global array $_parent_pages + * * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) * @param bool $echo Whether or not to echo the url - default is true * @return string the url @@ -1492,17 +1510,21 @@ function menu_page_url($menu_slug, $echo = true) { // // Pluggable Menu Support -- Private // - +/** + * + * @global string $parent_file + * @global array $menu + * @global array $submenu + * @global string $pagenow + * @global string $typenow + * @global string $plugin_page + * @global string $_wp_real_parent_file + * @global array $_wp_menu_nopriv + * @global array $_wp_submenu_nopriv + */ function get_admin_page_parent( $parent = '' ) { - global $parent_file; - global $menu; - global $submenu; - global $pagenow; - global $typenow; - global $plugin_page; - global $_wp_real_parent_file; - global $_wp_menu_nopriv; - global $_wp_submenu_nopriv; + global $parent_file, $menu, $submenu, $pagenow, $typenow, + $plugin_page, $_wp_real_parent_file, $_wp_menu_nopriv, $_wp_submenu_nopriv; if ( !empty ( $parent ) && 'admin.php' != $parent ) { if ( isset( $_wp_real_parent_file[$parent] ) ) @@ -1556,13 +1578,17 @@ function get_admin_page_parent( $parent = '' ) { return ''; } +/** + * + * @global string $title + * @global array $menu + * @global array $submenu + * @global string $pagenow + * @global string $plugin_page + * @global string $typenow + */ function get_admin_page_title() { - global $title; - global $menu; - global $submenu; - global $pagenow; - global $plugin_page; - global $typenow; + global $title, $menu, $submenu, $pagenow, $plugin_page, $typenow; if ( ! empty ( $title ) ) return $title; @@ -1640,6 +1666,12 @@ function get_plugin_page_hook( $plugin_page, $parent_page ) { return null; } +/** + * + * @global array $admin_page_hooks + * @param string $plugin_page + * @param string $parent_page + */ function get_plugin_page_hookname( $plugin_page, $parent_page ) { global $admin_page_hooks; @@ -1661,14 +1693,19 @@ function get_plugin_page_hookname( $plugin_page, $parent_page ) { return $page_type . '_page_' . $plugin_name; } +/** + * + * @global string $pagenow + * @global array $menu + * @global array $submenu + * @global array $_wp_menu_nopriv + * @global array $_wp_submenu_nopriv + * @global string $plugin_page + * @global array $_registered_pages + */ function user_can_access_admin_page() { - global $pagenow; - global $menu; - global $submenu; - global $_wp_menu_nopriv; - global $_wp_submenu_nopriv; - global $plugin_page; - global $_registered_pages; + global $pagenow, $menu, $submenu, $_wp_menu_nopriv, $_wp_submenu_nopriv, + $plugin_page, $_registered_pages; $parent = get_admin_page_parent(); @@ -1741,6 +1778,8 @@ function user_can_access_admin_page() { * * @since 2.7.0 * + * @global array $new_whitelist_options + * * @param string $option_group A settings group name. Should correspond to a whitelisted option key name. * Default whitelisted option key names include "general," "discussion," and "reading," among others. * @param string $option_name The name of an option to sanitize and save. @@ -1769,6 +1808,8 @@ function register_setting( $option_group, $option_name, $sanitize_callback = '' * * @since 2.7.0 * + * @global array $new_whitelist_options + * * @param string $option_group * @param string $option_name * @param callable $sanitize_callback @@ -1798,6 +1839,8 @@ function unregister_setting( $option_group, $option_name, $sanitize_callback = ' * * @since 2.7.0 * + * @global array $new_whitelist_options + * * @param array $options * @return array */ @@ -1816,6 +1859,8 @@ add_filter( 'whitelist_options', 'option_update_filter' ); * * @since 2.7.0 * + * @global array $whitelist_options + * * @param array $new_options * @param string|array $options * @return array @@ -1847,6 +1892,8 @@ function add_option_whitelist( $new_options, $options = '' ) { * * @since 2.7.0 * + * @global array $whitelist_options + * * @param array $del_options * @param string|array $options * @return array diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php index 9356ace1aa..5ef3ce88e8 100644 --- a/src/wp-admin/includes/post.php +++ b/src/wp-admin/includes/post.php @@ -173,6 +173,8 @@ function _wp_translate_postdata( $update = false, $post_data = null ) { * * @since 1.5.0 * + * @global wpdb $wpdb + * * @param array $post_data Optional. * @return int Post ID. */ @@ -401,6 +403,8 @@ function edit_post( $post_data = null ) { * * @since 2.7.0 * + * @global wpdb $wpdb + * * @param array $post_data Optional, the array of post data to process if not provided will use $_POST superglobal. * @return array */ @@ -654,6 +658,8 @@ function get_default_post_to_edit( $post_type = 'post', $create_in_db = false ) * * @since 2.0.0 * + * @global wpdb $wpdb + * * @param string $title Post title * @param string $content Optional post content * @param string $date Optional post date @@ -695,6 +701,8 @@ function post_exists($title, $content = '', $date = '') { * * @since 2.1.0 * + * @global WP_User $current_user + * * @return int|WP_Error */ function wp_write_post() { @@ -834,6 +842,8 @@ function delete_meta( $mid ) { * * @since 1.2.0 * + * @global wpdb $wpdb + * * @return mixed */ function get_meta_keys() { @@ -865,6 +875,8 @@ function get_post_meta_by_id( $mid ) { * * @since 1.2.0 * + * @global wpdb $wpdb + * * @param int $postid * @return mixed */ @@ -1055,6 +1067,8 @@ function wp_edit_posts_query( $q = false ) { * * @since 2.5.0 * + * @global wpdb $wpdb + * * @param string $type * @return mixed */ @@ -1338,6 +1352,9 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) { * * @since 2.9.0 * + * @global int $content_width + * @global array $_wp_additional_image_sizes + * * @param int $thumbnail_id ID of the attachment used for thumbnail * @param mixed $post The post ID or object associated with the thumbnail, defaults to global $post. * @return string html diff --git a/src/wp-admin/includes/schema.php b/src/wp-admin/includes/schema.php index e0d9cef988..95ee375881 100644 --- a/src/wp-admin/includes/schema.php +++ b/src/wp-admin/includes/schema.php @@ -8,14 +8,17 @@ * @subpackage Administration */ -// Declare these as global in case schema.php is included from a function. +/** + * Declare these as global in case schema.php is included from a function. + * + * @global wpdb $wpdb + * @global array $wp_queries + * @global string $charset_collate + */ global $wpdb, $wp_queries, $charset_collate; /** * The database character collate. - * @var string - * @global string - * @name $charset_collate */ $charset_collate = $wpdb->get_charset_collate(); @@ -24,6 +27,8 @@ $charset_collate = $wpdb->get_charset_collate(); * * @since 3.3.0 * + * @global wpdb $wpdb + * * @param string $scope Optional. The tables for which to retrieve SQL. Can be all, global, ms_global, or blog tables. Defaults to all. * @param int $blog_id Optional. The blog ID for which to retrieve SQL. Default is the current blog ID. * @return string The SQL needed to create the requested tables. @@ -863,6 +868,11 @@ endif; * * @since 3.0.0 * + * @global wpdb $wpdb + * @global object $current_site + * @global int $wp_db_version + * @global WP_Rewrite $wp_rewrite + * * @param int $network_id ID of network to populate. * @return bool|WP_Error True on success, or WP_Error on warning (with the install otherwise successful, * so the error code must be checked) or failure. diff --git a/src/wp-admin/includes/screen.php b/src/wp-admin/includes/screen.php index 3572446d89..a4d5ac6155 100644 --- a/src/wp-admin/includes/screen.php +++ b/src/wp-admin/includes/screen.php @@ -60,6 +60,8 @@ function get_hidden_columns( $screen ) { * * @since 2.7.0 * + * @global array $wp_meta_boxes + * * @param WP_Screen $screen */ function meta_box_prefs( $screen ) { @@ -162,6 +164,8 @@ function add_screen_option( $option, $args = array() ) { * * @since 3.1.0 * + * @global WP_Screen $current_screen + * * @return WP_Screen Current screen object */ function get_current_screen() { @@ -368,6 +372,8 @@ final class WP_Screen { * @since 3.3.0 * @access public * + * @global string $hook_suffix + * * @param string|WP_Screen $hook_name Optional. The hook name (also known as the hook suffix) used to determine the screen. * Defaults to the current $hook_suffix global. * @return WP_Screen Screen object. @@ -529,6 +535,10 @@ final class WP_Screen { * * @see set_current_screen() * @since 3.3.0 + * + * @global WP_Screen $current_screen + * @global string $taxnow + * @global string $typenow */ public function set_current_screen() { global $current_screen, $taxnow, $typenow; @@ -787,6 +797,8 @@ final class WP_Screen { * This will trigger the deprecated filters for backwards compatibility. * * @since 3.3.0 + * + * @global string $screen_layout_columns */ public function render_screen_meta() { @@ -959,6 +971,12 @@ final class WP_Screen { - class="wp-admin wp-core-ui no-js iframe "> + class="wp-admin wp-core-ui no-js iframe ">