protected function BlazyImageFormatter::getCaption in Blazy 7
Returns the captions.
Overrides BlazyFormatterBlazy::getCaption
File
- src/
Plugin/ Field/ FieldFormatter/ BlazyImageFormatter.php, line 15
Class
- BlazyImageFormatter
- Plugin for the Blazy image formatter.
Namespace
Drupal\blazy\Plugin\Field\FieldFormatterCode
protected function getCaption($entity, $field_name, $settings) {
return empty($entity->{$field_name}) ? [] : [
'#markup' => filter_xss_admin($entity->{$field_name}),
];
}