PHP7 and plugin WP News and Scrolling Widgets
-
Hello, file PHP_errors.log shows some problems with plugin sp-news-and-widget after we moved to PHP7. There are 3 errors in 3 lines of file widget_function.php:
Here they are:
[02-Dec-2020 17:50:16 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/--/--/--/public_html/wp-content/plugins/sp-news-and-widget/widget_function.php on line 213 [02-Dec-2020 17:50:16 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/--/--/--/public_html/wp-content/plugins/sp-news-and-widget/widget_function.php on line 214 [02-Dec-2020 17:50:16 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/--/--/--/public_html/wp-content/plugins/sp-news-and-widget/widget_function.php on line 215
How to edit these lines 213,214,215 in widget_function.php in order to get well with PHP7?
if ( isset( $instance['height'] ) && ( 0 < count( $instance['height'] ) ) ) { $args['height'] = intval( $instance['height'] ); } if ( isset( $instance['pause'] ) && ( 0 < count( $instance['pause'] ) ) ) { $args['pause'] = intval( $instance['pause'] ); } if ( isset( $instance['speed'] ) && ( 0 < count( $instance['speed'] ) ) ) { $args['speed'] = intval( $instance['speed'] ); }
May be to use empty() instead of count(), but how?
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘PHP7 and plugin WP News and Scrolling Widgets’ is closed to new replies.