From 83e0ce2ac153803080085cc37876eb0ce461bed2 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sat, 16 Feb 2013 18:28:41 +0000 Subject: [PATCH] Remove unused variables reset by wp_reset_vars(). Many of these haven't been used since b2. see #21767. git-svn-id: http://core.svn.wordpress.org/trunk@23445 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin.php | 2 -- wp-admin/edit-link-form.php | 1 - wp-admin/includes/bookmark.php | 4 ++-- wp-admin/includes/class-wp-links-list-table.php | 2 +- wp-admin/link-add.php | 5 +---- wp-admin/link.php | 2 +- wp-admin/options-head.php | 5 ++--- wp-admin/post.php | 2 +- wp-admin/user-edit.php | 4 ++-- 9 files changed, 10 insertions(+), 17 deletions(-) diff --git a/wp-admin/admin.php b/wp-admin/admin.php index 8df02e5b5c..4e739c3c8d 100644 --- a/wp-admin/admin.php +++ b/wp-admin/admin.php @@ -77,8 +77,6 @@ set_screen_options(); $date_format = get_option('date_format'); $time_format = get_option('time_format'); -wp_reset_vars(array('profile', 'redirect', 'redirect_url', 'a', 'text', 'trackback', 'pingback')); - wp_enqueue_script( 'common' ); $editing = false; diff --git a/wp-admin/edit-link-form.php b/wp-admin/edit-link-form.php index 6d81ec0144..0aca6e7bc1 100644 --- a/wp-admin/edit-link-form.php +++ b/wp-admin/edit-link-form.php @@ -126,7 +126,6 @@ do_meta_boxes(null, 'advanced', $link); if ( $link_id ) : ?> - diff --git a/wp-admin/includes/bookmark.php b/wp-admin/includes/bookmark.php index 23809099d0..14cb20dac2 100644 --- a/wp-admin/includes/bookmark.php +++ b/wp-admin/includes/bookmark.php @@ -55,12 +55,12 @@ function edit_link( $link_id = 0 ) { function get_default_link_to_edit() { $link = new stdClass; if ( isset( $_GET['linkurl'] ) ) - $link->link_url = esc_url( $_GET['linkurl'] ); + $link->link_url = esc_url( wp_unslash( $_GET['linkurl'] ) ); else $link->link_url = ''; if ( isset( $_GET['name'] ) ) - $link->link_name = esc_attr( $_GET['name'] ); + $link->link_name = esc_attr( wp_unslash( $_GET['name'] ) ); else $link->link_name = ''; diff --git a/wp-admin/includes/class-wp-links-list-table.php b/wp-admin/includes/class-wp-links-list-table.php index b5cbc55609..e1c5f18b1b 100644 --- a/wp-admin/includes/class-wp-links-list-table.php +++ b/wp-admin/includes/class-wp-links-list-table.php @@ -23,7 +23,7 @@ class WP_Links_List_Table extends WP_List_Table { function prepare_items() { global $cat_id, $s, $orderby, $order; - wp_reset_vars( array( 'action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'orderby', 'order', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]', 's' ) ); + wp_reset_vars( array( 'action', 'cat_id', 'link_id', 'orderby', 'order', 's' ) ); $args = array( 'hide_invisible' => 0, 'hide_empty' => 0 ); diff --git a/wp-admin/link-add.php b/wp-admin/link-add.php index 2abd79952f..6f9c5678e8 100644 --- a/wp-admin/link-add.php +++ b/wp-admin/link-add.php @@ -15,10 +15,7 @@ if ( ! current_user_can('manage_links') ) $title = __('Add New Link'); $parent_file = 'link-manager.php'; -wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image', - 'description', 'visible', 'target', 'category', 'link_id', - 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', - 'notes', 'linkcheck[]')); +wp_reset_vars( array('action', 'cat_id', 'link_id' ) ); wp_enqueue_script('link'); wp_enqueue_script('xfn'); diff --git a/wp-admin/link.php b/wp-admin/link.php index d12d229ed8..e696d45441 100644 --- a/wp-admin/link.php +++ b/wp-admin/link.php @@ -12,7 +12,7 @@ /** Load WordPress Administration Bootstrap */ require_once ('admin.php'); -wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]')); +wp_reset_vars( array( 'action', 'cat_id', 'link_id' ) ); if ( ! current_user_can('manage_links') ) wp_link_manager_disabled_message(); diff --git a/wp-admin/options-head.php b/wp-admin/options-head.php index 066caafbbe..1c706c87d7 100644 --- a/wp-admin/options-head.php +++ b/wp-admin/options-head.php @@ -2,14 +2,13 @@ /** * WordPress Options Header. * - * Resets variables: 'action', 'standalone', and 'option_group_id'. Displays - * updated message, if updated variable is part of the URL query. + * Displays updated message, if updated variable is part of the URL query. * * @package WordPress * @subpackage Administration */ -wp_reset_vars(array('action', 'standalone', 'option_group_id')); +wp_reset_vars( array( 'action' ) ); if ( isset( $_GET['updated'] ) && isset( $_GET['page'] ) ) { // For backwards compat with plugins that don't use the Settings API and just set updated=1 in the redirect diff --git a/wp-admin/post.php b/wp-admin/post.php index c638c18d39..95f1cc6f26 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -14,7 +14,7 @@ require_once('./admin.php'); $parent_file = 'edit.php'; $submenu_file = 'edit.php'; -wp_reset_vars(array('action', 'safe_mode', 'withcomments', 'posts', 'content', 'edited_post_title', 'comment_error', 'profile', 'trackback_url', 'excerpt', 'showcomments', 'commentstart', 'commentend', 'commentorder')); +wp_reset_vars( array( 'action' ) ); if ( isset( $_GET['post'] ) ) $post_id = $post_ID = (int) $_GET['post']; diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php index e8b977deda..9b15c81411 100644 --- a/wp-admin/user-edit.php +++ b/wp-admin/user-edit.php @@ -9,7 +9,7 @@ /** WordPress Administration Bootstrap */ require_once('./admin.php'); -wp_reset_vars(array('action', 'redirect', 'profile', 'user_id', 'wp_http_referer')); +wp_reset_vars( array( 'action', 'user_id', 'wp_http_referer' ) ); $user_id = (int) $user_id; $current_user = wp_get_current_user(); @@ -54,7 +54,7 @@ get_current_screen()->set_help_sidebar( '

' . __('Support Forums') . '

' ); -$wp_http_referer = remove_query_arg(array('update', 'delete_count'), wp_unslash( $wp_http_referer ) ); +$wp_http_referer = remove_query_arg(array('update', 'delete_count'), $wp_http_referer ); $user_can_edit = current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' );