Remove redundant echo calls from list tables. Don't mix string concatenation with direct output. see #24210.
git-svn-id: http://core.svn.wordpress.org/trunk@24123 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
93b0b5c32c
commit
dace3f0b6d
|
@ -1415,7 +1415,7 @@ function wp_ajax_inline_save_tax() {
|
|||
$parent = $parent_tag->parent;
|
||||
$level++;
|
||||
}
|
||||
echo $wp_list_table->single_row( $tag, $level );
|
||||
$wp_list_table->single_row( $tag, $level );
|
||||
wp_die();
|
||||
}
|
||||
|
||||
|
|
|
@ -315,7 +315,7 @@ class WP_Comments_List_Table extends WP_List_Table {
|
|||
$this->user_can = current_user_can( 'edit_comment', $comment->comment_ID );
|
||||
|
||||
echo "<tr id='comment-$comment->comment_ID' class='$the_comment_class'>";
|
||||
echo $this->single_row_columns( $comment );
|
||||
$this->single_row_columns( $comment );
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
|
|
|
@ -826,7 +826,7 @@ class WP_List_Table {
|
|||
$row_class = ( $row_class == '' ? ' class="alternate"' : '' );
|
||||
|
||||
echo '<tr' . $row_class . '>';
|
||||
echo $this->single_row_columns( $item );
|
||||
$this->single_row_columns( $item );
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
|
|
|
@ -382,8 +382,10 @@ class WP_Posts_List_Table extends WP_List_Table {
|
|||
if ( $count >= $end )
|
||||
break;
|
||||
|
||||
if ( $count >= $start )
|
||||
echo "\t" . $this->single_row( $page, $level );
|
||||
if ( $count >= $start ) {
|
||||
echo "\t";
|
||||
$this->single_row( $page, $level );
|
||||
}
|
||||
|
||||
$count++;
|
||||
|
||||
|
@ -397,8 +399,12 @@ class WP_Posts_List_Table extends WP_List_Table {
|
|||
foreach ( $orphans as $op ) {
|
||||
if ( $count >= $end )
|
||||
break;
|
||||
if ( $count >= $start )
|
||||
echo "\t" . $this->single_row( $op, 0 );
|
||||
|
||||
if ( $count >= $start ) {
|
||||
echo "\t";
|
||||
$this->single_row( $op, 0 );
|
||||
}
|
||||
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
|
@ -444,13 +450,16 @@ class WP_Posts_List_Table extends WP_List_Table {
|
|||
}
|
||||
$num_parents = count( $my_parents );
|
||||
while ( $my_parent = array_pop( $my_parents ) ) {
|
||||
echo "\t" . $this->single_row( $my_parent, $level - $num_parents );
|
||||
echo "\t";
|
||||
$this->single_row( $my_parent, $level - $num_parents );
|
||||
$num_parents--;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $count >= $start )
|
||||
echo "\t" . $this->single_row( $page, $level );
|
||||
if ( $count >= $start ) {
|
||||
echo "\t";
|
||||
$this->single_row( $page, $level );
|
||||
}
|
||||
|
||||
$count++;
|
||||
|
||||
|
|
|
@ -136,7 +136,6 @@ class WP_Terms_List_Table extends WP_List_Table {
|
|||
$args['offset'] = $offset = ( $page - 1 ) * $number;
|
||||
|
||||
// convert it to table rows
|
||||
$out = '';
|
||||
$count = 0;
|
||||
|
||||
$terms = array();
|
||||
|
@ -152,11 +151,11 @@ class WP_Terms_List_Table extends WP_List_Table {
|
|||
$children = _get_term_hierarchy( $taxonomy );
|
||||
|
||||
// Some funky recursion to get the job done( Paging & parents mainly ) is contained within, Skip it for non-hierarchical taxonomies for performance sake
|
||||
$out .= $this->_rows( $taxonomy, $terms, $children, $offset, $number, $count );
|
||||
$this->_rows( $taxonomy, $terms, $children, $offset, $number, $count );
|
||||
} else {
|
||||
$terms = get_terms( $taxonomy, $args );
|
||||
foreach ( $terms as $term )
|
||||
$out .= $this->single_row( $term, 0, $taxonomy );
|
||||
$this->single_row( $term, 0, $taxonomy );
|
||||
$count = $number; // Only displaying a single page.
|
||||
}
|
||||
|
||||
|
@ -165,8 +164,6 @@ class WP_Terms_List_Table extends WP_List_Table {
|
|||
echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
|
||||
$this->no_items();
|
||||
echo '</td></tr>';
|
||||
} else {
|
||||
echo $out;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -174,7 +171,6 @@ class WP_Terms_List_Table extends WP_List_Table {
|
|||
|
||||
$end = $start + $per_page;
|
||||
|
||||
$output = '';
|
||||
foreach ( $terms as $key => $term ) {
|
||||
|
||||
if ( $count >= $end )
|
||||
|
@ -199,23 +195,24 @@ class WP_Terms_List_Table extends WP_List_Table {
|
|||
|
||||
$num_parents = count( $my_parents );
|
||||
while ( $my_parent = array_pop( $my_parents ) ) {
|
||||
$output .= "\t" . $this->single_row( $my_parent, $level - $num_parents, $taxonomy );
|
||||
echo "\t";
|
||||
$this->single_row( $my_parent, $level - $num_parents, $taxonomy );
|
||||
$num_parents--;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $count >= $start )
|
||||
$output .= "\t" . $this->single_row( $term, $level, $taxonomy );
|
||||
if ( $count >= $start ) {
|
||||
echo "\t";
|
||||
$this->single_row( $term, $level, $taxonomy );
|
||||
}
|
||||
|
||||
++$count;
|
||||
|
||||
unset( $terms[$key] );
|
||||
|
||||
if ( isset( $children[$term->term_id] ) && empty( $_REQUEST['s'] ) )
|
||||
$output .= $this->_rows( $taxonomy, $terms, $children, $start, $per_page, $count, $term->term_id, $level + 1 );
|
||||
$this->_rows( $taxonomy, $terms, $children, $start, $per_page, $count, $term->term_id, $level + 1 );
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
function single_row( $tag, $level = 0 ) {
|
||||
|
@ -225,7 +222,7 @@ class WP_Terms_List_Table extends WP_List_Table {
|
|||
$this->level = $level;
|
||||
|
||||
echo '<tr id="tag-' . $tag->term_id . '"' . $row_class . '>';
|
||||
echo $this->single_row_columns( $tag );
|
||||
$this->single_row_columns( $tag );
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
|
|
|
@ -1129,7 +1129,7 @@ class WP_Upgrader_Skin {
|
|||
return;
|
||||
$this->done_header = true;
|
||||
echo '<div class="wrap">';
|
||||
echo screen_icon();
|
||||
screen_icon();
|
||||
echo '<h2>' . $this->options['title'] . '</h2>';
|
||||
}
|
||||
function footer() {
|
||||
|
|
|
@ -209,7 +209,7 @@ class WP_Users_List_Table extends WP_List_Table {
|
|||
continue;
|
||||
|
||||
$style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"';
|
||||
echo "\n\t", $this->single_row( $user_object, $style, $role, isset( $post_counts ) ? $post_counts[ $userid ] : 0 );
|
||||
echo "\n\t" . $this->single_row( $user_object, $style, $role, isset( $post_counts ) ? $post_counts[ $userid ] : 0 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ add_action('install_themes_upload', 'install_themes_upload', 10, 1);
|
|||
function display_theme( $theme ) {
|
||||
_deprecated_function( __FUNCTION__, '3.4' );
|
||||
global $wp_list_table;
|
||||
return $wp_list_table->single_row( $theme );
|
||||
$wp_list_table->single_row( $theme );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue