/searchwp-customizations.php Secret
Created
March 16, 2022 16:24
Remove hyphens from product codes when searching in SearchWP
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 | |
// Remove hyphens from product codes when searching in SearchWP. | |
add_filter( 'searchwp\query\search_string', function( $search_string, $query ) { | |
return str_replace( '-', '', $search_string ); | |
}, 30, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment