mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
In WP_Terms_List_Table::display_rows_or_placeholder():
* `get_terms()` can return `WP_Error`, so its return value should be checked before traversing. * The 2nd call to `get_terms()` can be removed, it is redundant #OPTIMIZATION See #32444. git-svn-id: https://develop.svn.wordpress.org/trunk@32739 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8463ad6f29
commit
87f0a73bdc
@ -223,7 +223,7 @@ class WP_Terms_List_Table extends WP_List_Table {
|
||||
}
|
||||
$terms = get_terms( $taxonomy, $args );
|
||||
|
||||
if ( empty( $terms ) ) {
|
||||
if ( empty( $terms ) || ! is_array( $terms ) ) {
|
||||
echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
|
||||
$this->no_items();
|
||||
echo '</td></tr>';
|
||||
@ -239,7 +239,6 @@ class WP_Terms_List_Table extends WP_List_Table {
|
||||
// Some funky recursion to get the job done( Paging & parents mainly ) is contained within, Skip it for non-hierarchical taxonomies for performance sake
|
||||
$this->_rows( $taxonomy, $terms, $children, $offset, $number, $count );
|
||||
} else {
|
||||
$terms = get_terms( $taxonomy, $args );
|
||||
foreach ( $terms as $term ) {
|
||||
$this->single_row( $term );
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user