You are here

function pathauto_file_update_alias_multiple in File Entity (fieldable files) 7.3

Same name and namespace in other branches
  1. 7.2 file_entity.module \pathauto_file_update_alias_multiple()

Update the URL aliases for multiple files.

Parameters

$fids: An array of file IDs.

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

$options: An optional array of additional options.

1 call to pathauto_file_update_alias_multiple()
file_entity_pathauto_bulk_update_batch_process in ./file_entity.pathauto.inc
Batch processing callback; Generate aliases for files.
1 string reference to 'pathauto_file_update_alias_multiple'
pathauto_file_operations in ./file_entity.module
Implements hook_file_operations() on behalf of pathauto.module.

File

./file_entity.module, line 2439
Extends Drupal file entities to be fieldable and viewable.

Code

function pathauto_file_update_alias_multiple(array $fids, $op, array $options = array()) {
  $options += array(
    'message' => FALSE,
  );
  $files = file_load_multiple($fids);
  foreach ($files as $file) {
    pathauto_file_update_alias($file, $op, $options);
  }
  if (!empty($options['message'])) {
    drupal_set_message(format_plural(count($fids), 'Updated URL alias for 1 file.', 'Updated URL aliases for @count files.'));
  }
}