That warning was introduced in PHP 7.2. The PHP developers changed the way count() works for some reason…
The file you mention is part of the WordPress core. So the core code needs to be updated, because count() can still count an array, you just have to tell it that the upcoming variable is indeed an array.
$month_count = count( (array) $months );
Also, this is a warning, not an error. If you turn off your WP_DEBUG, you will not see it and all will still work. 😉
Thank you very much for the explanation.
But not only I don’t know how to turn off the WP_DEBUG (is it a plugin ?) but the fact is that I can’t sort my posts anymore since this warning appeared.
Hello,
Are you using the Latest versions of WP? To turn on/off WP_DEBUG, This link might help your with it: https://www.wpbeginner.com/wp-tutorials/how-to-turn-off-php-errors-in-wordpress/
I modified the file but the warning message is still there.
And is it really the solution to prevent all error messages ?
I am using the version 5.2.3 of WP by the way.
Hello,
Have you tried re-installing your WordPress Core? Dashboard > Updates > Re-install.
One way that it’s happening also is you might have some custom coding left on your site or theme that is related to Events Manager. I would suggest checking the mu-plugins folder or you themes functions.php
Alternatively You could try and disable all plugins and see if it still happens and activate one by one until the issue comes back, or you could try changing your theme also to test. One way to this is to Install WP Safe Mode (https://ww.wp.xz.cn/plugins/wp-safe-mode/)
– Activate and Enable Safe Mode. Please make sure that on the settings a twenty series theme is selected.
Effectivement, le problème vient de l’autre pluging de gestion de calendrier installé à la place.
J’aurais du y penser.
Merci
Hello,
Sorry but I didn’t quite understand with what you mean on your latest Post because it wasn’t english.
I tried it on google translate and from what I understand there is it was from another Calendar and it’s already fixed.
Sorry, I was in a hurry.
Yes I said the problem comes from another plugin but no idea how to resolve it as there is no support.
At least, I have a plugin to book appointment ;-p.
Thanks anyway