From 1ae1811dd0f08b565dba743c3a12928eafe831de Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 4 Jan 2008 19:36:34 +0000 Subject: [PATCH] Unused var cleanup. Props DD32. see #5418 git-svn-id: http://svn.automattic.com/wordpress/trunk@6551 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/custom-header.php | 2 +- wp-admin/import/wordpress.php | 3 +-- wp-admin/import/wp-cat2tag.php | 2 -- wp-admin/includes/file.php | 1 + wp-admin/includes/misc.php | 2 +- wp-admin/includes/template.php | 5 ----- wp-admin/includes/update.php | 2 +- wp-admin/link-import.php | 2 +- wp-app.php | 2 +- wp-includes/category-template.php | 2 +- wp-includes/classes.php | 2 +- wp-includes/comment-template.php | 11 ++++++----- wp-includes/comment.php | 8 +++----- wp-includes/deprecated.php | 15 +++++++++++++-- wp-includes/functions.php | 2 +- wp-includes/link-template.php | 4 ++-- wp-includes/pluggable.php | 7 +++++-- wp-includes/post.php | 2 +- wp-includes/taxonomy.php | 2 +- 19 files changed, 41 insertions(+), 35 deletions(-) diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index 644626005..f4d51e4af 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)); - apply_filters('wp_create_file_in_uploads', $file, $id); // For replication + do_action('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/import/wordpress.php b/wp-admin/import/wordpress.php index 9898bc3df..c3c7f80aa 100644 --- a/wp-admin/import/wordpress.php +++ b/wp-admin/import/wordpress.php @@ -106,7 +106,6 @@ class WP_Import { continue; } if ( false !== strpos($importline, '') ) { - $num++; $doing_entry = false; if ($process_post_func) call_user_func($process_post_func, $this->post); @@ -400,7 +399,7 @@ class WP_Import { $post_author = $this->checkauthor($post_author); //just so that if a post already exists, new users are not created by checkauthor - $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_excerpt', 'post_status', 'post_name', 'comment_status', 'ping_status', 'post_modified', 'post_modified_gmt', 'guid', 'post_parent', 'menu_order', 'post_type'); + $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_status', 'post_name', 'comment_status', 'ping_status', 'guid', 'post_parent', 'menu_order', 'post_type'); if ($post_type == 'attachment') { $remote_url = $this->get_tag( $post, 'wp:attachment_url' ); if ( !$remote_url ) diff --git a/wp-admin/import/wp-cat2tag.php b/wp-admin/import/wp-cat2tag.php index f4fa52262..5e7ac5e27 100644 --- a/wp-admin/import/wp-cat2tag.php +++ b/wp-admin/import/wp-cat2tag.php @@ -114,8 +114,6 @@ function check_all_rows() { } function _category_exists($cat_id) { - global $wpdb; - $cat_id = (int) $cat_id; $maybe_exists = category_exists($cat_id); diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index dbbd5ce79..ed77bcefe 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -112,6 +112,7 @@ function wp_handle_upload( &$file, $overrides = false ) { // If you override this, you must provide $ext and $type!!!! $test_type = true; + $mimes = false; // Install user overrides. Did we mention that this voids your warranty? if ( is_array( $overrides ) ) diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php index 24a4c063c..4ba73bef2 100644 --- a/wp-admin/includes/misc.php +++ b/wp-admin/includes/misc.php @@ -130,7 +130,7 @@ function update_recently_edited( $file ) { // If siteurl or home changed, flush rewrite rules. function update_home_siteurl( $old_value, $value ) { - global $wp_rewrite, $user_login, $user_pass_md5; + global $wp_rewrite; if ( defined( "WP_INSTALLING" ) ) return; diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index d9a294dc0..609c737c3 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -102,11 +102,6 @@ function checked( $checked, $current) { echo ' checked="checked"'; } -// TODO: Remove? -function documentation_link( $for ) { - return; -} - function selected( $selected, $current) { if ( $selected == $current) echo ' selected="selected"'; diff --git a/wp-admin/includes/update.php b/wp-admin/includes/update.php index 41945d2b3..ebd099585 100644 --- a/wp-admin/includes/update.php +++ b/wp-admin/includes/update.php @@ -2,7 +2,7 @@ // The admin side of our 1.0 update system -function core_update_footer( $msg ) { +function core_update_footer( $msg = '' ) { if ( !current_user_can('manage_options') ) return sprintf( '| '.__( 'Version %s' ), $GLOBALS['wp_version'] ); diff --git a/wp-admin/link-import.php b/wp-admin/link-import.php index 927531731..d9bd5f686 100644 --- a/wp-admin/link-import.php +++ b/wp-admin/link-import.php @@ -123,7 +123,7 @@ else } // end else if ( ! $blogrolling ) - apply_filters( 'wp_delete_file', $opml_url); + do_action( 'wp_delete_file', $opml_url); @unlink($opml_url); ?> diff --git a/wp-app.php b/wp-app.php index 7345b0e47..5afa21cb4 100644 --- a/wp-app.php +++ b/wp-app.php @@ -425,7 +425,7 @@ EOD; $url = $file['url']; $file = $file['file']; - apply_filters('wp_create_file_in_uploads', $file); // replicate + do_action('wp_create_file_in_uploads', $file); // replicate // Construct the attachment array $attachment = array( diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index e592d432d..f76482ce0 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -66,7 +66,7 @@ function get_category_parents($id, $link = FALSE, $separator = '/', $nicename = } function get_the_category($id = false) { - global $post, $term_cache; + global $post; $id = (int) $id; if ( !$id ) diff --git a/wp-includes/classes.php b/wp-includes/classes.php index 564f94958..46593385a 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -740,7 +740,7 @@ class WP_Ajax_Response { $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); - $postition = preg_replace( '/[^a-z0-9:_-]/i', '', $position ); + $position = preg_replace( '/[^a-z0-9:_-]/i', '', $position ); if ( is_wp_error($id) ) { $data = $id; diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 2d0c93322..4edd47634 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -340,10 +340,10 @@ function get_comments_link() { * * @since 0.71 * - * @param string $file Not Used - * @param bool $echo Not Used + * @param string $deprecated Not Used + * @param bool $deprecated Not Used */ -function comments_link( $file = '', $echo = true ) { +function comments_link( $deprecated = '', $deprecated = '' ) { echo get_comments_link(); } @@ -357,6 +357,7 @@ function comments_link( $file = '', $echo = true ) { * @return int The number of comments a post has */ function get_comments_number( $post_id = 0 ) { + global $id; $post_id = (int) $post_id; if ( !$post_id ) @@ -536,9 +537,9 @@ function trackback_url($deprecated = true) { * * @since 0.71 * - * @param int $timezone Not used + * @param int $deprecated Not used (Was $timezone = 0) */ -function trackback_rdf($timezone = 0) { +function trackback_rdf($deprecated = '') { if (stripos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') === false) { echo 'prepare("SELECT * FROM $wpdb->comments WHERE comment_ID = %d", $comment_ID); if ( false == $include_unapproved ) @@ -130,7 +130,6 @@ function get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = fals function get_lastcommentmodified($timezone = 'server') { global $cache_lastcommentmodified, $wpdb; - $add_seconds_blog = get_option('gmt_offset') * 3600; $add_seconds_server = date('Z'); $now = current_time('mysql', 1); if ( !isset($cache_lastcommentmodified[$timezone]) ) { @@ -177,7 +176,7 @@ function get_comment_count( $post_id = 0 ) { "total_comments" => 0 ); - foreach ( $totals as $i => $row ) { + foreach ( $totals as $row ) { switch ( $row['comment_approved'] ) { case 'spam': $comment_count['spam'] = $row['total']; @@ -519,7 +518,7 @@ function wp_update_comment($commentarr) { $comment_date_gmt = get_gmt_from_date($comment_date); - $result = $wpdb->query( + $wpdb->query( "UPDATE $wpdb->comments SET comment_content = '$comment_content', comment_author = '$comment_author', @@ -609,7 +608,6 @@ function discover_pingback_server_uri($url, $timeout_bytes = 2048) { $pingback_str_dquote = 'rel="pingback"'; $pingback_str_squote = 'rel=\'pingback\''; $x_pingback_str = 'x-pingback: '; - $pingback_href_original_pos = 27; extract(parse_url($url), EXTR_SKIP); diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index ce7add997..45bdc5232 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -911,7 +911,7 @@ function permalink_link() { * * @param string $file */ -function permalink_single_rss($file = '') { +function permalink_single_rss($deprecated = '') { _deprecated_function(__FUNCTION__, '0.0', 'the_permalink_rss()'); the_permalink_rss(); } @@ -1206,7 +1206,7 @@ function comments_rss_link($link_text = 'Comments RSS', $deprecated = '') { function get_category_rss_link($echo = false, $cat_ID = 1, $deprecated = '') { _deprecated_function(__FUNCTION__, '0.0', 'get_category_feed_link()'); - $link = get_category_feed_link($cat_ID, $feed = 'rss2'); + $link = get_category_feed_link($cat_ID, 'rss2'); if ( $echo ) echo $link; @@ -1263,4 +1263,15 @@ function create_user($username, $password, $email) { return wp_create_user($username, $password, $email); } +/** + * documentation_link() - Unused Admin function + * @since 2.0 + * @param string $deprecated Unknown + * @deprecated 2.4 + */ +function documentation_link( $deprecated = '' ) { + _deprecated_function( __FUNCTION__, '2.4', '' ); + return; +} + ?> \ No newline at end of file diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 462ca1a70..81f07d53b 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -115,7 +115,7 @@ function get_weekstartend( $mysqlstring, $start_of_week = '' ) { $day = mktime( 0, 0, 0, $md, $mm, $my ); $weekday = date( 'w', $day ); $i = 86400; - if( !is_numeric($a) ) + if( !is_numeric($start_of_week) ) $start_of_week = get_option( 'start_of_week' ); if ( $weekday < $start_of_week ) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 0c79de654..775da644e 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -32,7 +32,7 @@ function permalink_anchor($mode = 'id') { global $post; switch ( strtolower($mode) ) { case 'title': - $title = sanitize_title($post->post_title) . '-' . $id; + $title = sanitize_title($post->post_title) . '-' . $post->ID; echo ''; break; case 'id': @@ -316,7 +316,7 @@ function get_author_feed_link( $author_id, $feed = '' ) { if ( '' == $permalink_structure ) { $link = get_option('home') . '?feed=rss2&author=' . $author_id; } else { - $link = get_author_posts_url($author_id, $author_nicename); + $link = get_author_posts_url($author_id); $link = trailingslashit($link) . user_trailingslashit('feed', 'feed'); } diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index e657df685..ae505c885 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -291,8 +291,8 @@ function wp_mail( $to, $subject, $message, $headers = '' ) { endif; if ( !function_exists('wp_login') ) : -function wp_login($username, $password, $deprecated = false) { - global $wpdb, $error; +function wp_login($username, $password, $deprecated = '') { + global $error; $username = sanitize_user($username); @@ -802,6 +802,7 @@ endif; // Deprecated. Use wp_set_auth_cookie() if ( !function_exists('wp_setcookie') ) : function wp_setcookie($username, $password = '', $already_md5 = false, $home = '', $siteurl = '', $remember = false) { + _deprecated_function( __FUNCTION__, '2.4', 'wp_set_auth_cookie()' ); $user = get_userdatabylogin($username); wp_set_auth_cookie($user->ID, $remember); } @@ -810,6 +811,7 @@ endif; // Deprecated. Use wp_clear_auth_cookie() if ( !function_exists('wp_clearcookie') ) : function wp_clearcookie() { + _deprecated_function( __FUNCTION__, '2.4', 'wp_clear_auth_cookie()' ); wp_clear_auth_cookie(); } endif; @@ -817,6 +819,7 @@ endif; // Deprecated. No alternative. if ( !function_exists('wp_get_cookie_login') ): function wp_get_cookie_login() { + _deprecated_function( __FUNCTION__, '2.4', '' ); return false; } endif; diff --git a/wp-includes/post.php b/wp-includes/post.php index 4c0f80b95..c5d6afc1c 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -2563,7 +2563,7 @@ function _transition_post_status($new_status, $old_status, $post) { * @param int $post_id Not Used. Can be set to null. * @param object $post Object type containing the post information */ -function _future_post_hook($post_id, $post) { +function _future_post_hook($deprecated = '', $post) { wp_clear_scheduled_hook( 'publish_future_post', $post->ID ); wp_schedule_single_event(strtotime($post->post_date_gmt. ' GMT'), 'publish_future_post', array($post->ID)); } diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 416c7a9f0..a813dbf0f 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -806,7 +806,7 @@ function sanitize_term_field($field, $value, $term_id, $taxonomy, $context) { } else if ( 'rss' == $context ) { $value = apply_filters("term_${field}_rss", $value, $taxonomy); - $value = apply_filters("${taxonomy}_$field_rss", $value); + $value = apply_filters("${taxonomy}_${field}_rss", $value); } else { // Use display filters by default. $value = apply_filters("term_$field", $value, $term_id, $taxonomy, $context);