This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: How to access search phrase via add_filter

Home Forums Product Support Forums Ajax Search Pro for WordPress Support How to access search phrase via add_filter Reply To: How to access search phrase via add_filter

#10123
Ernest MarcinkoErnest Marcinko
Keymaster

Hi Luyen,

To access the search phrase, use the asp_search_phrase_before_cleaning or the asp_search_phrase_after_cleaning filters.

The search data is passed via a POST request. Within this context you should be able to access the raw $_POST data as well:

[php]add_filter(‘asp_search_phrase_before_cleaning’, ‘asp_change_search_phrase ‘, 1,1);

function asp_change_search_phrase ($phrase) {
var_dump($_POST);
return $phrase;
}[/php]