You are here

function pathauto_blog_update_alias in Pathauto 6.2

Same name and namespace in other branches
  1. 7 pathauto.module \pathauto_blog_update_alias()

Update the blog URL aliases for an individual user account.

Parameters

$account: A user account object.

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

$options: An optional array of additional options.

2 calls to pathauto_blog_update_alias()
blog_pathauto_bulk_update_batch_process in ./pathauto.pathauto.inc
Batch processing callback; Generate aliases for blogs.
pathauto_user_update_alias in ./pathauto.module
Update the URL aliases for an individual user account.

File

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

Code

function pathauto_blog_update_alias($account, $op, $options = array()) {

  // Skip processing if the blog has no pattern.
  if (!pathauto_pattern_load_by_entity('blog')) {
    return;
  }
  $options += array(
    'language' => '',
  );
  module_load_include('inc', 'pathauto');
  if (node_access('create', 'blog', $account)) {
    pathauto_create_alias('blog', $op, "blog/{$account->uid}", array(
      'user' => $account,
    ), $account->uid, NULL, $options['language']);
  }
  else {
    pathauto_path_delete_all("blog/{$account->uid}");
  }
}