Add `@global` annotations for `wp-admin/*`.

See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-05-28 21:41:30 +00:00
parent 6ab487dde6
commit b56b9b3e5c
62 changed files with 704 additions and 38 deletions

View File

@ -81,6 +81,7 @@ do_action( 'admin_print_footer_scripts' );
*
* @since 2.8.0
*
* @global string $hook_suffix
* @param string $hook_suffix The current admin page.
*/
do_action( "admin_footer-" . $GLOBALS['hook_suffix'] );

View File

@ -10,7 +10,19 @@
if ( ! defined( 'WP_ADMIN' ) )
require_once( dirname( __FILE__ ) . '/admin.php' );
// In case admin-header.php is included in a function.
/**
* In case admin-header.php is included in a function.
*
* @global string $title
* @global string $hook_suffix
* @global WP_Screen $current_screen
* @global WP_Locale $wp_locale
* @global string $pagenow
* @global string $wp_version
* @global string $update_title
* @global int $total_update_count
* @global string $parent_file
*/
global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, $wp_version,
$update_title, $total_update_count, $parent_file;

View File

@ -94,11 +94,21 @@ $time_format = get_option('time_format');
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 array $wp_importers
* @global string $hook_suffix
* @global string $plugin_page
* @global string $typenow
* @global string $taxnow
*/
global $pagenow, $wp_importers, $hook_suffix, $plugin_page, $typenow, $taxnow;
$page_hook = null;

View File

@ -12,6 +12,9 @@ require_once( dirname( __FILE__ ) . '/admin.php' );
$parent_file = 'edit-comments.php';
$submenu_file = 'edit-comments.php';
/**
* @global string $action
*/
global $action;
wp_reset_vars( array('action') );

View File

@ -228,6 +228,8 @@ class Custom_Image_Header {
* Process the default headers
*
* @since 3.0.0
*
* @global array $_wp_default_headers
*/
public function process_default_headers() {
global $_wp_default_headers;

View File

@ -33,6 +33,10 @@ if ( ! $return ) {
}
}
/**
* @global WP_Scripts $wp_scripts
* @global WP_Customize_Manager $wp_customize
*/
global $wp_scripts, $wp_customize;
$registered = $wp_scripts->registered;

View File

@ -10,6 +10,11 @@
if ( !defined('ABSPATH') )
die('-1');
/**
* @global string $post_type
* @global object $post_type_object
* @global WP_Post $post
*/
global $post_type, $post_type_object, $post;
wp_enqueue_script('post');

View File

@ -20,7 +20,11 @@ if ( ! $tax )
if ( ! current_user_can( $tax->cap->manage_terms ) )
wp_die( __( 'Cheatin’ uh?' ), 403 );
// $post_type is set when the WP_Terms_List_Table instance is created
/**
* $post_type is set when the WP_Terms_List_Table instance is created
*
* @global string $post_type
*/
global $post_type;
$wp_list_table = _get_list_table('WP_Terms_List_Table');

View File

@ -18,6 +18,10 @@ if ( 'attachment' === $typenow ) {
}
}
/**
* @global string $post_type
* @global object $post_type_object
*/
global $post_type, $post_type_object;
$post_type = $typenow;

View File

@ -78,6 +78,8 @@ function wp_ajax_nopriv_heartbeat() {
* Ajax handler for fetching a list table.
*
* @since 3.1.0
*
* @global WP_List_Table $wp_list_table
*/
function wp_ajax_fetch_list() {
global $wp_list_table;
@ -226,6 +228,8 @@ function wp_ajax_imgedit_preview() {
* Ajax handler for oEmbed caching.
*
* @since 3.1.0
*
* @global WP_Embed $wp_embed
*/
function wp_ajax_oembed_cache() {
$GLOBALS['wp_embed']->cache_oembed( $_GET['post'] );
@ -762,6 +766,8 @@ function wp_ajax_add_link_category( $action ) {
* Ajax handler to add a tag.
*
* @since 3.1.0
*
* @global WP_List_Table $wp_list_table
*/
function wp_ajax_add_tag() {
global $wp_list_table;
@ -864,6 +870,9 @@ function wp_ajax_get_tagcloud() {
*
* @since 3.1.0
*
* @global WP_List_Table $wp_list_table
* @global int $post_id
*
* @param string $action Action to perform.
*/
function wp_ajax_get_comments( $action ) {
@ -915,6 +924,8 @@ function wp_ajax_get_comments( $action ) {
*
* @since 3.1.0
*
* @global WP_List_Table $wp_list_table
*
* @param string $action Action to perform.
*/
function wp_ajax_replyto_comment( $action ) {
@ -1016,6 +1027,8 @@ function wp_ajax_replyto_comment( $action ) {
* Ajax handler for editing a comment.
*
* @since 3.1.0
*
* @global WP_List_Table $wp_list_table
*/
function wp_ajax_edit_comment() {
global $wp_list_table;
@ -1229,6 +1242,8 @@ function wp_ajax_add_meta() {
*
* @since 3.1.0
*
* @global WP_List_Table $wp_list_table
*
* @param string $action Action to perform.
*/
function wp_ajax_add_user( $action ) {
@ -1499,6 +1514,8 @@ function wp_ajax_sample_permalink() {
* Ajax handler for Quick Edit saving a post from a list table.
*
* @since 3.1.0
*
* @global WP_List_Table $wp_list_table
*/
function wp_ajax_inline_save() {
global $wp_list_table;
@ -1591,6 +1608,8 @@ function wp_ajax_inline_save() {
* Ajax handler for quick edit saving for a term.
*
* @since 3.1.0
*
* @global WP_List_Table $wp_list_table
*/
function wp_ajax_inline_save_tax() {
global $wp_list_table;
@ -1743,6 +1762,10 @@ function wp_ajax_widgets_order() {
* Ajax handler for saving a widget.
*
* @since 3.1.0
*
* @global array $wp_registered_widgets
* @global array $wp_registered_widget_controls
* @global array $wp_registered_widget_updates
*/
function wp_ajax_save_widget() {
global $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_widget_updates;
@ -1832,6 +1855,8 @@ function wp_ajax_save_widget() {
* Ajax handler for saving a widget.
*
* @since 3.9.0
*
* @global WP_Customize_Manager $wp_customize
*/
function wp_ajax_update_widget() {
global $wp_customize;
@ -2475,6 +2500,9 @@ function wp_ajax_send_attachment_to_editor() {
* - video_send_to_editor_url
*
* @since 3.5.0
*
* @global WP_Post $post
* @global WP_Embed $wp_embed
*/
function wp_ajax_send_link_to_editor() {
global $post, $wp_embed;
@ -2627,6 +2655,8 @@ function wp_ajax_get_revision_diffs() {
* a user's own profile.
*
* @since 3.8.0
*
* @global array $_wp_admin_css_colors
*/
function wp_ajax_save_user_color_scheme() {
global $_wp_admin_css_colors;
@ -2652,6 +2682,9 @@ function wp_ajax_save_user_color_scheme() {
* Ajax handler for getting themes from themes_api().
*
* @since 3.9.0
*
* @global array $themes_allowedtags
* @global array $theme_field_defaults
*/
function wp_ajax_query_themes() {
global $themes_allowedtags, $theme_field_defaults;
@ -2699,8 +2732,9 @@ function wp_ajax_query_themes() {
*
* @since 4.0.0
*
* @global WP_Post $post Global $post.
* @global WP_Embed $wp_embed Embed API instance.
* @global WP_Post $post Global $post.
* @global WP_Embed $wp_embed Embed API instance.
* @global WP_Scripts $wp_scripts
*/
function wp_ajax_parse_embed() {
global $post, $wp_embed;
@ -2788,6 +2822,11 @@ function wp_ajax_parse_embed() {
) );
}
/**
*
* @global WP_Post $post
* @global WP_Scripts $wp_scripts
*/
function wp_ajax_parse_media_shortcode() {
global $post, $wp_scripts;
@ -2967,6 +3006,8 @@ function wp_ajax_update_plugin() {
* AJAX handler for saving a post from Press This.
*
* @since 4.2.0
*
* @global WP_Press_This $wp_press_this
*/
function wp_ajax_press_this_save_post() {
if ( empty( $GLOBALS['wp_press_this'] ) ) {
@ -2980,6 +3021,8 @@ function wp_ajax_press_this_save_post() {
* AJAX handler for creating new category from Press This.
*
* @since 4.2.0
*
* @global WP_Press_This $wp_press_this
*/
function wp_ajax_press_this_add_category() {
if ( empty( $GLOBALS['wp_press_this'] ) ) {

View File

@ -74,6 +74,8 @@ function get_default_link_to_edit() {
*
* @since 2.0.0
*
* @global wpdb $wpdb
*
* @param int $link_id ID of the link to delete
* @return bool True
*/
@ -137,6 +139,8 @@ function get_link_to_edit( $link_id ) {
*
* @since 2.0.0
*
* @global wpdb $wpdb
*
* @param array $linkdata Elements that make up the link to insert.
* @param bool $wp_error Optional. If true return WP_Error object on failure.
* @return int|WP_Error Value 0 or WP_Error on failure. The link ID on success.
@ -285,6 +289,8 @@ function wp_update_link( $linkdata ) {
/**
* @since 3.5.0
* @access private
*
* @global string $pagenow
*/
function wp_link_manager_disabled_message() {
global $pagenow;

View File

@ -33,6 +33,8 @@ class WP_Comments_List_Table extends WP_List_Table {
*
* @see WP_List_Table::__construct() for more information on default arguments.
*
* @global int $post_id
*
* @param array $args An associative array of arguments.
*/
public function __construct( $args = array() ) {
@ -55,6 +57,13 @@ class WP_Comments_List_Table extends WP_List_Table {
return current_user_can('edit_posts');
}
/**
*
* @global int $post_id
* @global string $comment_status
* @global string $search
* @global string $comment_type
*/
public function prepare_items() {
global $post_id, $comment_status, $search, $comment_type;
@ -153,6 +162,10 @@ class WP_Comments_List_Table extends WP_List_Table {
return $comments_per_page;
}
/**
*
* @global string $comment_status
*/
public function no_items() {
global $comment_status;
@ -162,6 +175,12 @@ class WP_Comments_List_Table extends WP_List_Table {
_e( 'No comments found.' );
}
/**
*
* @global int $post_id
* @global string $comment_status
* @global string $comment_type
*/
protected function get_views() {
global $post_id, $comment_status, $comment_type;
@ -215,6 +234,10 @@ class WP_Comments_List_Table extends WP_List_Table {
return $status_links;
}
/**
*
* @global string $comment_status
*/
protected function get_bulk_actions() {
global $comment_status;
@ -239,6 +262,12 @@ class WP_Comments_List_Table extends WP_List_Table {
return $actions;
}
/**
*
* @global string $comment_status
* @global string $comment_type
* @param string $which
*/
protected function extra_tablenav( $which ) {
global $comment_status, $comment_type;
?>
@ -299,6 +328,11 @@ class WP_Comments_List_Table extends WP_List_Table {
return parent::current_action();
}
/**
*
* @global int $post_id
* @return array
*/
public function get_columns() {
global $post_id;
@ -356,6 +390,12 @@ class WP_Comments_List_Table extends WP_List_Table {
$this->display_tablenav( 'bottom' );
}
/**
*
* @global WP_Post $post
* @global object $comment
* @param object $a_comment
*/
public function single_row( $a_comment ) {
global $post, $comment;
@ -383,6 +423,11 @@ class WP_Comments_List_Table extends WP_List_Table {
}
}
/**
*
* @global string $comment_status
* @param object $comment
*/
public function column_comment( $comment ) {
global $comment_status;
$post = get_post();
@ -512,6 +557,11 @@ class WP_Comments_List_Table extends WP_List_Table {
}
}
/**
*
* @global string $comment_status
* @param object $comment
*/
public function column_author( $comment ) {
global $comment_status;

View File

@ -12,6 +12,8 @@ class WP_Importer {
/**
* Returns array with imported permalinks from WordPress database
*
* @global wpdb $wpdb
*
* @param string $bid
* @return array
*/
@ -49,6 +51,8 @@ class WP_Importer {
/**
* Return count of imported permalinks from WordPress database
*
* @global wpdb $wpdb
*
* @param string $bid
* @return int
*/
@ -75,6 +79,8 @@ class WP_Importer {
/**
* Set array with imported comments from WordPress database
*
* @global wpdb $wpdb
*
* @param string $bid
* @return array
*/
@ -231,7 +237,8 @@ class WP_Importer {
/**
* Reset global variables that grow out of control during imports
*
* @return void
* @global wpdb $wpdb
* @global array $wp_actions
*/
public function stop_the_insanity() {
global $wpdb, $wp_actions;

View File

@ -30,6 +30,13 @@ class WP_Links_List_Table extends WP_List_Table {
return current_user_can( 'manage_links' );
}
/**
*
* @global int $cat_id
* @global string $s
* @global string $orderby
* @global string $order
*/
public function prepare_items() {
global $cat_id, $s, $orderby, $order;
@ -60,6 +67,11 @@ class WP_Links_List_Table extends WP_List_Table {
return $actions;
}
/**
*
* @global int $cat_id
* @param string $which
*/
protected function extra_tablenav( $which ) {
global $cat_id;
@ -108,6 +120,10 @@ class WP_Links_List_Table extends WP_List_Table {
);
}
/**
*
* @global int $cat_id
*/
public function display_rows() {
global $cat_id;

View File

@ -504,6 +504,9 @@ class WP_List_Table {
* @since 3.1.0
* @access protected
*
* @global wpdb $wpdb
* @global WP_Locale $wp_locale
*
* @param string $post_type
*/
protected function months_dropdown( $post_type ) {

View File

@ -41,6 +41,13 @@ class WP_Media_List_Table extends WP_List_Table {
return current_user_can('upload_files');
}
/**
*
* @global WP_Query $wp_query
* @global array $post_mime_types
* @global array $avail_post_mime_types
* @global string $mode
*/
public function prepare_items() {
global $wp_query, $post_mime_types, $avail_post_mime_types, $mode;
@ -57,6 +64,13 @@ class WP_Media_List_Table extends WP_List_Table {
) );
}
/**
*
* @global wpdb $wpdb
* @global array $post_mime_types
* @global array $avail_post_mime_types
* @return array
*/
protected function get_views() {
global $wpdb, $post_mime_types, $avail_post_mime_types;
@ -160,6 +174,8 @@ class WP_Media_List_Table extends WP_List_Table {
/**
* Override parent views so we can use the filter bar display.
*
* @global string $mode
*/
public function views() {
global $mode;
@ -270,6 +286,10 @@ class WP_Media_List_Table extends WP_List_Table {
);
}
/**
*
* @global WP_Post $post
*/
public function display_rows() {
global $post;

View File

@ -30,6 +30,12 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
return current_user_can( 'manage_sites' );
}
/**
*
* @global string $s
* @global string $mode
* @global wpdb $wpdb
*/
public function prepare_items() {
global $s, $mode, $wpdb;
@ -147,6 +153,8 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
}
/**
* @global string $mode
*
* @param string $which
*/
protected function pagination( $which ) {
@ -192,6 +200,10 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
);
}
/**
*
* @global string $mode
*/
public function display_rows() {
global $mode;

View File

@ -22,6 +22,9 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
*
* @see WP_List_Table::__construct() for more information on default arguments.
*
* @global string $status
* @global int $page
*
* @param array $args An associative array of arguments.
*/
public function __construct( $args = array() ) {
@ -56,6 +59,15 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
return current_user_can( 'manage_network_themes' );
}
/**
*
* @global string $status
* @global array $totals
* @global int $page
* @global string $orderby
* @global string $order
* @global string $s
*/
public function prepare_items() {
global $status, $totals, $page, $orderby, $order, $s;
@ -199,9 +211,11 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
_e( 'You do not appear to have any themes available at this time.' );
}
/**
*
* @return array
*/
public function get_columns() {
global $status;
return array(
'cb' => '<input type="checkbox" />',
'name' => __( 'Theme' ),
@ -215,6 +229,12 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
);
}
/**
*
* @global array $totals
* @global string $status
* @return array
*/
protected function get_views() {
global $totals, $status;
@ -258,6 +278,11 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
return $status_links;
}
/**
*
* @global string $status
* @return array
*/
protected function get_bulk_actions() {
global $status;

View File

@ -13,6 +13,13 @@ class WP_MS_Users_List_Table extends WP_List_Table {
return current_user_can( 'manage_network_users' );
}
/**
*
* @global string $usersearch
* @global string $role
* @global wpdb $wpdb
* @global string $mode
*/
public function prepare_items() {
global $usersearch, $role, $wpdb, $mode;
@ -86,6 +93,11 @@ class WP_MS_Users_List_Table extends WP_List_Table {
_e( 'No users found.' );
}
/**
*
* @global string $role
* @return array
*/
protected function get_views() {
global $role;
@ -146,6 +158,10 @@ class WP_MS_Users_List_Table extends WP_List_Table {
);
}
/**
*
* @global string $mode
*/
public function display_rows() {
global $mode;

View File

@ -48,6 +48,15 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
return $slugs;
}
/**
*
* @global array $tabs
* @global string $tab
* @global int $paged
* @global string $type
* @global string $term
* @global string $wp_version
*/
public function prepare_items() {
include( ABSPATH . 'wp-admin/includes/plugin-install.php' );
@ -208,6 +217,12 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
echo '<div class="no-plugin-results">' . $message . '</div>';
}
/**
*
* @global array $tabs
* @global string $tab
* @return array
*/
protected function get_views() {
global $tabs, $tab;
@ -276,6 +291,8 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
}
/**
* @global string $tab
*
* @param string $which
*/
protected function display_tablenav( $which ) {
@ -341,6 +358,9 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
}
}
/**
* @global string $wp_version
*/
public function display_rows() {
$plugins_allowedtags = array(
'a' => array( 'href' => array(),'title' => array(), 'target' => array() ),

View File

@ -17,6 +17,9 @@ class WP_Plugins_List_Table extends WP_List_Table {
*
* @see WP_List_Table::__construct() for more information on default arguments.
*
* @global string $status
* @global int $page
*
* @param array $args An associative array of arguments.
*/
public function __construct( $args = array() ) {
@ -45,6 +48,16 @@ class WP_Plugins_List_Table extends WP_List_Table {
return current_user_can('activate_plugins');
}
/**
*
* @global string $status
* @global type $plugins
* @global array $totals
* @global int $page
* @global string $orderby
* @global string $order
* @global string $s
*/
public function prepare_items() {
global $status, $plugins, $totals, $page, $orderby, $order, $s;
@ -241,6 +254,10 @@ class WP_Plugins_List_Table extends WP_List_Table {
return ( $a < $b ) ? -1 : 1;
}
/**
*
* @global array $plugins
*/
public function no_items() {
global $plugins;
@ -250,6 +267,11 @@ class WP_Plugins_List_Table extends WP_List_Table {
_e( 'You do not appear to have any plugins available at this time.' );
}
/**
*
* @global string $status
* @return array
*/
public function get_columns() {
global $status;
@ -264,6 +286,12 @@ class WP_Plugins_List_Table extends WP_List_Table {
return array();
}
/**
*
* @global array $totals
* @global string $status
* @return array
*/
protected function get_views() {
global $totals, $status;
@ -308,6 +336,11 @@ class WP_Plugins_List_Table extends WP_List_Table {
return $status_links;
}
/**
*
* @global string $status
* @return array
*/
protected function get_bulk_actions() {
global $status;
@ -373,6 +406,10 @@ class WP_Plugins_List_Table extends WP_List_Table {
return parent::current_action();
}
/**
*
* @global string $status
*/
public function display_rows() {
global $status;

View File

@ -55,6 +55,9 @@ class WP_Posts_List_Table extends WP_List_Table {
*
* @see WP_List_Table::__construct() for more information on default arguments.
*
* @global object $post_type_object
* @global wpdb $wpdb
*
* @param array $args An associative array of arguments.
*/
public function __construct( $args = array() ) {
@ -101,6 +104,13 @@ class WP_Posts_List_Table extends WP_List_Table {
return current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_posts );
}
/**
*
* @global array $avail_post_stati
* @global WP_Query $wp_query
* @global int $per_page
* @global string $mode
*/
public function prepare_items() {
global $avail_post_stati, $wp_query, $per_page, $mode;
@ -163,6 +173,12 @@ class WP_Posts_List_Table extends WP_List_Table {
}
}
/**
*
* @global array $locked_post_status This seems to be deprecated.
* @global array $avail_post_stati
* @return array
*/
protected function get_views() {
global $locked_post_status, $avail_post_stati;
@ -467,7 +483,8 @@ class WP_Posts_List_Table extends WP_List_Table {
}
/**
* @global wpdb $wpdb
* @global wpdb $wpdb
* @global WP_Post $post
* @param array $pages
* @param int $pagenum
* @param int $per_page
@ -628,7 +645,9 @@ class WP_Posts_List_Table extends WP_List_Table {
}
/**
* @global string $mode
* @global string $mode
* @global WP_Post $post
*
* @param WP_Post $post
* @param int $level
*/
@ -991,6 +1010,8 @@ class WP_Posts_List_Table extends WP_List_Table {
* Outputs the hidden row displayed when inline editing
*
* @since 3.1.0
*
* @global string $mode
*/
public function inline_edit() {
global $mode;

View File

@ -1148,6 +1148,10 @@ class WP_Press_This {
*
* @since 4.2.0
* @access public
*
* @global WP_Locale $wp_locale
* @global string $wp_version
* @global bool $is_IE
*/
public function html() {
global $wp_locale, $wp_version;
@ -1463,4 +1467,8 @@ class WP_Press_This {
}
}
/**
*
* @global WP_Press_This $wp_press_this
*/
$GLOBALS['wp_press_this'] = new WP_Press_This;

View File

@ -21,6 +21,11 @@ class WP_Terms_List_Table extends WP_List_Table {
*
* @see WP_List_Table::__construct() for more information on default arguments.
*
* @global string $post_type
* @global string $taxonomy
* @global string $action
* @global object $tax
*
* @param array $args An associative array of arguments.
*/
public function __construct( $args = array() ) {

View File

@ -15,6 +15,14 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
return current_user_can( 'install_themes' );
}
/**
*
* @global array $tabs
* @global string $tab
* @global int $paged
* @global string $type
* @global array $theme_field_defaults
*/
public function prepare_items() {
include( ABSPATH . 'wp-admin/includes/theme-install.php' );
@ -137,6 +145,12 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
_e( 'No themes match your request.' );
}
/**
*
* @global array $tabs
* @global string $tab
* @return array
*/
protected function get_views() {
global $tabs, $tab;
@ -191,6 +205,8 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
/**
* Prints a theme from the WordPress.org API.
*
* @global array $themes_allowedtags
*
* @param object $theme An object that contains theme data returned by the WordPress.org API.
*
* Example theme data:
@ -332,6 +348,8 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
/**
* Prints the info for a theme (to be used in the theme installer modal).
*
* @global array $themes_allowedtags
*
* @param object $theme - A WordPress.org Theme API object.
*/
public function install_theme_info( $theme ) {
@ -396,8 +414,8 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
* @since 3.4.0
* @access public
*
* @uses $tab Global; current tab within Themes->Install screen
* @uses $type Global; type of search.
* @global string $tab Current tab within Themes->Install screen
* @global string $type Type of search.
*/
public function _js_vars( $extra_args = array() ) {
global $tab, $type;

View File

@ -142,6 +142,8 @@ class WP_Upgrader {
*
* @since 2.8.0
*
* @global WP_Filesystem_Base $wp_filesystem Subclass
*
* @param array $directories Optional. A list of directories. If any of these do
* not exist, a {@see WP_Error} object will be returned.
* Default empty array.
@ -244,6 +246,8 @@ class WP_Upgrader {
*
* @since 2.8.0
*
* @global WP_Filesystem_Base $wp_filesystem Subclass
*
* @param string $package Full path to the package file.
* @param bool $delete_package Optional. Whether to delete the package file after attempting
* to unpack it. Default true.
@ -297,6 +301,9 @@ class WP_Upgrader {
*
* @since 2.8.0
*
* @global WP_Filesystem_Base $wp_filesystem Subclass
* @global array $wp_theme_directories
*
* @param array|string $args {
* Optional. Array or string of arguments for installing a package. Default empty array.
*
@ -626,6 +633,8 @@ class WP_Upgrader {
*
* @since 2.8.0
*
* @global WP_Filesystem_Base $wp_filesystem Subclass
*
* @param bool $enable True to enable maintenance mode, false to disable.
*/
public function maintenance_mode( $enable = false ) {
@ -957,6 +966,8 @@ class Plugin_Upgrader extends WP_Upgrader {
*
* @since 3.3.0
*
* @global WP_Filesystem_Base $wp_filesystem Subclass
*
* @param string $source The path to the downloaded package source.
* @return string|WP_Error The source as passed, or a {@see WP_Error} object if no plugins were found.
*/
@ -1050,6 +1061,8 @@ class Plugin_Upgrader extends WP_Upgrader {
* {@see Plugin_Upgrader::upgrade()} and {@see Plugin_Upgrader::bulk_upgrade()}.
*
* @since 2.8.0
*
* @global WP_Filesystem_Base $wp_filesystem Subclass
*/
public function delete_old_plugin($removed, $local_destination, $remote_destination, $plugin) {
global $wp_filesystem;
@ -1472,6 +1485,8 @@ class Theme_Upgrader extends WP_Upgrader {
*
* @since 3.3.0
*
* @global WP_Filesystem_Base $wp_filesystem Subclass
*
* @param string $source The full path to the package source.
* @return string|WP_Error The source or a WP_Error.
*/
@ -1563,6 +1578,8 @@ class Theme_Upgrader extends WP_Upgrader {
* and {@see Theme_Upgrader::bulk_upgrade()}.
*
* @since 2.8.0
*
* @global WP_Filesystem_Base $wp_filesystem Subclass
*/
public function delete_old_theme( $removed, $local_destination, $remote_destination, $theme ) {
global $wp_filesystem;
@ -1735,6 +1752,8 @@ class Language_Pack_Upgrader extends WP_Upgrader {
*
* @since 3.7.0
*
* @global WP_Filesystem_Base $wp_filesystem Subclass
*
* @param array $language_updates Optional. Language pack updates. Default empty array.
* @param array $args {
* Optional. Other arguments for upgrading multiple language packs. Default empty array
@ -1859,6 +1878,8 @@ class Language_Pack_Upgrader extends WP_Upgrader {
* {@see Language_Pack_Upgrader::bulk_upgrade()}.
*
* @since 3.7.0
*
* @global WP_Filesystem_Base $wp_filesystem Subclass
*/
public function check_package( $source, $remote_source ) {
global $wp_filesystem;
@ -1945,6 +1966,9 @@ class Core_Upgrader extends WP_Upgrader {
*
* @since 2.8.0
*
* @global WP_Filesystem_Base $wp_filesystem Subclass
* @global callback $_wp_filesystem_direct_method
*
* @param object $current Response object for whether WordPress is current.
* @param array $args {
* Optional. Arguments for upgrading WordPress core. Default empty array.
@ -2218,6 +2242,9 @@ class Core_Upgrader extends WP_Upgrader {
*
* @since 3.7.0
*
* @global string $wp_version
* @global string $wp_local_package
*
* @return bool True if the checksums match, otherwise false.
*/
public function check_files() {
@ -2463,6 +2490,8 @@ class WP_Automatic_Updater {
*
* @since 3.7.0
*
* @global wpdb $wpdb
*
* @param string $type The type of update being checked: 'core', 'theme',
* 'plugin', 'translation'.
* @param object $item The update offer.
@ -2687,6 +2716,9 @@ class WP_Automatic_Updater {
* Kicks off the background update process, looping through all pending updates.
*
* @since 3.7.0
*
* @global wpdb $wpdb
* @global string $wp_version
*/
public function run() {
global $wpdb, $wp_version;
@ -2822,6 +2854,8 @@ class WP_Automatic_Updater {
* If we tried to perform a core update, check if we should send an email,
* and if we need to avoid processing future updates.
*
* @global string $wp_version
*
* @param object $update_result The result of the core update. Includes the update offer and result.
*/
protected function after_core_update( $update_result ) {
@ -2909,6 +2943,8 @@ class WP_Automatic_Updater {
*
* @since 3.7.0
*
* @global string $wp_version
*
* @param string $type The type of email to send. Can be one of 'success', 'fail', 'manual', 'critical'.
* @param object $core_update The update offer that was attempted.
* @param mixed $result Optional. The result for the core update. Can be WP_Error.

View File

@ -69,6 +69,9 @@ class WP_Users_List_Table extends WP_List_Table {
*
* @since 3.1.0
* @access public
*
* @global string $role
* @global string $usersearch
*/
public function prepare_items() {
global $role, $usersearch;
@ -133,10 +136,14 @@ class WP_Users_List_Table extends WP_List_Table {
* @since 3.1.0
* @access protected
*
* @global string $role
*
* @return array An array of HTML links, one for each view.
*/
protected function get_views() {
global $wp_roles, $role;
global $role;
$wp_roles = wp_roles();
if ( $this->is_site_users ) {
$url = 'site-users.php?id=' . $this->site_id;
@ -329,8 +336,6 @@ class WP_Users_List_Table extends WP_List_Table {
* @since 4.2.0 The `$style` argument was deprecated.
* @access public
*
* @global WP_Roles $wp_roles User roles object.
*
* @param object $user_object The current user object.
* @param string $style Deprecated. Not used.
* @param string $role Optional. Key for the $wp_roles array. Default empty.
@ -339,7 +344,7 @@ class WP_Users_List_Table extends WP_List_Table {
* @return string Output for a single row.
*/
public function single_row( $user_object, $style = '', $role = '', $numposts = 0 ) {
global $wp_roles;
$wp_roles = wp_roles();
if ( ! ( $user_object instanceof WP_User ) ) {
$user_object = get_userdata( (int) $user_object );

View File

@ -156,7 +156,8 @@ function get_pending_comments_num( $post_id ) {
* Add avatars to relevant places in admin, or try to.
*
* @since 2.5.0
* @uses $comment
*
* @global object $comment
*
* @param string $name User name.
* @return string Avatar with Admin name.

View File

@ -12,6 +12,10 @@
* Handles POST data, sets up filters.
*
* @since 2.5.0
*
* @global array $wp_registered_widgets
* @global array $wp_registered_widget_controls
* @global array $wp_dashboard_control_callbacks
*/
function wp_dashboard_setup() {
global $wp_registered_widgets, $wp_registered_widget_controls, $wp_dashboard_control_callbacks;
@ -125,6 +129,16 @@ function wp_dashboard_setup() {
do_action( 'do_meta_boxes', $screen->id, 'side', '' );
}
/**
*
* @global array $wp_dashboard_control_callbacks
*
* @param string $widget_id
* @param string $widget_name
* @param callback $callback
* @param callback $control_callback
* @param array $callback_args
*/
function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_callback = null, $callback_args = null ) {
$screen = get_current_screen();
global $wp_dashboard_control_callbacks;
@ -413,6 +427,8 @@ function wp_network_dashboard_right_now() {
*
* @since 3.8.0
*
* @global int $post_ID
*
* @param string $error_msg Optional. Error message. Default false.
*/
function wp_dashboard_quick_press( $error_msg = false ) {
@ -517,6 +533,12 @@ function wp_dashboard_recent_drafts( $drafts = false ) {
echo "</ul>\n</div>";
}
/**
* @global object $comment
*
* @param object $comment
* @param bool $show_date
*/
function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
$GLOBALS['comment'] =& $comment;
@ -874,6 +896,8 @@ function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = ar
*
* @since 2.5.0
*
* @global array $wp_dashboard_control_callbacks
*
* @param int $widget_control_id Registered Widget ID.
*/
function wp_dashboard_trigger_widget_control( $widget_control_id = false ) {
@ -1231,6 +1255,8 @@ function dashboard_browser_nag_class( $classes ) {
*
* @since 3.2.0
*
* @global string $wp_version
*
* @return array|bool False on failure, array of browser data on success.
*/
function wp_check_browser_version() {

View File

@ -20,6 +20,9 @@ define( 'WXR_VERSION', '1.2' );
*
* @since 2.1.0
*
* @global wpdb $wpdb
* @global WP_Post $post
*
* @param array $args Filters defining what should be included in the export.
*/
function export_wp( $args = array() ) {
@ -244,6 +247,8 @@ function export_wp( $args = array() ) {
*
* @since 3.1.0
*
* @global wpdb $wpdb
*
* @param array $post_ids Array of post IDs to filter the query by. Optional.
*/
function wxr_authors_list( array $post_ids = null ) {
@ -375,6 +380,9 @@ function export_wp( $args = array() ) {
?>
<?php if ( $post_ids ) {
/**
* @global WP_Query $wp_query
*/
global $wp_query;
// Fake being in the loop.

View File

@ -50,7 +50,7 @@ $wp_file_descriptions = array(
*
* @since 1.5.0
*
* @uses $wp_file_descriptions
* @global array $wp_file_descriptions
* @param string $file Filesystem path or filename
* @return string Description of file from $wp_file_descriptions or basename of $file if description doesn't exist
*/
@ -516,6 +516,8 @@ function verify_file_md5( $filename, $expected_md5 ) {
*
* @since 2.5.0
*
* @global WP_Filesystem_Base $wp_filesystem Subclass
*
* @param string $file Full path and filename of zip archive
* @param string $to Full path on the filesystem to extract archive to
* @return mixed WP_Error on failure, True on success
@ -579,6 +581,8 @@ function unzip_file($file, $to) {
* @see unzip_file
* @access private
*
* @global WP_Filesystem_Base $wp_filesystem Subclass
*
* @param string $file Full path and filename of zip archive
* @param string $to Full path on the filesystem to extract archive to
* @param array $needed_dirs A partial list of required folders needed to be created.
@ -677,6 +681,8 @@ function _unzip_file_ziparchive($file, $to, $needed_dirs = array() ) {
* @see unzip_file
* @access private
*
* @global WP_Filesystem_Base $wp_filesystem Subclass
*
* @param string $file Full path and filename of zip archive
* @param string $to Full path on the filesystem to extract archive to
* @param array $needed_dirs A partial list of required folders needed to be created.
@ -769,6 +775,8 @@ function _unzip_file_pclzip($file, $to, $needed_dirs = array()) {
*
* @since 2.5.0
*
* @global WP_Filesystem_Base $wp_filesystem Subclass
*
* @param string $from source directory
* @param string $to destination directory
* @param array $skip_list a list of files/folders to skip copying
@ -823,6 +831,8 @@ function copy_dir($from, $to, $skip_list = array() ) {
*
* @since 2.5.0
*
* @global WP_Filesystem_Base $wp_filesystem Subclass
*
* @param array|false $args Optional. Connection args, These are passed directly to
* the `WP_Filesystem_*()` classes. Default false.
* @param string|false $context Optional. Context for get_filesystem_method(). Default false.
@ -900,6 +910,8 @@ function WP_Filesystem( $args = false, $context = false, $allow_relaxed_file_own
*
* @since 2.5.0
*
* @global callback $_wp_filesystem_direct_method
*
* @param array $args Optional. Connection details. Default empty array.
* @param string $context Optional. Full path to the directory that is tested
* for being writable. Default false.

View File

@ -672,6 +672,8 @@ function wp_restore_image($post_id) {
* Saves image to post along with enqueued changes
* in $_REQUEST['history']
*
* @global array $_wp_additional_image_sizes
*
* @param int $post_id
* @return \stdClass
*/

View File

@ -67,6 +67,8 @@ function wp_crop_image( $src, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $s
*
* @since 2.1.0
*
* @global array $_wp_additional_image_sizes
*
* @param int $attachment_id Attachment Id to process.
* @param string $file Filepath of the Attached image.
* @return mixed Metadata for attachment.

View File

@ -11,6 +11,7 @@
*
* @since 2.0.0
*
* @global array $wp_importers
* @return array
*/
function get_importers() {
@ -42,6 +43,8 @@ function _usort_by_first_member( $a, $b ) {
*
* @since 2.0.0
*
* @global array $wp_importers
*
* @param string $id Importer tag. Used to uniquely identify importer.
* @param string $name Importer name and title.
* @param string $description Importer description.

View File

@ -13,6 +13,8 @@
* @access private
* @since 3.1.0
*
* @global string $hook_suffix
*
* @param string $class The type of the list table, which is the class name.
* @param array $args Optional. Arguments to pass to the class. Accepts 'screen'.
* @return object|bool Object on success, false if the class does not exist.

View File

@ -36,6 +36,8 @@ function media_upload_tabs() {
*
* @since 2.5.0
*
* @global wpdb $wpdb
*
* @param array $tabs
* @return array $tabs with gallery if post has image attachment
*/
@ -67,6 +69,8 @@ add_filter('media_upload_tabs', 'update_gallery_tab');
* {@internal Missing Short Description}}
*
* @since 2.5.0
*
* @global string $redir_tab
*/
function the_media_upload_tabs() {
global $redir_tab;
@ -433,6 +437,8 @@ function media_handle_sideload($file_array, $post_id, $desc = null, $post_data =
*
* @since 2.5.0
*
* @global int $body_id
*
* @param string|callable $content_func
*/
function wp_iframe($content_func /* ... */) {
@ -527,6 +533,8 @@ document.body.className = document.body.className.replace('no-js', 'js');
*
* @since 2.5.0
*
* @global int $post_ID
*
* @param string $editor_id
*/
function media_buttons($editor_id = 'content') {
@ -1288,6 +1296,8 @@ function get_attachment_fields_to_edit($post, $errors = null) {
*
* @since 2.5.0
*
* @global WP_Query $wp_the_query
*
* @param int $post_id Optional. Post ID.
* @param array $errors Errors for attachment, if any.
* @return string
@ -1322,6 +1332,8 @@ function get_media_items( $post_id, $errors ) {
*
* @since 2.5.0
*
* @global string $redir_tab
*
* @param int $attachment_id Attachment ID for modification.
* @param string|array $args Optional. Override defaults.
* @return string HTML form for attachment.
@ -1736,6 +1748,11 @@ function media_upload_header() {
*
* @since 2.5.0
*
* @global string $type
* @global string $tab
* @global bool $is_IE
* @global bool $is_opera
*
* @param array $errors
*/
function media_upload_form( $errors = null ) {
@ -2135,6 +2152,10 @@ echo apply_filters( 'type_url_form_media', wp_media_insert_url_form( $type ) );
*
* @since 2.5.0
*
* @global string $redir_tab
* @global string $type
* @global string $tab
*
* @param array $errors
*/
function media_upload_gallery_form($errors) {
@ -2280,6 +2301,13 @@ jQuery(function($){
*
* @since 2.5.0
*
* @global wpdb $wpdb
* @global WP_Query $wp_query
* @global WP_Locale $wp_locale
* @global string $type
* @global string $tab
* @global array $post_mime_types
*
* @param array $errors
*/
function media_upload_library_form($errors) {
@ -2564,6 +2592,8 @@ function wp_media_insert_url_form( $default_view = 'image' ) {
* Displays the multi-file uploader message.
*
* @since 2.6.0
*
* @global int $post_ID
*/
function media_upload_flash_bypass() {
$browser_uploader = admin_url( 'media-new.php?browser-uploader' );

View File

@ -279,6 +279,15 @@ if ( apply_filters( 'custom_menu_order', false ) ) {
$menu_order = array_flip($menu_order);
$default_menu_order = array_flip($default_menu_order);
/**
*
* @global array $menu_order
* @global array $default_menu_order
*
* @param array $a
* @param array $b
* @return int
*/
function sort_menu($a, $b) {
global $menu_order, $default_menu_order;
$a = $a[2];

View File

@ -7,6 +7,8 @@
*
* @since 2.7.0
*
* @global string $action
*
* @param object $post
*/
function post_submit_meta_box($post, $args = array() ) {
@ -670,6 +672,8 @@ function post_slug_meta_box($post) {
*
* @since 2.6.0
*
* @global int $user_ID
*
* @param object $post
*/
function post_author_meta_box($post) {
@ -913,6 +917,8 @@ function link_target_meta_box($link) { ?>
*
* @since 1.0.1
*
* @global object $link
*
* @param string $class
* @param string $value
* @param mixed $deprecated Never used.

View File

@ -38,6 +38,8 @@ function got_mod_rewrite() {
*
* @since 3.7.0
*
* @global bool $is_nginx
*
* @return bool Whether the server supports URL rewriting.
*/
function got_url_rewrite() {
@ -153,6 +155,8 @@ function insert_with_markers( $filename, $marker, $insertion ) {
* blank out old rules.
*
* @since 1.5.0
*
* @global WP_Rewrite $wp_rewrite
*/
function save_mod_rewrite_rules() {
if ( is_multisite() )
@ -183,6 +187,8 @@ function save_mod_rewrite_rules() {
*
* @since 2.8.0
*
* @global WP_Rewrite $wp_rewrite
*
* @return bool True if web.config was updated successfully
*/
function iis7_save_url_rewrite_rules(){
@ -593,6 +599,8 @@ function saveDomDocument($doc, $filename) {
* Display the default admin color scheme picker (Used in user-edit.php)
*
* @since 3.0.0
*
* @global array $_wp_admin_css_colors
*/
function admin_color_scheme_picker( $user_id ) {
global $_wp_admin_css_colors;
@ -646,6 +654,10 @@ function admin_color_scheme_picker( $user_id ) {
<?php
}
/**
*
* @global array $_wp_admin_css_colors
*/
function wp_color_scheme_settings() {
global $_wp_admin_css_colors;
@ -787,6 +799,8 @@ add_filter( 'heartbeat_received', 'wp_refresh_post_nonces', 10, 3 );
*
* @since 3.8.0
*
* @global string $pagenow
*
* @param array $settings An array of Heartbeat settings.
* @return array Filtered Heartbeat settings.
*/
@ -833,6 +847,9 @@ add_filter( 'heartbeat_received', 'heartbeat_autosave', 500, 2 );
* when the user navigates to it with the browser's Back button. See #28037
*
* @since 4.0
*
* @global bool $is_safari
* @global bool $is_chrome
*/
function post_form_autocomplete_off() {
global $is_safari, $is_chrome;

View File

@ -48,6 +48,8 @@ add_filter( 'wp_handle_upload_prefilter', 'check_upload_size' );
*
* @since 3.0.0
*
* @global wpdb $wpdb
*
* @param int $blog_id Blog ID.
* @param bool $drop True if blog's table should be dropped. Default is false.
*/
@ -176,6 +178,8 @@ function wpmu_delete_blog( $blog_id, $drop = false ) {
*
* @todo Merge with wp_delete_user() ?
*
* @global wpdb $wpdb
*
* @param int $id The user ID.
* @return bool True if the user was deleted, otherwise false.
*/
@ -495,6 +499,8 @@ add_action( 'wpmueditblogaction', 'upload_space_setting' );
*
* @since 3.0.0
*
* @global wpdb $wpdb
*
* @param int $id The user ID.
* @param string $pref The column in the wp_users table to update the user's status
* in (presumably user_status, spam, or deleted).
@ -842,6 +848,8 @@ function choose_primary_blog() {
*
* @since 3.0.0
*
* @global array $super_admins
*
* @param int $user_id ID of the user to be granted Super Admin privileges.
* @return bool True on success, false on failure. This can fail when the user is
* already a super admin or when the `$super_admins` global is defined.
@ -887,6 +895,8 @@ function grant_super_admin( $user_id ) {
*
* @since 3.0.0
*
* @global array $super_admins
*
* @param int $user_id ID of the user Super Admin privileges to be revoked from.
* @return bool True on success, false on failure. This can fail when the user's email
* is the network admin email or when the `$super_admins` global is defined.
@ -937,6 +947,8 @@ function revoke_super_admin( $user_id ) {
*
* @since 3.1.0
*
* @global wpdb $wpdb
*
* @param int $site_id The network/site ID to check.
* @return bool True if network can be edited, otherwise false.
*/

View File

@ -40,6 +40,8 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
* @see Walker_Nav_Menu::start_el()
* @since 3.0.0
*
* @global int $_wp_nav_menu_max_depth
*
* @param string $output Passed by reference. Used to append additional content.
* @param object $item Menu item data object.
* @param int $depth Depth of menu item. Used for padding.
@ -280,6 +282,8 @@ class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
*
* @since 3.0.0
*
* @global int $_nav_menu_placeholder
*
* @param string $output Passed by reference. Used to append additional content.
* @param object $item Menu item data object.
* @param int $depth Depth of menu item. Used for padding.
@ -463,6 +467,8 @@ function wp_nav_menu_setup() {
* Limit the amount of meta boxes to just links, pages and cats for first time users.
*
* @since 3.0.0
*
* @global array $wp_meta_boxes
**/
function wp_initial_nav_menu_meta_boxes() {
global $wp_meta_boxes;
@ -549,7 +555,7 @@ function wp_nav_menu_taxonomy_meta_boxes() {
*
* @since 3.6.0
*
* @uses global $one_theme_location_no_menus to determine if no menus exist
* @global bool $one_theme_location_no_menus to determine if no menus exist
*
* @param int|string $nav_menu_selected_id (id, name or slug) of the currently-selected menu
* @return string Disabled attribute if at least one menu exists, false if not
@ -567,6 +573,9 @@ function wp_nav_menu_disabled_check( $nav_menu_selected_id ) {
* Displays a metabox for the custom links menu item.
*
* @since 3.0.0
*
* @global int $_nav_menu_placeholder
* @global int|string $nav_menu_selected_id
*/
function wp_nav_menu_item_link_meta_box() {
global $_nav_menu_placeholder, $nav_menu_selected_id;
@ -606,6 +615,9 @@ function wp_nav_menu_item_link_meta_box() {
*
* @since 3.0.0
*
* @global int $_nav_menu_placeholder
* @global int|string $nav_menu_selected_id
*
* @param string $object Not used.
* @param string $post_type The post type object.
*/
@ -849,6 +861,8 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) {
*
* @since 3.0.0
*
* @global int|string $nav_menu_selected_id
*
* @param string $object Not used.
* @param string $taxonomy The taxonomy object.
*/
@ -1228,6 +1242,7 @@ function wp_nav_menu_manage_columns() {
* @access private
* @since 3.0.0
*
* @global wpdb $wpdb
*/
function _wp_delete_orphaned_draft_menu_items() {
global $wpdb;

View File

@ -235,6 +235,8 @@ function install_plugins_favorites_form() {
* Display plugin content based on plugin list.
*
* @since 2.7.0
*
* @global WP_List_Table $wp_list_table
*/
function display_plugins_table() {
global $wp_list_table;
@ -337,6 +339,9 @@ function install_plugin_install_status($api, $loop = false) {
* Display plugin information in dialog box form.
*
* @since 2.7.0
*
* @global string $tab
* @global string $wp_version
*/
function install_plugin_information() {
global $tab;

View File

@ -751,6 +751,8 @@ function activate_plugins( $plugins, $redirect = '', $network_wide = false, $sil
*
* @since 2.6.0
*
* @global WP_Filesystem_Base $wp_filesystem
*
* @param array $plugins List of plugins to delete.
* @param string $deprecated Deprecated.
* @return bool|null|WP_Error True on success, false is $plugins is empty, WP_Error on failure.

View File

@ -333,7 +333,8 @@ $wp_queries = wp_get_db_schema( 'all' );
* @since 1.5.0
*
* @global wpdb $wpdb WordPress database abstraction object.
* @uses $wp_db_version
* @global int $wp_db_version
* @global int $wp_current_db_version
*/
function populate_options() {
global $wpdb, $wp_db_version, $wp_current_db_version;

View File

@ -28,7 +28,7 @@ function add_user() {
* @return int user id of the updated user
*/
function edit_user( $user_id = 0 ) {
global $wp_roles;
$wp_roles = wp_roles();
$user = new stdClass;
if ( $user_id ) {
$update = true;
@ -198,9 +198,7 @@ function edit_user( $user_id = 0 ) {
* @return array
*/
function get_editable_roles() {
global $wp_roles;
$all_roles = $wp_roles->roles;
$all_roles = wp_roles()->roles;
/**
* Filter the list of editable roles.
@ -236,6 +234,8 @@ function get_user_to_edit( $user_id ) {
*
* @since 2.0.0
*
* @global wpdb $wpdb
*
* @param int $user_id User ID.
* @return array
*/
@ -264,6 +264,8 @@ function get_users_drafts( $user_id ) {
*
* @since 2.0.0
*
* @global wpdb $wpdb
*
* @param int $id User ID.
* @param int $reassign Optional. Reassign posts and links to new User ID.
* @return bool True when finished.
@ -388,6 +390,12 @@ add_action('admin_init', 'default_password_nag_handler');
/**
* @since 2.8.0
*/
/**
*
* @global int $user_ID
*
* @param false $errors Deprecated.
*/
function default_password_nag_handler($errors = false) {
global $user_ID;
// Short-circuit it.
@ -424,6 +432,8 @@ add_action('admin_notices', 'default_password_nag');
/**
* @since 2.8.0
*
* @global string $pagenow
*/
function default_password_nag() {
global $pagenow;

View File

@ -10,6 +10,9 @@
* Display list of the available widgets.
*
* @since 2.5.0
*
* @global array $wp_registered_widgets
* @global array $wp_registered_widget_controls
*/
function wp_list_widgets() {
global $wp_registered_widgets, $wp_registered_widget_controls;
@ -99,6 +102,8 @@ function wp_list_widget_controls( $sidebar, $sidebar_name = '' ) {
*
* @since 2.5.0
*
* @global array $wp_registered_widgets
*
* @param array $params
* @return array
*/
@ -123,7 +128,14 @@ function wp_list_widget_controls_dynamic_sidebar( $params ) {
return $params;
}
function next_widget_id_number($id_base) {
/**
*
* @global array $wp_registered_widgets
*
* @param string $id_base
* @return int
*/
function next_widget_id_number( $id_base ) {
global $wp_registered_widgets;
$number = 1;
@ -143,6 +155,10 @@ function next_widget_id_number($id_base) {
*
* @since 2.5.0
*
* @global array $wp_registered_widgets
* @global array $wp_registered_widget_controls
* @global array $sidebars_widgets
*
* @param array $sidebar_args
* @return array
*/

View File

@ -154,6 +154,8 @@ function maybe_drop_column($table_name, $column_name, $drop_ddl) {
*
* @since 1.0.0
*
* @global wpdb $wpdb
*
* @param string $table_name Table name
* @param string $col_name Column name
* @param string $col_type Column type

View File

@ -159,6 +159,12 @@ if ( is_blog_installed() ) {
die( '<h1>' . __( 'Already Installed' ) . '</h1><p>' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '</p><p class="step"><a href="../wp-login.php" class="button button-large">' . __( 'Log In' ) . '</a></p></body></html>' );
}
/**
* @global string $wp_version
* @global string $required_php_version
* @global string $required_mysql_version
* @global wpdb $wpdb
*/
global $wp_version, $required_php_version, $required_mysql_version;
$php_version = phpversion();
@ -183,6 +189,10 @@ if ( ! is_string( $wpdb->base_prefix ) || '' === $wpdb->base_prefix ) {
die( '<h1>' . __( 'Configuration Error' ) . '</h1><p>' . __( 'Your <code>wp-config.php</code> file has an empty database table prefix, which is not supported.' ) . '</p></body></html>' );
}
/**
* @global string $wp_local_package
* @global WP_Locale $wp_locale
*/
$language = '';
if ( ! empty( $_REQUEST['language'] ) ) {
$language = preg_replace( '/[^a-zA-Z_]/', '', $_REQUEST['language'] );

View File

@ -9,6 +9,9 @@
if ( ! defined('ABSPATH') )
die();
/**
* @global string $opml
*/
global $opml;
/**

View File

@ -10,15 +10,20 @@
* The current page.
*
* @global string $self
* @name $self
* @var string
*/
$self = preg_replace('|^.*/wp-admin/network/|i', '', $_SERVER['PHP_SELF']);
$self = preg_replace('|^.*/wp-admin/|i', '', $self);
$self = preg_replace('|^.*/plugins/|i', '', $self);
$self = preg_replace('|^.*/mu-plugins/|i', '', $self);
global $menu, $submenu, $parent_file; //For when admin-header is included from within a function.
/**
* For when admin-header is included from within a function.
*
* @global array $menu
* @global array $submenu
* @global string $parent_file
*/
global $menu, $submenu, $parent_file;
/**
* Filter the parent file of an admin menu sub-menu item.
@ -39,9 +44,15 @@ get_admin_page_parent();
* @access private
* @since 2.7.0
*
* @global string $self
* @global string $parent_file
* @global string $submenu_file
* @global string $plugin_page
* @global string $typenow
*
* @param array $menu
* @param array $submenu
* @param bool $submenu_as_parent
* @param bool $submenu_as_parent
*/
function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
global $self, $parent_file, $submenu_file, $plugin_page, $typenow;

View File

@ -467,6 +467,8 @@ if ( current_theme_supports( 'menus' ) ) {
/*
* Ensure the user will be able to scroll horizontally
* by adding a class for the max menu depth.
*
* @global int $_wp_nav_menu_max_depth
*/
global $_wp_nav_menu_max_depth;
$_wp_nav_menu_max_depth = 0;
@ -477,7 +479,14 @@ if ( is_nav_menu( $nav_menu_selected_id ) ) {
$edit_markup = wp_get_nav_menu_to_edit( $nav_menu_selected_id );
}
function wp_nav_menu_max_depth($classes) {
/**
*
* @global int $_wp_nav_menu_max_depth
*
* @param string $classes
* @return string
*/
function wp_nav_menu_max_depth( $classes ) {
global $_wp_nav_menu_max_depth;
return "$classes menu-max-depth-$_wp_nav_menu_max_depth";
}

View File

@ -35,6 +35,9 @@ foreach ( $wpdb->tables( 'ms_global' ) as $table => $prefixed_table )
* Check for an existing network.
*
* @since 3.0.0
*
* @global wpdb $wpdb
*
* @return Whether a network exists.
*/
function network_domain_check() {
@ -64,6 +67,9 @@ function allow_subdomain_install() {
* Allow subdirectory install.
*
* @since 3.0.0
*
* @global wpdb $wpdb
*
* @return bool Whether subdirectory install is allowed
*/
function allow_subdirectory_install() {
@ -149,6 +155,8 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
* should not be a sudden "Welcome to a new install process! Fill this out and click here." See also contextual help todo.
*
* @since 3.0.0
*
* @global bool $is_apache
*/
function network_step1( $errors = false ) {
global $is_apache;
@ -326,6 +334,8 @@ function network_step1( $errors = false ) {
* Prints step 2 for Network installation process.
*
* @since 3.0.0
*
* @global wpdb $wpdb
*/
function network_step2( $errors = false ) {
global $wpdb;

View File

@ -48,6 +48,9 @@ switch ( $action ) {
$n = ( isset($_GET['n']) ) ? intval($_GET['n']) : 0;
if ( $n < 5 ) {
/**
* @global string $wp_db_version
*/
global $wp_db_version;
update_site_option( 'wpmu_upgrade_site', $wp_db_version );
}

View File

@ -321,6 +321,9 @@ if ( empty($tzstring) ) { // Create a UTC+- zone if no timezone string exists
<th scope="row"><label for="start_of_week"><?php _e('Week Starts On') ?></label></th>
<td><select name="start_of_week" id="start_of_week">
<?php
/**
* @global WP_Locale $wp_locale
*/
global $wp_locale;
for ($day_index = 0; $day_index <= 6; $day_index++) :

View File

@ -84,7 +84,11 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
<?php do_settings_fields('media', 'default'); ?>
</table>
<?php if ( isset( $GLOBALS['wp_settings']['media']['embeds'] ) ) : ?>
<?php
/**
* @global array $wp_settings
*/
if ( isset( $GLOBALS['wp_settings']['media']['embeds'] ) ) : ?>
<h3 class="title"><?php _e('Embeds') ?></h3>
<table class="form-table">
<?php do_settings_fields( 'media', 'embeds' ); ?>

View File

@ -9,6 +9,11 @@
/** Load WordPress Administration Bootstrap */
require_once( dirname( __FILE__ ) . '/admin.php' );
/**
* @global string $post_type
* @global object $post_type_object
* @global WP_Post $post
*/
global $post_type, $post_type_object, $post;
if ( ! isset( $_GET['post_type'] ) ) {

View File

@ -23,6 +23,11 @@ elseif ( isset( $_POST['post_ID'] ) )
else
$post_id = $post_ID = 0;
/**
* @global string $post_type
* @global object $post_type_object
* @global WP_Post $post
*/
global $post_type, $post_type_object, $post;
if ( $post_id )

View File

@ -14,6 +14,9 @@ require_once( dirname( __FILE__ ) . '/admin.php' );
if ( ! current_user_can( 'edit_posts' ) || ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) )
wp_die( __( 'Cheatin&#8217; uh?' ), 403 );
/**
* @global WP_Press_This $wp_press_this
*/
if ( empty( $GLOBALS['wp_press_this'] ) ) {
include( ABSPATH . 'wp-admin/includes/class-wp-press-this.php' );
}

View File

@ -63,6 +63,10 @@ $step = isset( $_GET['step'] ) ? (int) $_GET['step'] : -1;
*
* @ignore
* @since 2.3.0
*
* @global string $wp_version
* @global string $wp_local_package
* @global WP_Locale $wp_locale
*/
function setup_config_display_header( $body_classes = array() ) {
global $wp_version;

View File

@ -22,6 +22,16 @@ if ( is_multisite() && ! is_network_admin() ) {
if ( ! current_user_can( 'update_core' ) && ! current_user_can( 'update_themes' ) && ! current_user_can( 'update_plugins' ) )
wp_die( __( 'You do not have sufficient permissions to update this site.' ) );
/**
*
* @global string $wp_local_package
* @global wpdb $wpdb
* @global string $wp_version
*
* @staticvar bool $first_pass
*
* @param object $update
*/
function list_core_update( $update ) {
global $wp_local_package, $wpdb, $wp_version;
static $first_pass = true;
@ -136,7 +146,9 @@ function dismissed_updates() {
*
* @since 2.7.0
*
* @return null
* @global string $wp_version
* @global string $required_php_version
* @global string $required_mysql_version
*/
function core_upgrade_preamble() {
global $wp_version, $required_php_version, $required_mysql_version;
@ -198,6 +210,10 @@ function core_upgrade_preamble() {
dismissed_updates();
}
/**
*
* @global string $wp_version
*/
function list_plugin_updates() {
global $wp_version;
@ -364,7 +380,7 @@ function list_translation_updates() {
*
* @since 2.7.0
*
* @return null
* @global WP_Filesystem_Base $wp_filesystem Subclass
*/
function do_core_upgrade( $reinstall = false ) {
global $wp_filesystem;

View File

@ -35,6 +35,12 @@ if ( 'upgrade_db' === $step ) {
die( '0' );
}
/**
* @global string $wp_version
* @global string $required_php_version
* @global string $required_mysql_version
* @global wpdb $wpdb
*/
global $wp_version, $required_php_version, $required_mysql_version;
$step = (int) $step;

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.3-alpha-32641';
$wp_version = '4.3-alpha-32642';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.