function shortcut_set_unassign_user

Same name in other branches
  1. 8.9.x core/modules/shortcut/shortcut.module \shortcut_set_unassign_user()

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.

1 call to shortcut_set_unassign_user()
ShortcutSetsTestCase::testShortcutSetUnassign in modules/shortcut/shortcut.test
Tests unassigning a shortcut set.

File

modules/shortcut/shortcut.module, line 462

Code

function shortcut_set_unassign_user($account) {
    $deleted = db_delete('shortcut_set_users')->condition('uid', $account->uid)
        ->execute();
    return (bool) $deleted;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.