Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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