asp_only_keyword_results

Gives access to the live search suggested keywords array before sending them to the templating system.

Gives access the keyword suggestions array before sending it to the templating system. Different from asp_results, as this is only applied in ajax context, when no results were found, and the keyword suggestions are enabled.

apply_filters('asp_only_keyword_results', $data);

Parameters

  • $data(array) - Array containing the keyword data

Usage

add_filter( 'asp_only_keyword_results', 'asp_custom_keyword_results', 10, 4 );
function asp_custom_keyword_results( $data ) {
    $data['keywords'] = array('keyword 1', 'keyword 2', 'keyword 3');
    return $data;
}

Last updated

Copyright Ernest Marcinko