Skip to content

Instantly share code, notes, and snippets.

@jonathandavis
Created September 9, 2013 19:27
Show Gist options
  • Save jonathandavis/6500293 to your computer and use it in GitHub Desktop.
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
<?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