Add `@global` annotations to (the rest of the?) `wp-admin/*` files.

Does not include list table file changes.

See #32444.

Built from https://develop.svn.wordpress.org/trunk@32643


git-svn-id: http://core.svn.wordpress.org/trunk@32613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-05-29 02:06:31 +00:00
parent b56b9b3e5c
commit 282e28ad81
13 changed files with 311 additions and 39 deletions

View File

@ -1004,6 +1004,11 @@ function uninstall_plugin($plugin) {
* The function which is hooked in to handle the output of the page must check * The function which is hooked in to handle the output of the page must check
* that the user has the required capability as well. * 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 $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 $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. * @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 * The function which is hooked in to handle the output of the page must check
* that the user has the required capability as well. * 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 $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 $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. * @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 * The function which is hooked in to handle the output of the page must check
* that the user has the required capability as well. * 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 $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 $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. * @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 * The function which is hooked in to handle the output of the page must check
* that the user has the required capability as well. * 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 $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 $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 $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. * @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 = '' ) { function add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
global $submenu; global $submenu, $menu, $_wp_real_parent_file, $_wp_submenu_nopriv,
global $menu; $_registered_pages, $_parent_pages;
global $_wp_real_parent_file;
global $_wp_submenu_nopriv;
global $_registered_pages;
global $_parent_pages;
$menu_slug = plugin_basename( $menu_slug ); $menu_slug = plugin_basename( $menu_slug );
$parent_slug = plugin_basename( $parent_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 * @since 3.1.0
* *
* @global array $menu
*
* @param string $menu_slug The slug of the menu * @param string $menu_slug The slug of the menu
* @return array|bool The removed menu on success, False if not found * @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 * @since 3.1.0
* *
* @global array $submenu
*
* @param string $menu_slug The slug for the parent menu * @param string $menu_slug The slug for the parent menu
* @param string $submenu_slug The slug of the submenu * @param string $submenu_slug The slug of the submenu
* @return array|bool The removed submenu on success, False if not found * @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 * @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 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 * @param bool $echo Whether or not to echo the url - default is true
* @return string the url * @return string the url
@ -1492,17 +1510,21 @@ function menu_page_url($menu_slug, $echo = true) {
// //
// Pluggable Menu Support -- Private // 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 = '' ) { function get_admin_page_parent( $parent = '' ) {
global $parent_file; global $parent_file, $menu, $submenu, $pagenow, $typenow,
global $menu; $plugin_page, $_wp_real_parent_file, $_wp_menu_nopriv, $_wp_submenu_nopriv;
global $submenu;
global $pagenow;
global $typenow;
global $plugin_page;
global $_wp_real_parent_file;
global $_wp_menu_nopriv;
global $_wp_submenu_nopriv;
if ( !empty ( $parent ) && 'admin.php' != $parent ) { if ( !empty ( $parent ) && 'admin.php' != $parent ) {
if ( isset( $_wp_real_parent_file[$parent] ) ) if ( isset( $_wp_real_parent_file[$parent] ) )
@ -1556,13 +1578,17 @@ function get_admin_page_parent( $parent = '' ) {
return ''; 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() { function get_admin_page_title() {
global $title; global $title, $menu, $submenu, $pagenow, $plugin_page, $typenow;
global $menu;
global $submenu;
global $pagenow;
global $plugin_page;
global $typenow;
if ( ! empty ( $title ) ) if ( ! empty ( $title ) )
return $title; return $title;
@ -1640,6 +1666,12 @@ function get_plugin_page_hook( $plugin_page, $parent_page ) {
return null; return null;
} }
/**
*
* @global array $admin_page_hooks
* @param string $plugin_page
* @param string $parent_page
*/
function get_plugin_page_hookname( $plugin_page, $parent_page ) { function get_plugin_page_hookname( $plugin_page, $parent_page ) {
global $admin_page_hooks; global $admin_page_hooks;
@ -1661,14 +1693,19 @@ function get_plugin_page_hookname( $plugin_page, $parent_page ) {
return $page_type . '_page_' . $plugin_name; 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() { function user_can_access_admin_page() {
global $pagenow; global $pagenow, $menu, $submenu, $_wp_menu_nopriv, $_wp_submenu_nopriv,
global $menu; $plugin_page, $_registered_pages;
global $submenu;
global $_wp_menu_nopriv;
global $_wp_submenu_nopriv;
global $plugin_page;
global $_registered_pages;
$parent = get_admin_page_parent(); $parent = get_admin_page_parent();
@ -1741,6 +1778,8 @@ function user_can_access_admin_page() {
* *
* @since 2.7.0 * @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. * @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. * 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. * @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 * @since 2.7.0
* *
* @global array $new_whitelist_options
*
* @param string $option_group * @param string $option_group
* @param string $option_name * @param string $option_name
* @param callable $sanitize_callback * @param callable $sanitize_callback
@ -1798,6 +1839,8 @@ function unregister_setting( $option_group, $option_name, $sanitize_callback = '
* *
* @since 2.7.0 * @since 2.7.0
* *
* @global array $new_whitelist_options
*
* @param array $options * @param array $options
* @return array * @return array
*/ */
@ -1816,6 +1859,8 @@ add_filter( 'whitelist_options', 'option_update_filter' );
* *
* @since 2.7.0 * @since 2.7.0
* *
* @global array $whitelist_options
*
* @param array $new_options * @param array $new_options
* @param string|array $options * @param string|array $options
* @return array * @return array
@ -1847,6 +1892,8 @@ function add_option_whitelist( $new_options, $options = '' ) {
* *
* @since 2.7.0 * @since 2.7.0
* *
* @global array $whitelist_options
*
* @param array $del_options * @param array $del_options
* @param string|array $options * @param string|array $options
* @return array * @return array

View File

@ -173,6 +173,8 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
* *
* @since 1.5.0 * @since 1.5.0
* *
* @global wpdb $wpdb
*
* @param array $post_data Optional. * @param array $post_data Optional.
* @return int Post ID. * @return int Post ID.
*/ */
@ -401,6 +403,8 @@ function edit_post( $post_data = null ) {
* *
* @since 2.7.0 * @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. * @param array $post_data Optional, the array of post data to process if not provided will use $_POST superglobal.
* @return array * @return array
*/ */
@ -654,6 +658,8 @@ function get_default_post_to_edit( $post_type = 'post', $create_in_db = false )
* *
* @since 2.0.0 * @since 2.0.0
* *
* @global wpdb $wpdb
*
* @param string $title Post title * @param string $title Post title
* @param string $content Optional post content * @param string $content Optional post content
* @param string $date Optional post date * @param string $date Optional post date
@ -695,6 +701,8 @@ function post_exists($title, $content = '', $date = '') {
* *
* @since 2.1.0 * @since 2.1.0
* *
* @global WP_User $current_user
*
* @return int|WP_Error * @return int|WP_Error
*/ */
function wp_write_post() { function wp_write_post() {
@ -834,6 +842,8 @@ function delete_meta( $mid ) {
* *
* @since 1.2.0 * @since 1.2.0
* *
* @global wpdb $wpdb
*
* @return mixed * @return mixed
*/ */
function get_meta_keys() { function get_meta_keys() {
@ -865,6 +875,8 @@ function get_post_meta_by_id( $mid ) {
* *
* @since 1.2.0 * @since 1.2.0
* *
* @global wpdb $wpdb
*
* @param int $postid * @param int $postid
* @return mixed * @return mixed
*/ */
@ -1055,6 +1067,8 @@ function wp_edit_posts_query( $q = false ) {
* *
* @since 2.5.0 * @since 2.5.0
* *
* @global wpdb $wpdb
*
* @param string $type * @param string $type
* @return mixed * @return mixed
*/ */
@ -1338,6 +1352,9 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
* *
* @since 2.9.0 * @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 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. * @param mixed $post The post ID or object associated with the thumbnail, defaults to global $post.
* @return string html * @return string html

View File

@ -8,14 +8,17 @@
* @subpackage Administration * @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; global $wpdb, $wp_queries, $charset_collate;
/** /**
* The database character collate. * The database character collate.
* @var string
* @global string
* @name $charset_collate
*/ */
$charset_collate = $wpdb->get_charset_collate(); $charset_collate = $wpdb->get_charset_collate();
@ -24,6 +27,8 @@ $charset_collate = $wpdb->get_charset_collate();
* *
* @since 3.3.0 * @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 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. * @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. * @return string The SQL needed to create the requested tables.
@ -863,6 +868,11 @@ endif;
* *
* @since 3.0.0 * @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. * @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, * @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. * so the error code must be checked) or failure.

View File

@ -60,6 +60,8 @@ function get_hidden_columns( $screen ) {
* *
* @since 2.7.0 * @since 2.7.0
* *
* @global array $wp_meta_boxes
*
* @param WP_Screen $screen * @param WP_Screen $screen
*/ */
function meta_box_prefs( $screen ) { function meta_box_prefs( $screen ) {
@ -162,6 +164,8 @@ function add_screen_option( $option, $args = array() ) {
* *
* @since 3.1.0 * @since 3.1.0
* *
* @global WP_Screen $current_screen
*
* @return WP_Screen Current screen object * @return WP_Screen Current screen object
*/ */
function get_current_screen() { function get_current_screen() {
@ -368,6 +372,8 @@ final class WP_Screen {
* @since 3.3.0 * @since 3.3.0
* @access public * @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. * @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. * Defaults to the current $hook_suffix global.
* @return WP_Screen Screen object. * @return WP_Screen Screen object.
@ -529,6 +535,10 @@ final class WP_Screen {
* *
* @see set_current_screen() * @see set_current_screen()
* @since 3.3.0 * @since 3.3.0
*
* @global WP_Screen $current_screen
* @global string $taxnow
* @global string $typenow
*/ */
public function set_current_screen() { public function set_current_screen() {
global $current_screen, $taxnow, $typenow; global $current_screen, $taxnow, $typenow;
@ -787,6 +797,8 @@ final class WP_Screen {
* This will trigger the deprecated filters for backwards compatibility. * This will trigger the deprecated filters for backwards compatibility.
* *
* @since 3.3.0 * @since 3.3.0
*
* @global string $screen_layout_columns
*/ */
public function render_screen_meta() { public function render_screen_meta() {
@ -959,6 +971,12 @@ final class WP_Screen {
<?php <?php
} }
/**
*
* @global array $wp_meta_boxes
*
* @return bool
*/
public function show_screen_options() { public function show_screen_options() {
global $wp_meta_boxes; global $wp_meta_boxes;
@ -1017,6 +1035,8 @@ final class WP_Screen {
* Render the screen options tab. * Render the screen options tab.
* *
* @since 3.3.0 * @since 3.3.0
*
* @global array $wp_meta_boxes
*/ */
public function render_screen_options() { public function render_screen_options() {
global $wp_meta_boxes; global $wp_meta_boxes;

View File

@ -436,6 +436,8 @@ function get_inline_data($post) {
* *
* @since 2.7.0 * @since 2.7.0
* *
* @global WP_List_Table $wp_list_table
*
* @param int $position * @param int $position
* @param bool $checkbox * @param bool $checkbox
* @param string $mode * @param string $mode
@ -656,6 +658,8 @@ function _list_meta_row( $entry, &$count ) {
* *
* @since 1.2.0 * @since 1.2.0
* *
* @global wpdb $wpdb
*
* @param WP_Post $post Optional. The post being edited. * @param WP_Post $post Optional. The post being edited.
*/ */
function meta_form( $post = null ) { function meta_form( $post = null ) {
@ -737,6 +741,9 @@ function meta_form( $post = null ) {
* *
* @since 0.71 * @since 0.71
* *
* @global WP_Locale $wp_locale
* @global object $comment
*
* @param int|bool $edit Accepts 1|true for editing the date, 0|false for adding the date. * @param int|bool $edit Accepts 1|true for editing the date, 0|false for adding the date.
* @param int|bool $for_post Accepts 1|true for applying the date to a post, 0|false for a comment. * @param int|bool $for_post Accepts 1|true for applying the date to a post, 0|false for a comment.
* @param int $tab_index The tabindex attribute to add. Default 0. * @param int $tab_index The tabindex attribute to add. Default 0.
@ -839,6 +846,8 @@ function page_template_dropdown( $default = '' ) {
* *
* @since 1.5.0 * @since 1.5.0
* *
* @global wpdb $wpdb
*
* @param int $default Optional. The default page ID to be pre-selected. Default 0. * @param int $default Optional. The default page ID to be pre-selected. Default 0.
* @param int $parent Optional. The parent page ID. Default 0. * @param int $parent Optional. The parent page ID. Default 0.
* @param int $level Optional. Page depth level. Default 0. * @param int $level Optional. Page depth level. Default 0.
@ -934,6 +943,8 @@ function wp_import_upload_form( $action ) {
* *
* @since 2.5.0 * @since 2.5.0
* *
* @global array $wp_meta_boxes
*
* @param string $id String for use in the 'id' attribute of tags. * @param string $id String for use in the 'id' attribute of tags.
* @param string $title Title of the meta box. * @param string $title Title of the meta box.
* @param callback $callback Function that fills the box with the desired content. * @param callback $callback Function that fills the box with the desired content.
@ -1022,6 +1033,8 @@ function add_meta_box( $id, $title, $callback, $screen = null, $context = 'advan
* *
* @since 2.5.0 * @since 2.5.0
* *
* @global array $wp_meta_boxes
*
* @staticvar bool $already_sorted * @staticvar bool $already_sorted
* @param string|WP_Screen $screen Screen identifier * @param string|WP_Screen $screen Screen identifier
* @param string $context box context * @param string $context box context
@ -1090,6 +1103,8 @@ function do_meta_boxes( $screen, $context, $object ) {
* *
* @since 2.6.0 * @since 2.6.0
* *
* @global array $wp_meta_boxes
*
* @param string $id String for use in the 'id' attribute of tags. * @param string $id String for use in the 'id' attribute of tags.
* @param string|object $screen The screen on which to show the box (post, page, link). * @param string|object $screen The screen on which to show the box (post, page, link).
* @param string $context The context within the page where the boxes should show ('normal', 'advanced'). * @param string $context The context within the page where the boxes should show ('normal', 'advanced').
@ -1576,6 +1591,10 @@ function _admin_search_query() {
* *
* @since 2.7.0 * @since 2.7.0
* *
* @global string $hook_suffix
* @global string $admin_body_class
* @global WP_Locale $wp_locale
*
* @param string $title Optional. Title of the Iframe page. Default empty. * @param string $title Optional. Title of the Iframe page. Default empty.
* @param bool $deprecated Not used. * @param bool $deprecated Not used.
*/ */
@ -1637,7 +1656,11 @@ if ( is_rtl() )
/** This filter is documented in wp-admin/admin-header.php */ /** This filter is documented in wp-admin/admin-header.php */
$admin_body_classes = apply_filters( 'admin_body_class', '' ); $admin_body_classes = apply_filters( 'admin_body_class', '' );
?> ?>
<body<?php if ( isset($GLOBALS['body_id']) ) echo ' id="' . $GLOBALS['body_id'] . '"'; ?> class="wp-admin wp-core-ui no-js iframe <?php echo $admin_body_classes . ' ' . $admin_body_class; ?>"> <body<?php
/**
* @global string $body_id
*/
if ( isset($GLOBALS['body_id']) ) echo ' id="' . $GLOBALS['body_id'] . '"'; ?> class="wp-admin wp-core-ui no-js iframe <?php echo $admin_body_classes . ' ' . $admin_body_class; ?>">
<script type="text/javascript"> <script type="text/javascript">
(function(){ (function(){
var c = document.body.className; var c = document.body.className;
@ -1921,6 +1944,10 @@ function get_submit_button( $text = '', $type = 'primary large', $name = 'submit
return $button; return $button;
} }
/**
*
* @global bool $is_IE
*/
function _wp_admin_html_begin() { function _wp_admin_html_begin() {
global $is_IE; global $is_IE;
@ -2107,6 +2134,11 @@ final class WP_Internal_Pointers {
) ); ) );
} }
/**
* @static
*
* @global bool $_wp_editor_expand
*/
public static function pointer_wp410_dfw() { public static function pointer_wp410_dfw() {
// Don't show when editor-scrolling is not used. // Don't show when editor-scrolling is not used.
if ( empty( $GLOBALS['_wp_editor_expand'] ) ) { if ( empty( $GLOBALS['_wp_editor_expand'] ) ) {

View File

@ -150,6 +150,8 @@ function install_themes_upload() {
* Prints a theme on the Install Themes pages. * Prints a theme on the Install Themes pages.
* *
* @deprecated 3.4.0 * @deprecated 3.4.0
*
* @global WP_Theme_Install_List_Table $wp_list_table
*/ */
function display_theme( $theme ) { function display_theme( $theme ) {
_deprecated_function( __FUNCTION__, '3.4' ); _deprecated_function( __FUNCTION__, '3.4' );
@ -165,6 +167,8 @@ function display_theme( $theme ) {
* Display theme content based on theme list. * Display theme content based on theme list.
* *
* @since 2.8.0 * @since 2.8.0
*
* @global WP_Theme_Install_List_Table $wp_list_table
*/ */
function display_themes() { function display_themes() {
global $wp_list_table; global $wp_list_table;
@ -185,6 +189,8 @@ function display_themes() {
* Display theme information in dialog box form. * Display theme information in dialog box form.
* *
* @since 2.8.0 * @since 2.8.0
*
* @global WP_Theme_Install_List_Table $wp_list_table
*/ */
function install_theme_information() { function install_theme_information() {
global $wp_list_table; global $wp_list_table;

View File

@ -11,6 +11,8 @@
* *
* @since 2.8.0 * @since 2.8.0
* *
* @global WP_Filesystem_Base $wp_filesystem Subclass
*
* @param string $stylesheet Stylesheet of the theme to delete * @param string $stylesheet Stylesheet of the theme to delete
* @param string $redirect Redirect to page when complete. * @param string $redirect Redirect to page when complete.
* @return mixed * @return mixed

View File

@ -124,6 +124,8 @@ function wp_get_available_translations() {
* *
* @since 4.0.0 * @since 4.0.0
* *
* @global string $wp_local_package
*
* @param array $languages Array of available languages (populated via the Translation API). * @param array $languages Array of available languages (populated via the Translation API).
*/ */
function wp_install_language_form( $languages ) { function wp_install_language_form( $languages ) {

View File

@ -768,6 +768,14 @@ $_new_bundled_files = array(
* *
* @since 2.7.0 * @since 2.7.0
* *
* @global WP_Filesystem_Base $wp_filesystem
* @global array $_old_files
* @global array $_new_bundled_files
* @global wpdb $wpdb
* @global string $wp_version
* @global string $required_php_version
* @global string $required_mysql_version
*
* @param string $from New release unzipped path. * @param string $from New release unzipped path.
* @param string $to Path to old WordPress installation. * @param string $to Path to old WordPress installation.
* @return WP_Error|null WP_Error on failure, null on success. * @return WP_Error|null WP_Error on failure, null on success.
@ -810,8 +818,15 @@ function update_core($from, $to) {
return new WP_Error( 'insane_distro', __('The update could not be unpacked') ); return new WP_Error( 'insane_distro', __('The update could not be unpacked') );
} }
// Import $wp_version, $required_php_version, and $required_mysql_version from the new version
// $wp_filesystem->wp_content_dir() returned unslashed pre-2.8 /**
* Import $wp_version, $required_php_version, and $required_mysql_version from the new version
* $wp_filesystem->wp_content_dir() returned unslashed pre-2.8
*
* @global string $wp_version
* @global string $required_php_version
* @global string $required_mysql_version
*/
global $wp_version, $required_php_version, $required_mysql_version; global $wp_version, $required_php_version, $required_mysql_version;
$versions_file = trailingslashit( $wp_filesystem->wp_content_dir() ) . 'upgrade/version-current.php'; $versions_file = trailingslashit( $wp_filesystem->wp_content_dir() ) . 'upgrade/version-current.php';
@ -1101,6 +1116,8 @@ function update_core($from, $to) {
* @since 3.7.0 Updated not to use a regular expression for the skip list * @since 3.7.0 Updated not to use a regular expression for the skip list
* @see copy_dir() * @see copy_dir()
* *
* @global WP_Filesystem_Base $wp_filesystem
*
* @param string $from source directory * @param string $from source directory
* @param string $to destination directory * @param string $to destination directory
* @param array $skip_list a list of files/folders to skip copying * @param array $skip_list a list of files/folders to skip copying
@ -1156,6 +1173,9 @@ function _copy_dir($from, $to, $skip_list = array() ) {
* *
* @since 3.3.0 * @since 3.3.0
* *
* @global string $wp_version
* @global string $pagenow
* @global string $action
*/ */
function _redirect_to_about_wordpress( $new_version ) { function _redirect_to_about_wordpress( $new_version ) {
global $wp_version, $pagenow, $action; global $wp_version, $pagenow, $action;
@ -1196,6 +1216,9 @@ add_action( '_core_updated_successfully', '_redirect_to_about_wordpress' );
* Cleans up Genericons example files. * Cleans up Genericons example files.
* *
* @since 4.2.2 * @since 4.2.2
*
* @global array $wp_theme_directories
* @global WP_Filesystem_Base $wp_filesystem
*/ */
function _upgrade_422_remove_genericons() { function _upgrade_422_remove_genericons() {
global $wp_theme_directories, $wp_filesystem; global $wp_theme_directories, $wp_filesystem;

View File

@ -190,6 +190,11 @@ function core_update_footer( $msg = '' ) {
} }
add_filter( 'update_footer', 'core_update_footer' ); add_filter( 'update_footer', 'core_update_footer' );
/**
*
* @global string $pagenow
* @return false|void
*/
function update_nag() { function update_nag() {
if ( is_multisite() && !current_user_can('update_core') ) if ( is_multisite() && !current_user_can('update_core') )
return false; return false;
@ -400,6 +405,11 @@ function wp_theme_update_row( $theme_key, $theme ) {
echo '</div></td></tr>'; echo '</div></td></tr>';
} }
/**
*
* @global int $upgrading
* @return false|void
*/
function maintenance_nag() { function maintenance_nag() {
include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version
global $upgrading; global $upgrading;

View File

@ -118,6 +118,10 @@ if ( !function_exists('wp_install_defaults') ) :
* *
* @since 2.1.0 * @since 2.1.0
* *
* @global wpdb $wpdb
* @global WP_Rewrite $wp_rewrite
* @global string $table_prefix
*
* @param int $user_id User ID. * @param int $user_id User ID.
*/ */
function wp_install_defaults( $user_id ) { function wp_install_defaults( $user_id ) {
@ -385,6 +389,10 @@ if ( !function_exists('wp_upgrade') ) :
* *
* @since 2.1.0 * @since 2.1.0
* *
* @global int $wp_current_db_version
* @global int $wp_db_version
* @global wpdb $wpdb
*
* @return null If no update is necessary or site isn't completely installed, null. * @return null If no update is necessary or site isn't completely installed, null.
*/ */
function wp_upgrade() { function wp_upgrade() {
@ -435,6 +443,9 @@ endif;
* *
* @since 1.0.1 * @since 1.0.1
* *
* @global int $wp_current_db_version
* @global int $wp_db_version
*
* @return null If no update is necessary, null. * @return null If no update is necessary, null.
*/ */
function upgrade_all() { function upgrade_all() {
@ -545,6 +556,8 @@ function upgrade_all() {
* Execute changes made in WordPress 1.0. * Execute changes made in WordPress 1.0.
* *
* @since 1.0.0 * @since 1.0.0
*
* @global wpdb $wpdb
*/ */
function upgrade_100() { function upgrade_100() {
global $wpdb; global $wpdb;
@ -601,6 +614,8 @@ function upgrade_100() {
* Execute changes made in WordPress 1.0.1. * Execute changes made in WordPress 1.0.1.
* *
* @since 1.0.1 * @since 1.0.1
*
* @global wpdb $wpdb
*/ */
function upgrade_101() { function upgrade_101() {
global $wpdb; global $wpdb;
@ -619,6 +634,8 @@ function upgrade_101() {
* Execute changes made in WordPress 1.2. * Execute changes made in WordPress 1.2.
* *
* @since 1.2.0 * @since 1.2.0
*
* @global wpdb $wpdb
*/ */
function upgrade_110() { function upgrade_110() {
global $wpdb; global $wpdb;
@ -679,6 +696,8 @@ function upgrade_110() {
* Execute changes made in WordPress 1.5. * Execute changes made in WordPress 1.5.
* *
* @since 1.5.0 * @since 1.5.0
*
* @global wpdb $wpdb
*/ */
function upgrade_130() { function upgrade_130() {
global $wpdb; global $wpdb;
@ -763,6 +782,9 @@ function upgrade_130() {
* Execute changes made in WordPress 2.0. * Execute changes made in WordPress 2.0.
* *
* @since 2.0.0 * @since 2.0.0
*
* @global wpdb $wpdb
* @global int $wp_current_db_version
*/ */
function upgrade_160() { function upgrade_160() {
global $wpdb, $wp_current_db_version; global $wpdb, $wp_current_db_version;
@ -846,6 +868,9 @@ function upgrade_160() {
* Execute changes made in WordPress 2.1. * Execute changes made in WordPress 2.1.
* *
* @since 2.1.0 * @since 2.1.0
*
* @global wpdb $wpdb
* @global int $wp_current_db_version
*/ */
function upgrade_210() { function upgrade_210() {
global $wpdb, $wp_current_db_version; global $wpdb, $wp_current_db_version;
@ -890,6 +915,9 @@ function upgrade_210() {
* Execute changes made in WordPress 2.3. * Execute changes made in WordPress 2.3.
* *
* @since 2.3.0 * @since 2.3.0
*
* @global wpdb $wpdb
* @global int $wp_current_db_version
*/ */
function upgrade_230() { function upgrade_230() {
global $wp_current_db_version, $wpdb; global $wp_current_db_version, $wpdb;
@ -1066,6 +1094,8 @@ function upgrade_230() {
* Remove old options from the database. * Remove old options from the database.
* *
* @since 2.3.0 * @since 2.3.0
*
* @global wpdb $wpdb
*/ */
function upgrade_230_options_table() { function upgrade_230_options_table() {
global $wpdb; global $wpdb;
@ -1080,6 +1110,8 @@ function upgrade_230_options_table() {
* Remove old categories, link2cat, and post2cat database tables. * Remove old categories, link2cat, and post2cat database tables.
* *
* @since 2.3.0 * @since 2.3.0
*
* @global wpdb $wpdb
*/ */
function upgrade_230_old_tables() { function upgrade_230_old_tables() {
global $wpdb; global $wpdb;
@ -1092,6 +1124,8 @@ function upgrade_230_old_tables() {
* Upgrade old slugs made in version 2.2. * Upgrade old slugs made in version 2.2.
* *
* @since 2.2.0 * @since 2.2.0
*
* @global wpdb $wpdb
*/ */
function upgrade_old_slugs() { function upgrade_old_slugs() {
// Upgrade people who were using the Redirect Old Slugs plugin. // Upgrade people who were using the Redirect Old Slugs plugin.
@ -1103,6 +1137,8 @@ function upgrade_old_slugs() {
* Execute changes made in WordPress 2.5.0. * Execute changes made in WordPress 2.5.0.
* *
* @since 2.5.0 * @since 2.5.0
*
* @global int $wp_current_db_version
*/ */
function upgrade_250() { function upgrade_250() {
global $wp_current_db_version; global $wp_current_db_version;
@ -1117,6 +1153,8 @@ function upgrade_250() {
* Execute changes made in WordPress 2.5.2. * Execute changes made in WordPress 2.5.2.
* *
* @since 2.5.2 * @since 2.5.2
*
* @global wpdb $wpdb
*/ */
function upgrade_252() { function upgrade_252() {
global $wpdb; global $wpdb;
@ -1128,6 +1166,8 @@ function upgrade_252() {
* Execute changes made in WordPress 2.6. * Execute changes made in WordPress 2.6.
* *
* @since 2.6.0 * @since 2.6.0
*
* @global int $wp_current_db_version
*/ */
function upgrade_260() { function upgrade_260() {
global $wp_current_db_version; global $wp_current_db_version;
@ -1140,6 +1180,9 @@ function upgrade_260() {
* Execute changes made in WordPress 2.7. * Execute changes made in WordPress 2.7.
* *
* @since 2.7.0 * @since 2.7.0
*
* @global wpdb $wpdb
* @global int $wp_current_db_version
*/ */
function upgrade_270() { function upgrade_270() {
global $wpdb, $wp_current_db_version; global $wpdb, $wp_current_db_version;
@ -1156,6 +1199,9 @@ function upgrade_270() {
* Execute changes made in WordPress 2.8. * Execute changes made in WordPress 2.8.
* *
* @since 2.8.0 * @since 2.8.0
*
* @global int $wp_current_db_version
* @global wpdb $wpdb
*/ */
function upgrade_280() { function upgrade_280() {
global $wp_current_db_version, $wpdb; global $wp_current_db_version, $wpdb;
@ -1183,6 +1229,8 @@ function upgrade_280() {
* Execute changes made in WordPress 2.9. * Execute changes made in WordPress 2.9.
* *
* @since 2.9.0 * @since 2.9.0
*
* @global int $wp_current_db_version
*/ */
function upgrade_290() { function upgrade_290() {
global $wp_current_db_version; global $wp_current_db_version;
@ -1200,6 +1248,9 @@ function upgrade_290() {
* Execute changes made in WordPress 3.0. * Execute changes made in WordPress 3.0.
* *
* @since 3.0.0 * @since 3.0.0
*
* @global int $wp_current_db_version
* @global wpdb $wpdb
*/ */
function upgrade_300() { function upgrade_300() {
global $wp_current_db_version, $wpdb; global $wp_current_db_version, $wpdb;
@ -1242,6 +1293,11 @@ function upgrade_300() {
* Execute changes made in WordPress 3.3. * Execute changes made in WordPress 3.3.
* *
* @since 3.3.0 * @since 3.3.0
*
* @global int $wp_current_db_version
* @global wpdb $wpdb
* @global array $wp_registered_widgets
* @global array $sidebars_widgets
*/ */
function upgrade_330() { function upgrade_330() {
global $wp_current_db_version, $wpdb, $wp_registered_widgets, $sidebars_widgets; global $wp_current_db_version, $wpdb, $wp_registered_widgets, $sidebars_widgets;
@ -1311,6 +1367,9 @@ function upgrade_330() {
* Execute changes made in WordPress 3.4. * Execute changes made in WordPress 3.4.
* *
* @since 3.4.0 * @since 3.4.0
*
* @global int $wp_current_db_version
* @global wpdb $wpdb
*/ */
function upgrade_340() { function upgrade_340() {
global $wp_current_db_version, $wpdb; global $wp_current_db_version, $wpdb;
@ -1344,6 +1403,9 @@ function upgrade_340() {
* Execute changes made in WordPress 3.5. * Execute changes made in WordPress 3.5.
* *
* @since 3.5.0 * @since 3.5.0
*
* @global int $wp_current_db_version
* @global wpdb $wpdb
*/ */
function upgrade_350() { function upgrade_350() {
global $wp_current_db_version, $wpdb; global $wp_current_db_version, $wpdb;
@ -1371,6 +1433,8 @@ function upgrade_350() {
* Execute changes made in WordPress 3.7. * Execute changes made in WordPress 3.7.
* *
* @since 3.7.0 * @since 3.7.0
*
* @global int $wp_current_db_version
*/ */
function upgrade_370() { function upgrade_370() {
global $wp_current_db_version; global $wp_current_db_version;
@ -1383,6 +1447,8 @@ function upgrade_370() {
* *
* @since 3.7.2 * @since 3.7.2
* @since 3.8.0 * @since 3.8.0
*
* @global int $wp_current_db_version
*/ */
function upgrade_372() { function upgrade_372() {
global $wp_current_db_version; global $wp_current_db_version;
@ -1394,6 +1460,8 @@ function upgrade_372() {
* Execute changes made in WordPress 3.8.0. * Execute changes made in WordPress 3.8.0.
* *
* @since 3.8.0 * @since 3.8.0
*
* @global int $wp_current_db_version
*/ */
function upgrade_380() { function upgrade_380() {
global $wp_current_db_version; global $wp_current_db_version;
@ -1406,6 +1474,8 @@ function upgrade_380() {
* Execute changes made in WordPress 4.0.0. * Execute changes made in WordPress 4.0.0.
* *
* @since 4.0.0 * @since 4.0.0
*
* @global int $wp_current_db_version
*/ */
function upgrade_400() { function upgrade_400() {
global $wp_current_db_version; global $wp_current_db_version;
@ -1424,6 +1494,9 @@ function upgrade_400() {
* Execute changes made in WordPress 4.2.0. * Execute changes made in WordPress 4.2.0.
* *
* @since 4.2.0 * @since 4.2.0
*
* @global int $wp_current_db_version
* @global wpdb $wpdb
*/ */
function upgrade_420() { function upgrade_420() {
global $wp_current_db_version, $wpdb; global $wp_current_db_version, $wpdb;
@ -1445,6 +1518,9 @@ function upgrade_420() {
* Execute changes made in WordPress 4.3.0. * Execute changes made in WordPress 4.3.0.
* *
* @since 4.3.0 * @since 4.3.0
*
* @global int $wp_current_db_version
* @global wpdb $wpdb
*/ */
function upgrade_430() { function upgrade_430() {
global $wp_current_db_version, $wpdb; global $wp_current_db_version, $wpdb;
@ -1493,6 +1569,9 @@ function upgrade_430() {
* Executes network-level upgrade routines. * Executes network-level upgrade routines.
* *
* @since 3.0.0 * @since 3.0.0
*
* @global int $wp_current_db_version
* @global wpdb $wpdb
*/ */
function upgrade_network() { function upgrade_network() {
global $wp_current_db_version, $wpdb; global $wp_current_db_version, $wpdb;
@ -1634,6 +1713,8 @@ function upgrade_network() {
* *
* @since 1.0.0 * @since 1.0.0
* *
* @global wpdb $wpdb
*
* @param string $table_name Database table name to create. * @param string $table_name Database table name to create.
* @param string $create_ddl SQL statement to create table. * @param string $create_ddl SQL statement to create table.
* @return bool If table already exists or was created by function. * @return bool If table already exists or was created by function.
@ -1662,6 +1743,8 @@ function maybe_create_table($table_name, $create_ddl) {
* *
* @since 1.0.1 * @since 1.0.1
* *
* @global wpdb $wpdb
*
* @param string $table Database table name. * @param string $table Database table name.
* @param string $index Index name to drop. * @param string $index Index name to drop.
* @return bool True, when finished. * @return bool True, when finished.
@ -1683,6 +1766,8 @@ function drop_index($table, $index) {
* *
* @since 1.0.1 * @since 1.0.1
* *
* @global wpdb $wpdb
*
* @param string $table Database table name. * @param string $table Database table name.
* @param string $index Database table index column. * @param string $index Database table index column.
* @return bool True, when done with execution. * @return bool True, when done with execution.
@ -1699,6 +1784,8 @@ function add_clean_index($table, $index) {
* *
* @since 1.3.0 * @since 1.3.0
* *
* @global wpdb $wpdb
*
* @param string $table_name The table name to modify. * @param string $table_name The table name to modify.
* @param string $column_name The column name to add to the table. * @param string $column_name The column name to add to the table.
* @param string $create_ddl The SQL statement used to add the column. * @param string $create_ddl The SQL statement used to add the column.
@ -1729,6 +1816,8 @@ function maybe_add_column($table_name, $column_name, $create_ddl) {
* *
* @since 4.2.0 * @since 4.2.0
* *
* @global wpdb $wpdb
*
* @param string $table The table to convert. * @param string $table The table to convert.
* @return bool true if the table was converted, false if it wasn't. * @return bool true if the table was converted, false if it wasn't.
*/ */
@ -1770,6 +1859,8 @@ function maybe_convert_table_to_utf8mb4( $table ) {
* *
* @since 1.2.0 * @since 1.2.0
* *
* @global wpdb $wpdb
*
* @return stdClass List of options. * @return stdClass List of options.
*/ */
function get_alloptions_110() { function get_alloptions_110() {
@ -1792,6 +1883,8 @@ function get_alloptions_110() {
* @since 1.5.1 * @since 1.5.1
* @access private * @access private
* *
* @global wpdb $wpdb
*
* @param string $setting Option name. * @param string $setting Option name.
* @return mixed * @return mixed
*/ */
@ -1851,6 +1944,8 @@ function deslash($content) {
* *
* @since 1.5.0 * @since 1.5.0
* *
* @global wpdb $wpdb
*
* @param string|array $queries Optional. The query to run. Can be multiple queries * @param string|array $queries Optional. The query to run. Can be multiple queries
* in an array, or a string of queries separated by * in an array, or a string of queries separated by
* semicolons. Default empty. * semicolons. Default empty.
@ -2375,6 +2470,8 @@ function translate_level_to_role($level) {
* Checks the version of the installed MySQL binary. * Checks the version of the installed MySQL binary.
* *
* @since 2.1.0 * @since 2.1.0
*
* @global wpdb $wpdb
*/ */
function wp_check_mysql_version() { function wp_check_mysql_version() {
global $wpdb; global $wpdb;
@ -2404,6 +2501,9 @@ function maybe_disable_automattic_widgets() {
* Disables the Link Manager on upgrade if, at the time of upgrade, no links exist in the DB. * Disables the Link Manager on upgrade if, at the time of upgrade, no links exist in the DB.
* *
* @since 3.5.0 * @since 3.5.0
*
* @global int $wp_current_db_version
* @global wpdb $wpdb
*/ */
function maybe_disable_link_manager() { function maybe_disable_link_manager() {
global $wp_current_db_version, $wpdb; global $wp_current_db_version, $wpdb;
@ -2416,6 +2516,9 @@ function maybe_disable_link_manager() {
* Runs before the schema is upgraded. * Runs before the schema is upgraded.
* *
* @since 2.9.0 * @since 2.9.0
*
* @global int $wp_current_db_version
* @global wpdb $wpdb
*/ */
function pre_schema_upgrade() { function pre_schema_upgrade() {
global $wp_current_db_version, $wpdb; global $wp_current_db_version, $wpdb;
@ -2472,6 +2575,8 @@ function pre_schema_upgrade() {
* *
* @since 3.0.0 * @since 3.0.0
* *
* @global wpdb $wpdb
* @global string $charset_collate
*/ */
if ( !function_exists( 'install_global_terms' ) ) : if ( !function_exists( 'install_global_terms' ) ) :
function install_global_terms() { function install_global_terms() {

View File

@ -18,8 +18,6 @@
* 5: Icon for top level menu * 5: Icon for top level menu
* *
* @global array $menu * @global array $menu
* @name $menu
* @var array
*/ */
$menu[2] = array( __('Dashboard'), 'read', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard' ); $menu[2] = array( __('Dashboard'), 'read', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard' );

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.3-alpha-32642'; $wp_version = '4.3-alpha-32643';
/** /**
* 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.