function ds_render_author_field in Display Suite 7
Same name and namespace in other branches
- 7.2 ds.module \ds_render_author_field()
Render an author field.
1 string reference to 'ds_render_author_field'
- ds_ds_fields_info in ./
ds.ds_fields_info.inc - Implements hook_ds_fields_info().
File
- ./
ds.module, line 1215 - Display Suite core functions.
Code
function ds_render_author_field($field) {
// Users without a user name are anonymous users. These are never linked.
if (empty($field['entity']->name)) {
return check_plain(variable_get('anonymous', t('Anonymous')));
}
if ($field['formatter'] == 'author') {
return check_plain($field['entity']->name);
}
if ($field['formatter'] == 'author_linked') {
return theme('username', array(
'account' => $field['entity'],
));
}
}