Avoid PHP warnings with PHP >= 7.2.x

Fix PHP Warning:  sizeof(): Parameter must be an array or an object that implements Countable on line 263
This commit is contained in:
savvasha
2018-09-15 16:58:48 +03:00
committed by GitHub
parent 61bab3cbc8
commit f42499ba5e

View File

@@ -39,8 +39,11 @@ class SP_Meta_Box_Calendar_Data {
$title_format = get_option( 'sportspress_event_list_title_format', 'title' );
$time_format = get_option( 'sportspress_event_list_time_format', 'combined' );
if ( is_array( $usecolumns ) )
if ( is_array( $usecolumns ) ) {
$usecolumns = array_filter( $usecolumns );
}else{
$usecolumns = array();
}
?>
<div class="sp-data-table-container">
<table class="widefat sp-data-table sp-calendar-table">
@@ -272,4 +275,4 @@ class SP_Meta_Box_Calendar_Data {
</div>
<?php
}
}
}