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

Reply To: Adding shortcode to results

#35610
Ernest MarcinkoErnest Marcinko
Keymaster

Yes, you can.

If you mean the server side (PHP), then you can use the asp_results filter. That is triggered whenever the search is finished and before the output. You can use it as an action hook instead of a filter as well:

add_action( 'asp_results', 'asp_my_custom_results_action', 10, 4 );
function asp_my_custom_results_action( $resultsi, $search_id, $is_ajax, $args) {
	// Do your thing here
}

If you mean javascript code executed on the front-end, that is also possible. Check this knowledge base for that.