Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP warning in WP error log #13

Open
louptn opened this issue Jan 21, 2021 · 0 comments
Open

PHP warning in WP error log #13

louptn opened this issue Jan 21, 2021 · 0 comments

Comments

@louptn
Copy link

louptn commented Jan 21, 2021

Getting a recurring warning:
PHP Warning: count(): Parameter must be an array or an object that implements Countable in /public_html/wp-content/plugins/coursepress/2.0/include/coursepress/data/class-course.php on line 1635
PHP Warning: count(): Parameter must be an array or an object that implements Countable in /public_html/wp-content/plugins/coursepress/2.0/include/coursepress/data/class-course.php on line 1637

Relevant lines are the same code:
$part = count( (array)$components > 0 ) ? array_pop( $components ) : 0;

Tried a fix along the lines of:
$part = (array)$components && count( (array)$components > 0 ) ? array_pop( $components ) : 0;

But still having the warning...any thoughts?

Running on WP 5.6 and PHP 7.3.23 (I am running it for a free workbook that can be signed into and worked on and saved, so i have not had to edit courses and don't dare go in there to see if i even could :-) just basically let it be while it works)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant