Error when user not logged in and “user meta contains in array” is used
-
Hello, just started using visibility logic and it has been serving us well. Just wanted to tell you that there is a problem with the function that checks if a user meta with the value being an array is used. If forse some reason the user doesn’t have the meta key in it’s profile, get_user_meta returns false. This means that when you check for a value inside the meta’s array, array_intersect breaks because you are not passing an array but a boolean. I fixed it by changing at line 327 of UserMetaVisibility.php to this:
if ( $user_meta != false && empty( array_intersect( $user_meta, $values ) ) ) { $meta_is_consistent = false; }
Edit: actually i just found there is already an if that checks if the value is an array. The only problem is that the comparison just under it still runs array_intersects so it breaks :).
- The topic ‘Error when user not logged in and “user meta contains in array” is used’ is closed to new replies.