You are here

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\FieldFormatter

Code

protected function getCaption($entity, $field_name, $settings) {
  return empty($entity->{$field_name}) ? [] : [
    '#markup' => filter_xss_admin($entity->{$field_name}),
  ];
}