Skip to content

Commit

Permalink
Remove unused variables reset by wp_reset_vars(). Many of these haven…
Browse files Browse the repository at this point in the history
…'t been used since b2. see #21767.

git-svn-id: http://core.svn.wordpress.org/trunk@23445 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
nacin committed Feb 16, 2013
1 parent 2a956dd commit 83e0ce2
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 17 deletions.
2 changes: 0 additions & 2 deletions wp-admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@
$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;
Expand Down
1 change: 0 additions & 1 deletion wp-admin/edit-link-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@
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" />
Expand Down
4 changes: 2 additions & 2 deletions wp-admin/includes/bookmark.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';

Expand Down
2 changes: 1 addition & 1 deletion wp-admin/includes/class-wp-links-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function ajax_user_can() {
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 );

Expand Down
5 changes: 1 addition & 4 deletions wp-admin/link-add.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
$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');
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/link.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 2 additions & 3 deletions wp-admin/options-head.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
$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'];
Expand Down
4 changes: 2 additions & 2 deletions wp-admin/user-edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -54,7 +54,7 @@
'<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' );

Expand Down

0 comments on commit 83e0ce2

Please sign in to comment.