You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This error appears when no repeatable filed are created.
Warning: count(): Parameter must be an array or an object that implements Countable in :
admin-page-class\admin-page-class.php on line 1398
You can fix this just by change the order of checking if on line 1398 from : if (count($meta) > 0 && is_array($meta) ){
to if ( is_array($meta) && count($meta) > 0 ){
so If $meta is empty it will stop cheking for count.
Hope this will help someone.
The text was updated successfully, but these errors were encountered:
This is not an error, but a warning. There is a big difference - a warning will not stop the script from being executed, an error will.
This notice was introduced in PHP 7.2, so anything lower will not show this warning. Also, your solution is incorrect. Your coding will stop reading further is $meta is not an array, but the count() warning will still show.
count() can still count arrays and objects, it just needs to be told what it it:
if( count( (array) $meta ) > 0 && is_array( $meta ) )
Also, this code was last committed in 2014, long before PHP 7.2 was released. With PHP 7.4 to be released in November, you can probably expect more warnings for deprecated functions.
This error appears when no repeatable filed are created.
Warning: count(): Parameter must be an array or an object that implements Countable in :
admin-page-class\admin-page-class.php on line 1398
You can fix this just by change the order of checking if on line 1398 from :
if (count($meta) > 0 && is_array($meta) ){
to
if ( is_array($meta) && count($meta) > 0 ){
so If $meta is empty it will stop cheking for count.
Hope this will help someone.
The text was updated successfully, but these errors were encountered: