Skip to content

Instantly share code, notes, and snippets.

@seandenigris
Created October 30, 2015 03:09
Show Gist options
  • Select an option

  • Save seandenigris/cedd0523ebe2aa9fb1b7 to your computer and use it in GitHub Desktop.

Select an option

Save seandenigris/cedd0523ebe2aa9fb1b7 to your computer and use it in GitHub Desktop.
WordPress Disable TinyMCE Tag Stripping
// Add to functions.php to disable tag stripping from visual editor
// From http://wordpress.stackexchange.com/questions/52582/how-to-disable-tinymce-from-removing-span-tags
function override_mce_options($initArray) {
$opts = '*[*]';
$initArray['valid_elements'] = $opts;
$initArray['extended_valid_elements'] = $opts;
return $initArray;
}
add_filter('tiny_mce_before_init', 'override_mce_options');
@davidrichied
Copy link

davidrichied commented Mar 11, 2017

Great! This is just what I was looking for! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment