Skip to content

Instantly share code, notes, and snippets.

@mglaman
Created January 15, 2015 21:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mglaman/f9460f9c1bd6bf230dd5 to your computer and use it in GitHub Desktop.
Save mglaman/f9460f9c1bd6bf230dd5 to your computer and use it in GitHub Desktop.
Fix Media WYSIWYG filter embeds to pre-alpha4
<?php
/**
* Implements hook_media_wysiwyg_token_to_markup_alter().
*/
function mymodule_media_wysiwyg_token_to_markup_alter(&$element, $tag_info, $settings) {
// Undo the damage done by #2194821
if (isset($element['content']['#type']) && $element['content']['#type'] == 'container') {
unset($element['content']['#type']);
unset($element['content']['#theme']);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment