diff --git a/wp-admin/includes/list-table.php b/wp-admin/includes/list-table.php index ffc771a9e7..5561fbdd31 100644 --- a/wp-admin/includes/list-table.php +++ b/wp-admin/includes/list-table.php @@ -782,11 +782,15 @@ class WP_List_Table { $this->display_rows(); $rows = ob_get_clean(); - die( json_encode( array( - 'rows' => $rows, - 'total_items' => sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ), - 'total_pages' => $total_pages - ) ) ); + $response = array( 'rows' => $rows ); + + if ( isset( $total_items ) ) + $response['total_items'] = sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ); + + if ( isset( $total_pages ) ) + $response['total_pages'] = $total_pages; + + die( json_encode( $response ) ); } /**