You are here

function pathauto_user_update_alias_multiple in Pathauto 6

Same name and namespace in other branches
  1. 6.2 pathauto.module \pathauto_user_update_alias_multiple()
  2. 7 pathauto.module \pathauto_user_update_alias_multiple()

Update the URL aliases for multiple user accounts.

Parameters

$uids: An array of user account IDs.

$op: Operation being performed on the accounts ('insert', 'update' or 'bulkupdate').

$message: A boolean if TRUE will display a message about how many accounts were updated.

1 string reference to 'pathauto_user_update_alias_multiple'
pathauto_user_operations in ./pathauto.module
Implements hook_user_operations().

File

./pathauto.module, line 647
Main file for the Pathauto module, which automatically generates aliases for content.

Code

function pathauto_user_update_alias_multiple($uids, $op, $message = FALSE) {
  foreach ($uids as $uid) {
    if ($account = user_load($uid)) {
      pathauto_user_update_alias($account, $op);
    }
  }
  if ($message) {
    drupal_set_message(format_plural(count($uids), 'Updated URL alias for 1 user account.', 'Updated URL aliases for @count user accounts.'));
  }
}