From 2283075a92be63341ab3d8c904f440534fc949d7 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 6 Dec 2007 06:37:30 +0000 Subject: [PATCH] Remove unused variables. Props DD32. see #5418 git-svn-id: http://svn.automattic.com/wordpress/trunk@6363 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/custom-header.php | 2 +- wp-admin/edit-link-form.php | 2 +- wp-admin/includes/bookmark.php | 2 -- wp-admin/includes/image.php | 2 +- wp-admin/includes/schema.php | 2 -- wp-admin/includes/taxonomy.php | 8 -------- wp-admin/includes/template.php | 11 +++++------ wp-admin/includes/upgrade.php | 2 +- wp-admin/includes/upload.php | 2 +- wp-admin/install-helper.php | 6 +++--- 10 files changed, 13 insertions(+), 26 deletions(-) diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index 2cda013b2..644626005 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -228,7 +228,7 @@ Event.observe( window, 'load', hide_text ); if ( $width == HEADER_IMAGE_WIDTH && $height == HEADER_IMAGE_HEIGHT ) { set_theme_mod('header_image', clean_url($url)); - $header = apply_filters('wp_create_file_in_uploads', $file, $id); // For replication + apply_filters('wp_create_file_in_uploads', $file, $id); // For replication return $this->finished(); } elseif ( $width > HEADER_IMAGE_WIDTH ) { $oitar = $width / HEADER_IMAGE_WIDTH; diff --git a/wp-admin/edit-link-form.php b/wp-admin/edit-link-form.php index ed59a145d..46c4d4b3f 100644 --- a/wp-admin/edit-link-form.php +++ b/wp-admin/edit-link-form.php @@ -11,7 +11,7 @@ if ( ! empty($link_id) ) { $nonce_action = 'add-bookmark'; } -function xfn_check($class, $value = '', $depreciated = null) { +function xfn_check($class, $value = '', $deprecated = '') { global $link; $link_rel = $link->link_rel; diff --git a/wp-admin/includes/bookmark.php b/wp-admin/includes/bookmark.php index 35cc9c9d2..7528da010 100644 --- a/wp-admin/includes/bookmark.php +++ b/wp-admin/includes/bookmark.php @@ -151,8 +151,6 @@ function wp_set_link_cats($link_id = 0, $link_categories = array()) { } // wp_set_link_cats() function wp_update_link($linkdata) { - global $wpdb; - $link_id = (int) $linkdata['link_id']; $link = get_link($link_id, ARRAY_A); diff --git a/wp-admin/includes/image.php b/wp-admin/includes/image.php index 957f7138d..eb6676d6f 100644 --- a/wp-admin/includes/image.php +++ b/wp-admin/includes/image.php @@ -16,7 +16,7 @@ * This function can handle most image file formats which PHP supports. * If PHP does not have the functionality to save in a file of the same format, the thumbnail will be created as a jpeg. */ -function wp_create_thumbnail( $file, $max_side, $depreciated = '' ) { +function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) { if ( ctype_digit( $file ) ) // Handle int as attachment ID $file = get_attached_file( $file ); diff --git a/wp-admin/includes/schema.php b/wp-admin/includes/schema.php index 922540d2a..bcea77494 100644 --- a/wp-admin/includes/schema.php +++ b/wp-admin/includes/schema.php @@ -254,8 +254,6 @@ function populate_roles() { } function populate_roles_160() { - global $wp_roles; - // Add roles add_role('administrator', _c('Administrator|User role')); add_role('editor', _c('Editor|User role')); diff --git a/wp-admin/includes/taxonomy.php b/wp-admin/includes/taxonomy.php index df8c80ae7..e899f784c 100644 --- a/wp-admin/includes/taxonomy.php +++ b/wp-admin/includes/taxonomy.php @@ -40,8 +40,6 @@ function wp_create_categories($categories, $post_id = '') { } function wp_delete_category($cat_ID) { - global $wpdb; - $cat_ID = (int) $cat_ID; $default = get_option('default_category'); @@ -53,8 +51,6 @@ function wp_delete_category($cat_ID) { } function wp_insert_category($catarr, $wp_error = false) { - global $wpdb; - extract($catarr, EXTR_SKIP); if ( trim( $cat_name ) == '' ) @@ -95,8 +91,6 @@ function wp_insert_category($catarr, $wp_error = false) { } function wp_update_category($catarr) { - global $wpdb; - $cat_ID = (int) $catarr['cat_ID']; if ( $cat_ID == $catarr['category_parent'] ) @@ -119,8 +113,6 @@ function wp_update_category($catarr) { // function get_tags_to_edit( $post_id ) { - global $wpdb; - $post_id = (int) $post_id; if ( !$post_id ) return false; diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 6037a4a58..fae857631 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -124,7 +124,7 @@ function sort_cats( $cat1, $cat2 ) { } function get_nested_categories( $default = 0, $parent = 0 ) { - global $post_ID, $wpdb, $checked_categories; + global $post_ID, $checked_categories; if ( empty($checked_categories) ) { if ( $post_ID ) { @@ -226,7 +226,7 @@ function wp_manage_posts_columns() { } function page_rows( $parent = 0, $level = 0, $pages = 0, $hierarchy = true ) { - global $wpdb, $class, $post; + global $class, $post; if (!$pages ) $pages = get_pages( 'sort_column=menu_order' ); @@ -257,7 +257,8 @@ function page_rows( $parent = 0, $level = 0, $pages = 0, $hierarchy = true ) { comment_ID; $class = ''; @@ -367,7 +368,6 @@ if ( !is_single() ) { } function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) { - global $wpdb; if (!$categories ) $categories = get_categories( 'hide_empty=0' ); @@ -440,7 +440,6 @@ function _list_meta_row( $entry, &$count ) { $r .= "\n\t\t
"; $r .= "\n\t\t"; - $r .= ""; $r .= "\n\t"; return $r; } diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index 8eb3ae848..e5c0dd42e 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -6,7 +6,7 @@ require_once(ABSPATH . 'wp-admin/includes/admin.php'); require_once(ABSPATH . 'wp-admin/includes/schema.php'); if ( !function_exists('wp_install') ) : -function wp_install($blog_title, $user_name, $user_email, $public, $meta='') { +function wp_install($blog_title, $user_name, $user_email, $public, $deprecated='') { global $wp_rewrite; wp_check_mysql_version(); diff --git a/wp-admin/includes/upload.php b/wp-admin/includes/upload.php index 6e183c243..a96e31699 100644 --- a/wp-admin/includes/upload.php +++ b/wp-admin/includes/upload.php @@ -78,7 +78,7 @@ function wp_upload_display( $dims = false, $href = '' ) { } function wp_upload_view() { - global $style, $style; + global $style; $id = get_the_ID(); $attachment_data = wp_get_attachment_metadata( $id ); ?> diff --git a/wp-admin/install-helper.php b/wp-admin/install-helper.php index b53376eb3..d124b1a31 100644 --- a/wp-admin/install-helper.php +++ b/wp-admin/install-helper.php @@ -16,7 +16,7 @@ function maybe_create_table($table_name, $create_ddl) { } } //didn't find it try to create it. - $q = $wpdb->query($create_ddl); + $wpdb->query($create_ddl); // we cannot directly tell that whether this succeeded! foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) { if ($table == $table_name) { @@ -41,7 +41,7 @@ function maybe_add_column($table_name, $column_name, $create_ddl) { } } //didn't find it try to create it. - $q = $wpdb->query($create_ddl); + $wpdb->query($create_ddl); // we cannot directly tell that whether this succeeded! foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { if ($column == $column_name) { @@ -63,7 +63,7 @@ function maybe_drop_column($table_name, $column_name, $drop_ddl) { foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { if ($column == $column_name) { //found it try to drop it. - $q = $wpdb->query($drop_ddl); + $wpdb->query($drop_ddl); // we cannot directly tell that whether this succeeded! foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { if ($column == $column_name) {