From 4011b3d4a8930292ed44eb1a4bd98e78dd5561a2 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Sat, 20 Feb 2010 00:50:29 +0000 Subject: [PATCH] Remove unused references to global $wpdb git-svn-id: https://develop.svn.wordpress.org/trunk@13240 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/formatting.php | 5 +---- wp-includes/functions.php | 3 --- wp-includes/link-template.php | 2 +- wp-includes/ms-functions.php | 2 -- wp-includes/post.php | 2 +- wp-includes/rss.php | 1 - 6 files changed, 3 insertions(+), 12 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index d2400b0445..4d10eb5cbb 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -1208,11 +1208,8 @@ function untrailingslashit($string) { * @return string Returns a string escaped with slashes. */ function addslashes_gpc($gpc) { - global $wpdb; - - if (get_magic_quotes_gpc()) { + if ( get_magic_quotes_gpc() ) $gpc = stripslashes($gpc); - } return esc_sql($gpc); } diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 674c6ea840..7af1feedab 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1442,15 +1442,12 @@ function remove_query_arg( $key, $query=false ) { /** * Walks the array while sanitizing the contents. * - * @uses $wpdb Used to sanitize values * @since 0.71 * * @param array $array Array to used to walk while sanitizing contents. * @return array Sanitized $array. */ function add_magic_quotes( $array ) { - global $wpdb; - foreach ( (array) $array as $k => $v ) { if ( is_array( $v ) ) { $array[$k] = add_magic_quotes( $v ); diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 30295d70c7..482a48b226 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -1076,7 +1076,7 @@ function prev_post_rel_link($title = '%title', $in_same_cat = false, $excluded_c * @return object */ function get_boundary_post($in_same_cat = false, $excluded_categories = '', $start = true) { - global $post, $wpdb; + global $post; if ( empty($post) || !is_single() || is_attachment() ) return null; diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index 38f2922084..e130abd587 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -1051,8 +1051,6 @@ function get_current_site() { } function get_user_id_from_string( $string ) { - global $wpdb; - $user_id = 0; if ( is_email( $string ) ) { $user = get_user_by('email', $string); diff --git a/wp-includes/post.php b/wp-includes/post.php index 775d17cbca..3866e2c6c4 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -3930,7 +3930,7 @@ function update_postmeta_cache($post_ids) { * @param bool $clean_terms optional. Whether to clean terms cache */ function clean_attachment_cache($id, $clean_terms = false) { - global $_wp_suspend_cache_invalidation, $wpdb; + global $_wp_suspend_cache_invalidation; if ( !empty($_wp_suspend_cache_invalidation) ) return; diff --git a/wp-includes/rss.php b/wp-includes/rss.php index 122277dfa2..a88cd2ce5a 100644 --- a/wp-includes/rss.php +++ b/wp-includes/rss.php @@ -715,7 +715,6 @@ class RSSCache { Output: true on sucess \*=======================================================================*/ function set ($url, $rss) { - global $wpdb; $cache_option = 'rss_' . $this->file_name( $url ); set_transient($cache_option, $rss, $this->MAX_AGE);