on line 308: we are asking for a string to be returned.
on line 311: If it's empty, we are converting it to an array
on line 313: count() should throw a warning because it's being used on a string - Parameter must be an array or an object that implements Countable
same on line 315
on line 316: array_slice should throw a warning for the same reason - array_slice() expects parameter 1 to be array, ...
on line 319: [] throws a fatal if $log is not an array - Caught Error: [] operator not supported for strings
Solution:
On line 308, don't pass in the third argument to get_post_meta(). By doing this, we make sure that the return value is an array( empty or otherwise ) and we avoid all the warnings/errors about the var not being an array.
The Problem:
Parameter must be an array or an object that implements Countable
array_slice() expects parameter 1 to be array, ...
Caught Error: [] operator not supported for strings
Solution:
On line 308, don't pass in the third argument to
get_post_meta()
. By doing this, we make sure that the return value is an array( empty or otherwise ) and we avoid all the warnings/errors about the var not being an array.