1 search_embedded_form.module search_embedded_form_preprocess_search_results(&$variables)

Adds the test form to search results.

File

core/modules/search/tests/search_embedded_form/search_embedded_form.module, line 67
Test module implementing a form that can be embedded in search results.

Code

function search_embedded_form_preprocess_search_results(&$variables) {
  foreach ($variables['search_results'] as $key => $result) {
    $form = backdrop_get_form('search_embedded_form_form');
    $snippet = '<p>' . $variables['search_results'][$key]['snippet'] . '</p>';
    $snippet .= backdrop_render($form);
    $variables['search_results'][$key]['snippet'] = $snippet;
  }
}