function hook_views_autocomplete_filter_matches_alter in Views Autocomplete Filters 7
Allow modules to alter the calculated matches or programmatically change empty results messages.
Parameters
array $matches: Markup for autocomplete matches, keyed by suggestion text.
string $string: The base string entered by the user within the from.
stdClass $view: The executed view object used to lookup match suggestions.
1 invocation of hook_views_autocomplete_filter_matches_alter()
- views_autocomplete_filter in ./
views_autocomplete_filters.inc - Menu callback. Retrieves a pipe delimited string of autocomplete suggestions.
File
- ./
views_autocomplete_filters.api.php, line 20 - Hooks provided by Views Autocomplete Filters.
Code
function hook_views_autocomplete_filter_matches_alter(&$matches, $string, $view) {
// Disable any empty result messages.
if (isset($matches['']) && count($matches) == 1) {
$matches = array();
}
}