Skip to content

Instantly share code, notes, and snippets.

@adamcapriola
Last active January 17, 2019 21:31
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 adamcapriola/51fdba135762b50b7b663aa4be468610 to your computer and use it in GitHub Desktop.
Save adamcapriola/51fdba135762b50b7b663aa4be468610 to your computer and use it in GitHub Desktop.
<?php
/**
* Remove &nbsp;'s
* @link https://core.trac.wordpress.org/ticket/31157
* @link https://core.trac.wordpress.org/ticket/31676
*
*/
add_filter( 'the_content', 'ac_remove_nbsps', 10 ); // Adjust priorities if necessary
add_filter( 'widget_text', 'ac_remove_nbsps', 10 );
function ac_remove_nbsps( $contentt ) {
return str_replace( "\xc2\xa0", ' ', $content );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment