Skip to content

Instantly share code, notes, and snippets.

@kingkool68
Created August 17, 2017 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kingkool68/4da4c055cdbba60d234cbc250a42210f to your computer and use it in GitHub Desktop.
Save kingkool68/4da4c055cdbba60d234cbc250a42210f to your computer and use it in GitHub Desktop.
Fixing Google Docs formatting
<?php
add_filter( 'wp_kses_allowed_html', function( $allowed_tags, $context ) {
if ( isset( $allowed_tags['span'] ) ) {
unset( $allowed_tags['span'] );
}
foreach ( $allowed_tags as $tag => $attrs ) {
$allowed_tags[ $tag ]['style'] = false;
$allowed_tags[ $tag ]['dir'] = false;
}
return $allowed_tags;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment