Hi someone please can help me?
I've updated the PHP to 7.4 and I got this error message:
count(): Parameter must be an array or an object that implements Countable in ………………… on line 216
The function is:
// Return custom sidebars list, prepended inherit and main sidebars item (if need)
if ( !function_exists( 'custom_made_get_list_sidebars' ) ) {
function custom_made_get_list_sidebars($prepend_inherit=false) {
if (($list = custom_made_storage_get('list_sidebars'))=='') {
$list = apply_filters('custom_made_filter_list_sidebars', array(
'sidebar_widgets' => esc_html__('Sidebar Widgets', 'custom-made'),
'header_widgets' => esc_html__('Header Widgets', 'custom-made'),
'above_page_widgets' => esc_html__('Above Page Widgets', 'custom-made'),
'above_content_widgets' => esc_html__('Above Content Widgets', 'custom-made'),
'below_content_widgets' => esc_html__('Below Content Widgets', 'custom-made'),
'below_page_widgets' => esc_html__('Below Page Widgets', 'custom-made'),
'footer_widgets' => esc_html__('Footer Widgets', 'custom-made')
)
);
$custom_sidebars_number = max(0, min(2, custom_made_get_theme_setting('custom_sidebars')));
<strong> if (count($custom_sidebars_number) > 0) {</strong>
for ($i=1; $i <= $custom_sidebars_number; $i++) {
$list['custom_widgets_'.intval($i)] = sprintf(esc_html__('Custom Widgets %d', 'custom-made'), $i);
}
}
custom_made_storage_set('list_sidebars', $list);
}
return $prepend_inherit ? custom_made_array_merge(array('inherit' => esc_html__("Inherit", 'custom-made')), $list) : $list;
}
}
The bold is the line 216.