function shortcut_set_unassign_user

shortcut_set_unassign_user($account)

Unassigns a user from any shortcut set they may have been assigned to.

The user will go back to using whatever default set applies.

Parameters

$account: A user account that will be removed from the shortcut set assignment.

Return value

TRUE if the user was previously assigned to a shortcut set and has been successfully removed from it. FALSE if the user was already not assigned to any set.

Deprecated

in Drupal 8.x, will be removed before Drupal 9.0. Use \Drupal::entityManager()->getStorage('shortcut_set')->unassignUser().

File

core/modules/shortcut/shortcut.module, line 146
Allows users to manage customizable lists of shortcut links.

Code

function shortcut_set_unassign_user($account) {
  return (bool) \Drupal::entityManager()
    ->getStorage('shortcut_set')
    ->unassignUser($account);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!shortcut!shortcut.module/function/shortcut_set_unassign_user/8.1.x