Preprocess Function: Author First Name and Last Name

Public

Preprocess Function change posted by Information to use the user First Name and Last Name Fields

Get raw version
php
  1. function MYTHEME_preprocess_node(&$variables){
  2. $node = $variables['node'];
  3. $variables['firstname'] = $node->getOwner()->field_first_name->value;
  4. $variables['lastname'] = $node->getOwner()->field_last_name->value;
  5. }