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
This commit is contained in:
Andrew Nacin 2013-02-16 18:28:41 +00:00
parent 2a956dd5b7
commit 83e0ce2ac1
9 changed files with 10 additions and 17 deletions

View File

@ -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;

View File

@ -126,7 +126,6 @@ do_meta_boxes(null, 'advanced', $link);
if ( $link_id ) : ?>
<input type="hidden" name="action" value="save" />
<input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" />
<input type="hidden" name="order_by" value="<?php echo esc_attr($order_by); ?>" />
<input type="hidden" name="cat_id" value="<?php echo (int) $cat_id ?>" />
<?php else: ?>
<input type="hidden" name="action" value="add" />

View File

@ -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 = '';

View File

@ -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 );

View File

@ -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');

View File

@ -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();

View File

@ -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

View File

@ -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'];

View File

@ -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(
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
$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' );