Created
September 9, 2013 19:27
-
-
Save jonathandavis/6500293 to your computer and use it in GitHub Desktop.
Pre-filters search words to collapse dashes everywhere: 2444-22-1 becomes 2444221 and radio-controlled becomes radiocontrolled
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_filter('shopp_search_query', 'collapse_dashed_words', 5); | |
add_filter('shopp_boolean_search', 'collapse_dashed_words', 5); | |
add_filter('shopp_shortword_search', 'collapse_dashed_words', 5); | |
add_filter('shopp_index_content', 'collapse_dashed_words', 5); | |
function collapse_dashed_words ( $string ) { | |
return str_replace('-', '', $string); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment