farinspace / wpalchemy

Thin framework for wordpress
http://wpalchemy.com/
Other
416 stars 110 forks source link

Warning: count(): Parameter must be an array... #115

Closed mauro closed 6 years ago

mauro commented 6 years ago

I get this warning: Warning: count(): Parameter must be an array or an object that implements Countable in /Users/mauro/GitHub/mundana_wordpress/wp-content/plugins/wpalchemy/MetaBox.php on line 2048

This is the line causing the issue: $cnt = count(!empty($this->meta[$n])?$this->meta[$n]:NULL);

mauro commented 6 years ago

Looks like changing NULL to array() solves the warning. $cnt = count(!empty($this->meta[$n])?$this->meta[$n]:array());

paulcedrick commented 6 years ago

Hopefully this PR could fix this one -> https://github.com/farinspace/wpalchemy/pull/116/commits/9238fc178ebc2d4e5184856464dc9fb3562672d7

Still waiting for their reply