Executed on the ajax search results output.
Last updated 4 years ago
Applies a filter on the HTML results output. This is not the whole ajax response, only the section with the results.
$html_results (string) - HTML version of results
$id (int) - Search instance ID
$results (array) - Result objects array
$args (array) - Search arguments
$html_results = apply_filters('asp_before_ajax_output', $html_results, $id, $results, $args);
add_filter( 'asp_before_ajax_output', 'asp_before_ajax_output_prepend', 10, 4 ); function asp_before_ajax_output_prepend( $html_results, $id, $results , $args) { return "<p>Hi!</p>" . $html_results; }