You are here

function ds_render_author_field in Display Suite 7.2

Same name and namespace in other branches
  1. 7 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 1062
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)) {
    $output = check_plain(variable_get('anonymous', t('Anonymous')));
  }
  if ($field['formatter'] == 'author') {
    $output = format_username($field['entity']);
  }
  if ($field['formatter'] == 'author_linked') {
    $output = theme('username', array(
      'account' => $field['entity'],
    ));
  }
  return ds_edit_support('author', $output, $field);
}