Skip to content

Instantly share code, notes, and snippets.

@djrmom
Created June 20, 2018 15:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djrmom/a18569c940c0f5fa3a4ce09d29f9c2f1 to your computer and use it in GitHub Desktop.
Save djrmom/a18569c940c0f5fa3a4ce09d29f9c2f1 to your computer and use it in GitHub Desktop.
facetwp move spaces to right
<?php
/** moves non-breaking spaces to right of fselect label **/
add_filter( 'facetwp_facet_html', function( $output, $params ) {
if ( 'my_facet_name' == $params['facet']['name'] ) { // replace 'my_facet_name' with name of your facet
$pattern = '/>([&nbsp;]+)([^<]+)/';
$output = preg_replace( $pattern, '>${2} ${1}', $output );
}
return $output;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment