asp_before_ajax_output

Executed on the ajax search results output.

Applies a filter on the HTML results output. This is not the whole ajax response, only the section with the results.

$html_results = apply_filters('asp_before_ajax_output', $html_results, $id, $results, $args);

Parameters

  • $html_results (string) - HTML version of results

  • $id (int) - Search instance ID

  • $results (array) - Result objects array

  • $args (array) - Search arguments

Usage

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;
}