You are here

function require_on_publish_preprocess_fieldset in Require on Publish 8

Implements hook_preprocess_HOOK().

File

./require_on_publish.module, line 154
Module file for the Require on Publish module.

Code

function require_on_publish_preprocess_fieldset(&$variables) {
  $element = $variables['element'];
  if (isset($element['#required_on_publish']) && $element['#required_on_publish']) {
    $variables['legend_span']['attributes'] = new Attribute([
      'class' => [
        'form-required-on-publish',
      ],
    ]);
  }
}