WordPress.org

Make WordPress Core

Changeset 13242


Ignore:
Timestamp:
02/20/2010 02:01:46 AM (8 years ago)
Author:
dd32
Message:

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

Location:
trunk
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/media.php

    r13132 r13242  
    18361836    if ( $start < 1 )
    18371837        $start = 0;
    1838     add_filter( 'post_limits', $limit_filter = create_function( '$a', "return 'LIMIT $start, 10';" ) );
     1838    add_filter( 'post_limits', create_function( '$a', "return 'LIMIT $start, 10';" ) );
    18391839
    18401840    list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query();
  • trunk/wp-admin/includes/ms.php

    r13241 r13242  
    126126
    127127    $id = (int) $id;
    128     $user = get_userdata($id);
    129128
    130129    do_action('wpmu_delete_user', $id);
  • trunk/wp-admin/includes/post.php

    r13051 r13242  
    961961    if ( isset( $_GET['edit'] ) && $_GET['edit'] == $id )
    962962        return '';
    963     $current_user = wp_get_current_user();
     963
    964964    if ( $closed = get_user_option('closedpostboxes_'.$page ) ) {
    965965        if ( !is_array( $closed ) ) {
  • trunk/wp-admin/includes/schema.php

    r13234 r13242  
    624624 */
    625625function populate_network( $network_id = 1, $domain = '', $email = '', $site_name = '', $path = '/', $vhost = 'no' ) {
    626     global $wpdb, $current_site, $wp_version, $wp_db_version, $wp_rewrite;
     626    global $wpdb, $current_site, $wp_db_version, $wp_rewrite;
    627627
    628628    $msg = '';
  • trunk/wp-admin/includes/template.php

    r13213 r13242  
    21122112                        $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>';
    21132113                    } elseif ( 'spam' == $the_comment_status ) {
    2114                         $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>';
     2114                        $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>';
    21152115                    } elseif ( 'trash' == $the_comment_status ) {
    21162116                        $actions['untrash'] = "<a href='$untrash_url' class='delete:the-comment-list:comment-$comment->comment_ID:66cc66:untrash=1 vim-z vim-destructive'>" . __( 'Restore' ) . '</a>';
     
    26792679 */
    26802680function wp_dropdown_roles( $selected = false ) {
    2681     global $wp_roles;
    26822681    $p = '';
    26832682    $r = '';
     
    26852684    $editable_roles = get_editable_roles();
    26862685
    2687     foreach( $editable_roles as $role => $details ) {
     2686    foreach ( $editable_roles as $role => $details ) {
    26882687        $name = translate_user_role($details['name'] );
    26892688        if ( $selected == $role ) // Make default first in list
     
    32893288                <label class="screen-reader-text" for="find-posts-input"><?php _e( 'Search' ); ?></label>
    32903289                <input type="text" id="find-posts-input" name="ps" value="" />
    3291                 <input type="button" onclick="findPosts.send();" value="<?php esc_attr_e( 'Search' ); ?>" class="button" /><br />
     3290                <input type="button" onClick="findPosts.send();" value="<?php esc_attr_e( 'Search' ); ?>" class="button" /><br />
    32923291
    32933292                <input type="radio" name="find-posts-what" id="find-posts-posts" checked="checked" value="posts" />
     
    32993298        </div>
    33003299        <div class="find-box-buttons">
    3301             <input type="button" class="button alignleft" onclick="findPosts.close();" value="<?php esc_attr_e('Close'); ?>" />
     3300            <input type="button" class="button alignleft" onClick="findPosts.close();" value="<?php esc_attr_e('Close'); ?>" />
    33023301            <input id="find-posts-submit" type="submit" class="button-primary alignright" value="<?php esc_attr_e('Select'); ?>" />
    33033302        </div>
     
    35453544
    35463545function screen_meta($screen) {
    3547     global $wp_meta_boxes, $_wp_contextual_help, $post_type;
     3546    global $wp_meta_boxes, $_wp_contextual_help, $title;
    35483547
    35493548    if ( is_string($screen) )
     
    36073606<?php
    36083607    endif;
    3609 
    3610     global $title;
    36113608
    36123609    $_wp_contextual_help = apply_filters('contextual_help_list', $_wp_contextual_help, $screen);
  • trunk/wp-admin/includes/theme-install.php

    r12673 r13242  
    367367 */
    368368function display_themes($themes, $page = 1, $totalpages = 1) {
    369     global $themes_allowedtags;
    370 
    371369    $type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : '';
    372370    $term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : '';
  • trunk/wp-admin/includes/theme.php

    r13106 r13242  
    8888
    8989    $themes_dir = trailingslashit( $themes_dir );
    90 
    91     $errors = array();
    92 
    9390    $theme_dir = trailingslashit($themes_dir . $template);
    9491    $deleted = $wp_filesystem->delete($theme_dir, true);
  • trunk/wp-admin/includes/user.php

    r13106 r13242  
    424424
    425425    $id = (int) $id;
    426     $user = new WP_User($id);
    427426
    428427    // allow for transaction statement
  • trunk/wp-admin/post.php

    r13101 r13242  
    5252 */
    5353function redirect_post($post_id = '') {
    54     global $action;
    55 
    56     $referredby = '';
    57     if ( !empty($_POST['referredby']) ) {
    58         $referredby = preg_replace('|https?://[^/]+|i', '', $_POST['referredby']);
    59         $referredby = remove_query_arg('_wp_original_http_referer', $referredby);
    60     }
    61     $referer = preg_replace('|https?://[^/]+|i', '', wp_get_referer());
    62 
    6354    if ( !empty($_POST['mode']) && 'sidebar' == $_POST['mode'] ) {
    6455        if ( isset($_POST['saveasdraft']) )
  • trunk/wp-includes/comment-template.php

    r13180 r13242  
    972972 */
    973973function comments_popup_link( $zero = false, $one = false, $more = false, $css_class = '', $none = false ) {
    974     global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post;
     974    global $id, $wpcommentspopupfile, $wpcommentsjavascript;
    975975
    976976    if ( false === $zero ) $zero = __( 'No Comments' );
  • trunk/wp-includes/comment.php

    r13150 r13242  
    829829    $approved = array('0' => 'moderated', '1' => 'approved', 'spam' => 'spam', 'trash' => 'trash', 'post-trashed' => 'post-trashed');
    830830    $known_types = array_keys( $approved );
    831     foreach( (array) $count as $row_num => $row ) {
     831    foreach ( (array) $count as $row ) {
    832832        // Don't count post-trashed toward totals
    833833        if ( 'post-trashed' != $row['comment_approved'] && 'trash' != $row['comment_approved'] )
  • trunk/wp-includes/functions.php

    r13240 r13242  
    2424 */
    2525function mysql2date( $dateformatstring, $mysqlstring, $translate = true ) {
    26     global $wp_locale;
    2726    $m = $mysqlstring;
    2827    if ( empty( $m ) )
  • trunk/wp-includes/general-template.php

    r13219 r13242  
    13531353 */
    13541354function get_the_date( $d = '' ) {
    1355     global $post, $day;
     1355    global $post;
    13561356    $the_date = '';
    13571357
  • trunk/wp-includes/link-template.php

    r13240 r13242  
    16781678*/
    16791679function paginate_comments_links($args = array()) {
    1680     global $wp_query, $wp_rewrite;
     1680    global $wp_rewrite;
    16811681
    16821682    if ( !is_singular() || !get_option('page_comments') )
  • trunk/wp-includes/ms-blogs.php

    r13159 r13242  
    231231        $update_details[$field] = $details[$field];
    232232
    233     $result = $wpdb->update( $wpdb->blogs, $update_details, array('blog_id' => $blog_id) );
     233    $wpdb->update( $wpdb->blogs, $update_details, array('blog_id' => $blog_id) );
    234234
    235235    // If spam status changed, issue actions.
  • trunk/wp-includes/ms-functions.php

    r13240 r13242  
    688688
    689689function wpmu_signup_user_notification($user, $user_email, $key, $meta = '') {
    690     global $current_site;
    691 
    692690    if ( !apply_filters('wpmu_signup_user_notification', $user, $user_email, $key, $meta) )
    693691        return false;
     
    781779    if ( is_wp_error($user_id) )
    782780        return false;
    783 
    784     $user = new WP_User($user_id);
    785781
    786782    // Newly created users have no roles or caps until they are added to a blog.
  • trunk/wp-includes/pluggable.php

    r13231 r13242  
    970970    $post    = get_post($comment->comment_post_ID);
    971971    $user    = get_userdata( $post->post_author );
    972     $current_user = wp_get_current_user();
    973972
    974973    if ( $comment->user_id == $post->post_author ) return false; // The author moderated a comment on his own post
  • trunk/wp-includes/post-template.php

    r13110 r13242  
    180180 */
    181181function get_the_content($more_link_text = null, $stripteaser = 0) {
    182     global $id, $post, $more, $page, $pages, $multipage, $preview, $pagenow;
     182    global $id, $post, $more, $page, $pages, $multipage, $preview;
    183183
    184184    if ( null === $more_link_text )
     
    368368 */
    369369function get_body_class( $class = '' ) {
    370     global $wp_query, $wpdb, $current_user;
     370    global $wp_query, $wpdb;
    371371
    372372    $classes = array();
  • trunk/wp-includes/post.php

    r13240 r13242  
    14301430        $stats[$state] = 0;
    14311431
    1432     foreach ( (array) $count as $row_num => $row )
     1432    foreach ( (array) $count as $row )
    14331433        $stats[$row['post_status']] = $row['num_posts'];
    14341434
  • trunk/wp-includes/wp-db.php

    r13229 r13242  
    870870            $this->bail("
    871871<h1>Error establishing a database connection</h1>
    872 <p>This either means that the username and password information in your <code>wp-config.php</code> file is incorrect or we can't contact the database server at <code>$dbhost</code>. This could mean your host's database server is down.</p>
     872<p>This either means that the username and password information in your <code>wp-config.php</code> file is incorrect or we can't contact the database server at <code>{$details['db_host']}</code>. This could mean your host's database server is down.</p>
    873873<ul>
    874874    <li>Are you sure you have the correct username and password?</li>
  • trunk/wp-login.php

    r12983 r13242  
    243243
    244244    wp_set_password($new_pass, $user->ID);
    245     update_user_option($user_ID, 'default_password_nag', true, true); //Set up the Password change nag.
     245    update_user_option($user->ID, 'default_password_nag', true, true); //Set up the Password change nag.
    246246    $message  = sprintf(__('Username: %s'), $user->user_login) . "\r\n";
    247247    $message .= sprintf(__('Password: %s'), $new_pass) . "\r\n";
Note: See TracChangeset for help on using the changeset viewer.