function UnblockUser::execute
Executes the plugin.
Overrides ExecutableInterface::execute
File
- 
              core/
modules/ user/ src/ Plugin/ Action/ UnblockUser.php, line 23  
Class
- UnblockUser
 - Unblocks a user.
 
Namespace
Drupal\user\Plugin\ActionCode
public function execute($account = NULL) {
  // Skip unblocking user if they are already unblocked.
  if ($account !== FALSE && $account->isBlocked()) {
    $account->activate();
    $account->save();
  }
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.