Forums
(@robstero)
15 years, 6 months ago
You can do the following to set the current user using a specific user’s ID:
wp_set_current_user($post['user_ID']);
If you do that before calling current_user_can() you should be golden. Not sure if you should unset it afterwards or not, though.