You are here

function pathauto_node_update_alias_multiple in Pathauto 6.2

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

Update the URL aliases for multiple nodes.

Parameters

$nids: An array of node IDs.

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

$options: An optional array of additional options.

1 call to pathauto_node_update_alias_multiple()
node_pathauto_bulk_update_batch_process in ./pathauto.pathauto.inc
Batch processing callback; Generate aliases for nodes.
1 string reference to 'pathauto_node_update_alias_multiple'
pathauto_node_operations in ./pathauto.module
Implements hook_node_operations().

File

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

Code

function pathauto_node_update_alias_multiple($nids, $op, $options = array()) {
  $options += array(
    'message' => FALSE,
  );
  foreach ($nids as $nid) {
    if ($node = node_load($nid, NULL, TRUE)) {
      pathauto_node_update_alias($node, $op, $options);
    }
  }
  if (!empty($options['message'])) {
    drupal_set_message(format_plural(count($nids), 'Updated URL alias for 1 node.', 'Updated URL aliases for @count nodes.'));
  }
}