search_query_insert

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 search_query_insert($keys, $option, $value = '')

Return a query with the given module-specific search option inserted in. e.g. 'type:book'.

▾ 3 functions call search_query_insert()

hook_search in developer-docs/hooks/core.php
Define a custom search routine.
node_search in modules/node/node.module
Implementation of hook_search().
node_search_validate in modules/node/node.module
Form API callback for the search form. Registered in node_form_alter().

Code

modules/search/search.module, line 681

<?php
function search_query_insert($keys, $option, $value = '') {
  if (search_query_extract($keys, $option)) {
    $keys = trim(preg_replace('/(^| )' . $option . ':[^ ]*/i', '', $keys));
  }
  if ($value != '') {
    $keys .= ' ' . $option . ':' . $value;
  }
  return $keys;
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen