You are here

function hook_media_wysiwyg_allowed_attributes_alter in D7 Media 7.3

Same name and namespace in other branches
  1. 7.4 modules/media_wysiwyg/media_wysiwyg.api.php \hook_media_wysiwyg_allowed_attributes_alter()
  2. 7.2 modules/media_wysiwyg/media_wysiwyg.api.php \hook_media_wysiwyg_allowed_attributes_alter()

Alter list of attributes allowed to be stored in json and rendered in HTML. This example ensures that 'class' is always a permitted attribute.

Parameters

array $allowed_attributes: A flat array of attribute names.

See also

media_wysiwyg_allowed_attributes()

1 invocation of hook_media_wysiwyg_allowed_attributes_alter()
media_wysiwyg_allowed_attributes in modules/media_wysiwyg/media_wysiwyg.module
Returns the set of allowed attributes for use with WYSIWYG.

File

modules/media_wysiwyg/media_wysiwyg.api.php, line 82
Hooks provided by the Media WYSIWYG module.

Code

function hook_media_wysiwyg_allowed_attributes_alter(&$allowed_attributes) {
  if (!in_array('class', $allowed_attributes)) {
    $allowed_attributes[] = 'class';
  }
}