Variable Cleanup, Unused variables, Typo'd variables, unused code blocks. Fixes #12299

git-svn-id: https://develop.svn.wordpress.org/trunk@13242 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse
2010-02-20 02:01:46 +00:00
parent 8be48fe96a
commit 468d0d7cff
21 changed files with 19 additions and 44 deletions

View File

@@ -1835,7 +1835,7 @@ function media_upload_library_form($errors) {
$start = ( $_GET['paged'] - 1 ) * 10;
if ( $start < 1 )
$start = 0;
add_filter( 'post_limits', $limit_filter = create_function( '$a', "return 'LIMIT $start, 10';" ) );
add_filter( 'post_limits', create_function( '$a', "return 'LIMIT $start, 10';" ) );
list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query();

View File

@@ -125,7 +125,6 @@ function wpmu_delete_user($id) {
global $wpdb;
$id = (int) $id;
$user = get_userdata($id);
do_action('wpmu_delete_user', $id);
@@ -767,4 +766,4 @@ function show_post_thumbnail_warning() {
}
add_action( 'admin_notices', 'show_post_thumbnail_warning' );
?>
?>

View File

@@ -960,7 +960,7 @@ function wp_edit_attachments_query( $q = false ) {
function postbox_classes( $id, $page ) {
if ( isset( $_GET['edit'] ) && $_GET['edit'] == $id )
return '';
$current_user = wp_get_current_user();
if ( $closed = get_user_option('closedpostboxes_'.$page ) ) {
if ( !is_array( $closed ) ) {
return '';

View File

@@ -623,7 +623,7 @@ function populate_roles_300() {
* @param int $network_id id of network to populate
*/
function populate_network( $network_id = 1, $domain = '', $email = '', $site_name = '', $path = '/', $vhost = 'no' ) {
global $wpdb, $current_site, $wp_version, $wp_db_version, $wp_rewrite;
global $wpdb, $current_site, $wp_db_version, $wp_rewrite;
$msg = '';
//@todo: turn these checks into returned messages

View File

@@ -2111,7 +2111,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true,
if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) {
$actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . esc_attr__( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
} elseif ( 'spam' == $the_comment_status ) {
$actions['unspam'] = "<a href='$untrash_url' class='delete:the-comment-list:comment-$comment->comment_ID:66cc66:unspam=1 vim-z vim-destructive'>" . __( 'Not Spam' ) . '</a>';
$actions['unspam'] = "<a href='$unspam_url' class='delete:the-comment-list:comment-$comment->comment_ID:66cc66:unspam=1 vim-z vim-destructive'>" . __( 'Not Spam' ) . '</a>';
} elseif ( 'trash' == $the_comment_status ) {
$actions['untrash'] = "<a href='$untrash_url' class='delete:the-comment-list:comment-$comment->comment_ID:66cc66:untrash=1 vim-z vim-destructive'>" . __( 'Restore' ) . '</a>';
}
@@ -2678,13 +2678,12 @@ function the_attachment_links( $id = false ) {
* @param string $default slug for the role that should be already selected
*/
function wp_dropdown_roles( $selected = false ) {
global $wp_roles;
$p = '';
$r = '';
$editable_roles = get_editable_roles();
foreach( $editable_roles as $role => $details ) {
foreach ( $editable_roles as $role => $details ) {
$name = translate_user_role($details['name'] );
if ( $selected == $role ) // Make default first in list
$p = "\n\t<option selected='selected' value='" . esc_attr($role) . "'>$name</option>";
@@ -3288,7 +3287,7 @@ function find_posts_div($found_action = '') {
<?php wp_nonce_field( 'find-posts', '_ajax_nonce', false ); ?>
<label class="screen-reader-text" for="find-posts-input"><?php _e( 'Search' ); ?></label>
<input type="text" id="find-posts-input" name="ps" value="" />
<input type="button" onclick="findPosts.send();" value="<?php esc_attr_e( 'Search' ); ?>" class="button" /><br />
<input type="button" onClick="findPosts.send();" value="<?php esc_attr_e( 'Search' ); ?>" class="button" /><br />
<input type="radio" name="find-posts-what" id="find-posts-posts" checked="checked" value="posts" />
<label for="find-posts-posts"><?php _e( 'Posts' ); ?></label>
@@ -3298,7 +3297,7 @@ function find_posts_div($found_action = '') {
<div id="find-posts-response"></div>
</div>
<div class="find-box-buttons">
<input type="button" class="button alignleft" onclick="findPosts.close();" value="<?php esc_attr_e('Close'); ?>" />
<input type="button" class="button alignleft" onClick="findPosts.close();" value="<?php esc_attr_e('Close'); ?>" />
<input id="find-posts-submit" type="submit" class="button-primary alignright" value="<?php esc_attr_e('Select'); ?>" />
</div>
</div>
@@ -3544,7 +3543,7 @@ function convert_to_screen( $screen ) {
}
function screen_meta($screen) {
global $wp_meta_boxes, $_wp_contextual_help, $post_type;
global $wp_meta_boxes, $_wp_contextual_help, $title;
if ( is_string($screen) )
$screen = convert_to_screen($screen);
@@ -3607,8 +3606,6 @@ function screen_meta($screen) {
<?php
endif;
global $title;
$_wp_contextual_help = apply_filters('contextual_help_list', $_wp_contextual_help, $screen);
?>
<div id="contextual-help-wrap" class="hidden">

View File

@@ -366,8 +366,6 @@ function display_theme($theme, $actions = null, $show_details = true) {
* @param int $totalpages Number of pages.
*/
function display_themes($themes, $page = 1, $totalpages = 1) {
global $themes_allowedtags;
$type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : '';
$term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : '';
?>

View File

@@ -87,9 +87,6 @@ function delete_theme($template) {
return new WP_Error('fs_no_themes_dir', __('Unable to locate WordPress theme directory.'));
$themes_dir = trailingslashit( $themes_dir );
$errors = array();
$theme_dir = trailingslashit($themes_dir . $template);
$deleted = $wp_filesystem->delete($theme_dir, true);

View File

@@ -423,7 +423,6 @@ function wp_delete_user( $id, $reassign = 'novalue' ) {
global $wpdb;
$id = (int) $id;
$user = new WP_User($id);
// allow for transaction statement
do_action('delete_user', $id);

View File

@@ -51,15 +51,6 @@ if ( $post_id ) {
* @param int $post_id Optional. Post ID.
*/
function redirect_post($post_id = '') {
global $action;
$referredby = '';
if ( !empty($_POST['referredby']) ) {
$referredby = preg_replace('|https?://[^/]+|i', '', $_POST['referredby']);
$referredby = remove_query_arg('_wp_original_http_referer', $referredby);
}
$referer = preg_replace('|https?://[^/]+|i', '', wp_get_referer());
if ( !empty($_POST['mode']) && 'sidebar' == $_POST['mode'] ) {
if ( isset($_POST['saveasdraft']) )
$location = 'sidebar.php?a=c';