Make WordPress Core

Changeset 24123


Ignore:
Timestamp:
04/29/2013 01:10:50 AM (13 years ago)
Author:
SergeyBiryukov
Message:

Remove redundant echo calls from list tables. Don't mix string concatenation with direct output. see #24210.

Location:
trunk/wp-admin/includes
Files:
8 edited

Legend:

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

    r24092 r24123  
    14161416                $level++;
    14171417        }
    1418         echo $wp_list_table->single_row( $tag, $level );
     1418        $wp_list_table->single_row( $tag, $level );
    14191419        wp_die();
    14201420}
  • trunk/wp-admin/includes/class-wp-comments-list-table.php

    r23563 r24123  
    316316
    317317                echo "<tr id='comment-$comment->comment_ID' class='$the_comment_class'>";
    318                 echo $this->single_row_columns( $comment );
     318                $this->single_row_columns( $comment );
    319319                echo "</tr>\n";
    320320        }
  • trunk/wp-admin/includes/class-wp-list-table.php

    r23191 r24123  
    827827
    828828                echo '<tr' . $row_class . '>';
    829                 echo $this->single_row_columns( $item );
     829                $this->single_row_columns( $item );
    830830                echo '</tr>';
    831831        }
  • trunk/wp-admin/includes/class-wp-posts-list-table.php

    r23765 r24123  
    383383                                break;
    384384
    385                         if ( $count >= $start )
    386                                 echo "\t" . $this->single_row( $page, $level );
     385                        if ( $count >= $start ) {
     386                                echo "\t";
     387                                $this->single_row( $page, $level );
     388                        }
    387389
    388390                        $count++;
     
    398400                                        if ( $count >= $end )
    399401                                                break;
    400                                         if ( $count >= $start )
    401                                                 echo "\t" . $this->single_row( $op, 0 );
     402
     403                                        if ( $count >= $start ) {
     404                                                echo "\t";
     405                                                $this->single_row( $op, 0 );
     406                                        }
     407
    402408                                        $count++;
    403409                                }
     
    445451                                $num_parents = count( $my_parents );
    446452                                while ( $my_parent = array_pop( $my_parents ) ) {
    447                                         echo "\t" . $this->single_row( $my_parent, $level - $num_parents );
     453                                        echo "\t";
     454                                        $this->single_row( $my_parent, $level - $num_parents );
    448455                                        $num_parents--;
    449456                                }
    450457                        }
    451458
    452                         if ( $count >= $start )
    453                                 echo "\t" . $this->single_row( $page, $level );
     459                        if ( $count >= $start ) {
     460                                echo "\t";
     461                                $this->single_row( $page, $level );
     462                        }
    454463
    455464                        $count++;
  • trunk/wp-admin/includes/class-wp-terms-list-table.php

    r23563 r24123  
    137137
    138138                // convert it to table rows
    139                 $out = '';
    140139                $count = 0;
    141140
     
    153152
    154153                        // Some funky recursion to get the job done( Paging & parents mainly ) is contained within, Skip it for non-hierarchical taxonomies for performance sake
    155                         $out .= $this->_rows( $taxonomy, $terms, $children, $offset, $number, $count );
     154                        $this->_rows( $taxonomy, $terms, $children, $offset, $number, $count );
    156155                } else {
    157156                        $terms = get_terms( $taxonomy, $args );
    158157                        foreach ( $terms as $term )
    159                                 $out .= $this->single_row( $term, 0, $taxonomy );
     158                                $this->single_row( $term, 0, $taxonomy );
    160159                        $count = $number; // Only displaying a single page.
    161160                }
     
    166165                        $this->no_items();
    167166                        echo '</td></tr>';
    168                 } else {
    169                         echo $out;
    170167                }
    171168        }
     
    175172                $end = $start + $per_page;
    176173
    177                 $output = '';
    178174                foreach ( $terms as $key => $term ) {
    179175
     
    200196                                $num_parents = count( $my_parents );
    201197                                while ( $my_parent = array_pop( $my_parents ) ) {
    202                                         $output .=  "\t" . $this->single_row( $my_parent, $level - $num_parents, $taxonomy );
     198                                        echo "\t";
     199                                        $this->single_row( $my_parent, $level - $num_parents, $taxonomy );
    203200                                        $num_parents--;
    204201                                }
    205202                        }
    206203
    207                         if ( $count >= $start )
    208                                 $output .= "\t" . $this->single_row( $term, $level, $taxonomy );
     204                        if ( $count >= $start ) {
     205                                echo "\t";
     206                                $this->single_row( $term, $level, $taxonomy );
     207                        }
    209208
    210209                        ++$count;
     
    213212
    214213                        if ( isset( $children[$term->term_id] ) && empty( $_REQUEST['s'] ) )
    215                                 $output .= $this->_rows( $taxonomy, $terms, $children, $start, $per_page, $count, $term->term_id, $level + 1 );
    216                 }
    217 
    218                 return $output;
     214                                $this->_rows( $taxonomy, $terms, $children, $start, $per_page, $count, $term->term_id, $level + 1 );
     215                }
    219216        }
    220217
     
    226223
    227224                echo '<tr id="tag-' . $tag->term_id . '"' . $row_class . '>';
    228                 echo $this->single_row_columns( $tag );
     225                $this->single_row_columns( $tag );
    229226                echo '</tr>';
    230227        }
  • trunk/wp-admin/includes/class-wp-upgrader.php

    r23912 r24123  
    11301130                $this->done_header = true;
    11311131                echo '<div class="wrap">';
    1132                 echo screen_icon();
     1132                screen_icon();
    11331133                echo '<h2>' . $this->options['title'] . '</h2>';
    11341134        }
  • trunk/wp-admin/includes/class-wp-users-list-table.php

    r23563 r24123  
    210210
    211211                        $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"';
    212                         echo "\n\t", $this->single_row( $user_object, $style, $role, isset( $post_counts ) ? $post_counts[ $userid ] : 0 );
     212                        echo "\n\t" . $this->single_row( $user_object, $style, $role, isset( $post_counts ) ? $post_counts[ $userid ] : 0 );
    213213                }
    214214        }
  • trunk/wp-admin/includes/theme-install.php

    r23567 r24123  
    154154        _deprecated_function( __FUNCTION__, '3.4' );
    155155        global $wp_list_table;
    156         return $wp_list_table->single_row( $theme );
     156        $wp_list_table->single_row( $theme );
    157157}
    158158
Note: See TracChangeset for help on using the changeset viewer.