Skip to content

Instantly share code, notes, and snippets.

@Pross
Created May 2, 2019 16:21
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pross/4d9cd4f2bf53c757e91da48f13052b42 to your computer and use it in GitHub Desktop.
Save Pross/4d9cd4f2bf53c757e91da48f13052b42 to your computer and use it in GitHub Desktop.
<?php // ignore this line, its only to make highlighting work
add_filter( 'fl_builder_render_module_content', function( $out, $module ) {
if ( 'heading' === $module->slug ) {
$string = $out;
$find = ' ';
$replace = '&nbsp;';
$out = strrev( preg_replace( strrev( "/$find/" ), strrev( $replace ), strrev( $string ), 1 ) );
}
return $out;
}, 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment