diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 15654fbb5b..d265830d24 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -103,8 +103,6 @@ function wp_ajax_fetch_list() { * @since 3.1.0 */ function wp_ajax_ajax_tag_search() { - global $wpdb; - if ( isset( $_GET['tax'] ) ) { $taxonomy = sanitize_key( $_GET['tax'] ); $tax = get_taxonomy( $taxonomy ); @@ -894,7 +892,7 @@ function wp_ajax_get_comments( $action ) { * @param string $action Action to perform. */ function wp_ajax_replyto_comment( $action ) { - global $wp_list_table, $wpdb; + global $wp_list_table; if ( empty( $action ) ) $action = 'replyto-comment'; diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index 437d2497bc..f930c749f8 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -761,8 +761,6 @@ function wp_dashboard_recent_posts( $args ) { * @return bool False if no comments were found. True otherwise. */ function wp_dashboard_recent_comments( $total_items = 5 ) { - global $wpdb; - // Select all comment types and filter out spam later for better query performance. $comments = array(); diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php index b9f7f63d10..b5bc75be2f 100644 --- a/wp-admin/includes/meta-boxes.php +++ b/wp-admin/includes/meta-boxes.php @@ -623,8 +623,6 @@ function post_comment_meta_box_thead($result) { * @param object $post */ function post_comment_meta_box( $post ) { - global $wpdb; - wp_nonce_field( 'get-comments', 'add_comment_nonce', false ); ?>
diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index bda4652390..2ceea9d81f 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -518,8 +518,6 @@ function bulk_edit_posts( $post_data = null ) { * @return WP_Post Post object containing all the default post data as attributes */ function get_default_post_to_edit( $post_type = 'post', $create_in_db = false ) { - global $wpdb; - $post_title = ''; if ( !empty( $_REQUEST['post_title'] ) ) $post_title = esc_html( wp_unslash( $_REQUEST['post_title'] )); @@ -733,7 +731,6 @@ function write_post() { * @return unknown */ function add_meta( $post_ID ) { - global $wpdb; $post_ID = (int) $post_ID; $metakeyselect = isset($_POST['metakeyselect']) ? wp_unslash( trim( $_POST['metakeyselect'] ) ) : ''; diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index 198205ad64..42ec2f1fcf 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -140,7 +140,7 @@ class WP_Roles { if ( ! $this->use_db ) return; - global $wpdb, $wp_user_roles; + global $wpdb; // Duplicated from _init() to avoid an extra function call. $this->role_key = $wpdb->get_blog_prefix() . 'user_roles'; diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php index d182224fd0..42b879ff61 100644 --- a/wp-includes/class-wp-xmlrpc-server.php +++ b/wp-includes/class-wp-xmlrpc-server.php @@ -3190,8 +3190,6 @@ class wp_xmlrpc_server extends IXR_Server { * @return mixed {@link wp_new_comment()} */ public function wp_newComment($args) { - global $wpdb; - $this->escape($args); $blog_id = (int) $args[0]; diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index f7013b208b..c9a9ba9228 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -753,7 +753,7 @@ function get_bloginfo( $show = '', $filter = 'raw' ) { * @return string|null String on retrieve, null when displaying. */ function wp_title($sep = '»', $display = true, $seplocation = '') { - global $wpdb, $wp_locale; + global $wp_locale; $m = get_query_var('m'); $year = get_query_var('year'); diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index f70f119210..3b72a9cbc7 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -3161,8 +3161,6 @@ function wp_update_term_count( $terms, $taxonomy, $do_deferred=false ) { * @return bool Always true when complete. */ function wp_update_term_count_now( $terms, $taxonomy ) { - global $wpdb; - $terms = array_map('intval', $terms); $taxonomy = get_taxonomy($taxonomy);