Skip to content

Instantly share code, notes, and snippets.

@tnightingale
Created August 18, 2017 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tnightingale/c87b32c12bbdb8475b7bd83750429510 to your computer and use it in GitHub Desktop.
Save tnightingale/c87b32c12bbdb8475b7bd83750429510 to your computer and use it in GitHub Desktop.
$public_fields['organization'] = array(
'callback' => function (DataInterpreterInterface $data) {
return $data->getWrapper()->og_group_ref->label();
}
);
$public_fields['organizationLogo'] = array(
'callback' => function (DataInterpreterInterface $data) {
$style = 'small_logo';
$logo_field = $data->getWrapper()->og_group_ref->field_logo->value();
$url = image_style_url($style, $logo_field['uri']);
return $url;
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment