function search_invoke_preprocess

Same name in other branches
  1. 7.x modules/search/search.module \search_invoke_preprocess()
  2. 9 core/modules/search/search.module \search_invoke_preprocess()

Invokes hook_search_preprocess() to simplify text.

Parameters

string $text: Text to preprocess, passed by reference and altered in place.

string|null $langcode: Language code for the language of $text, if known.

1 call to search_invoke_preprocess()
search_simplify in core/modules/search/search.module
Simplifies and preprocesses text for searching.

File

core/modules/search/search.module, line 377

Code

function search_invoke_preprocess(&$text, $langcode = NULL) {
    foreach (\Drupal::moduleHandler()->getImplementations('search_preprocess') as $module) {
        $text = \Drupal::moduleHandler()->invoke($module, 'search_preprocess', [
            $text,
            $langcode,
        ]);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.