How do you programmatically get the current user's status?
Assuming this is Drupal 8, try $user-&gt;isBlocked().
If this is Drupal 7, you probably just need to call user_load($uid) first in order to get a fully-loaded user object before checking the $user-&gt;status. Or try user_is_blocked($name).