function pathauto_blog_update_alias in Pathauto 7
Same name and namespace in other branches
- 6.2 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 1172 - Main file for the Pathauto module, which automatically generates aliases for content.
Code
function pathauto_blog_update_alias(stdClass $account, $op, array $options = array()) {
// Skip processing if the blog has no pattern.
if (!pathauto_pattern_load_by_entity('blog')) {
return FALSE;
}
$options += array(
'language' => LANGUAGE_NONE,
);
module_load_include('inc', 'pathauto');
if (node_access('create', 'blog', $account)) {
return pathauto_create_alias('blog', $op, "blog/{$account->uid}", array(
'user' => $account,
), NULL, $options['language']);
}
else {
pathauto_path_delete_all("blog/{$account->uid}");
}
}