User Meta error when meta doesn’t exist
-
Please help. I can’t find a solution for this case.
An item needs to be displayed based on a user meta value. This works fine: if the value is in the array the content shows, if the value is not in the array it doesn’t. But some users may not have the meta value set (array doesn’t exist), other users are just visitors and not logged in.
Both cases throw the error:
Fatal error: Uncaught TypeError: array_intersect(): Argument #1 must be of type array, bool given...
I understand what causes the error, but can’t figure out how to solve it. Adding a user role condition with ‘condition type = all’ does not solve this problem.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘User Meta error when meta doesn’t exist’ is closed to new replies.