WP_User_Query unexpected output after upgrading toWordPress 4.0.1
You shouldn’t be passing in $users[“results”] directly to a foreach without checking that $users is an array, and that it has a ‘results’ key. What if $users is empty, or false, and a WP_Error object? In this case, it isn’t an array, it’s a WP_User_Query object. Casting it to an array won’t fix that. Instead … Read more