Created
June 20, 2018 15:06
-
-
Save djrmom/a18569c940c0f5fa3a4ce09d29f9c2f1 to your computer and use it in GitHub Desktop.
facetwp move spaces to right
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 = '/>([ ]+)([^<]+)/'; | |
$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