Showing different images depending on user role
What’s the variable $user_info in you code? Probably you mean $commentator_info? If yes, this is certainly the error. You are trying to extract wp_capabilities (?) from a non-initialized variable ($user_info). Try this: <?php $comment_id = get_comment_ID(); $comment_data = get_comment($comment_id); $commentator_id = $comment_data->user_id; $commentator_info = get_userdata($commentator_id); // get_userdata, with the user ID specified, returns a WP_User … Read more