bg_image_formatter.module in Background Images Formatter 8
Same filename and directory in other branches
File
bg_image_formatter.moduleView source
<?php
/**
* @file
* Main module file.
*/
declare (strict_types=1);
use Drupal\Core\Ajax\AddCssCommand;
/**
* Implements hook_ajax_render_alter().
*/
function bg_image_formatter_ajax_render_alter(array &$data) {
foreach ($data as &$command_data) {
if ($command_data['command'] === 'settings' && isset($command_data['settings']['bg_image_formatter_css'])) {
foreach ($command_data['settings']['bg_image_formatter_css'] as $style_tag) {
$data[] = (new AddCssCommand($style_tag))
->render();
}
unset($command_data['settings']['bg_image_formatter_css']);
}
}
}
Functions
Name | Description |
---|---|
bg_image_formatter_ajax_render_alter | Implements hook_ajax_render_alter(). |