Created
September 30, 2019 17:11
-
-
Save mgibbs189/7d3cc6940edf0302217a761068c40df4 to your computer and use it in GitHub Desktop.
Automatically replace ampersand "&" with raw &
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 | |
// Add to your (child) theme's functions.php | |
// Make sure to re-index afterwards | |
add_filter( 'facetwp_index_row', function( $params, $class ) { | |
if ( 'YOUR_FACET_NAME' == $params['facet_name'] ) { | |
$params['facet_display_value'] = str_replace( '&', '&', $params['facet_display_value'] ); | |
$params['facet_display_value'] = str_replace( '&', '&', $params['facet_display_value'] ); | |
$params['facet_display_value'] = str_replace( '&', '&', $params['facet_display_value'] ); | |
} | |
return $params; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment