wpdreams

Ajax Search Lite keyword replacement

Jan 13th, 2016
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. add_filter( 'asl_search_phrase_before_cleaning', 'asl_remove_words', 1, 1 );
  2.  
  3. function asl_remove_words( $phrase ) {
  4. /**
  5. * Comma separated list of exceptions
  6. * Change it to your needs
  7. */
  8. $exceptions = "word1, word2, word3";
  9.  
  10. // ---- Dont change anything below this line ----
  11.  
  12. $exceptions = str_replace(array(" ,", ", ", " , "), ",", $exceptions);
  13.  
  14. return str_replace( explode(",", $exceptions), "asdasd", $phrase);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment