Replace count with empty check

This commit is contained in:
Jon Surrell 2017-01-05 16:33:58 +01:00
parent e6bcc1aeb6
commit d38e22329f
1 changed files with 15 additions and 19 deletions

View File

@ -200,12 +200,7 @@ class WC_Admin_Log_Table_List extends WP_List_Table {
ORDER BY source ASC ORDER BY source ASC
" ); " );
$source_count = count( $sources ); if ( ! empty( $sources ) ) {
if ( ! $source_count ) {
return;
}
$selected_source = isset( $_REQUEST['source'] ) ? $_REQUEST['source'] : ''; $selected_source = isset( $_REQUEST['source'] ) ? $_REQUEST['source'] : '';
?> ?>
<label for="filter-by-source" class="screen-reader-text"><?php _e( 'Filter by source', 'woocommerce' ); ?></label> <label for="filter-by-source" class="screen-reader-text"><?php _e( 'Filter by source', 'woocommerce' ); ?></label>
@ -221,6 +216,7 @@ class WC_Admin_Log_Table_List extends WP_List_Table {
</select> </select>
<?php <?php
} }
}
/** /**
* Prepare table list items. * Prepare table list items.