| Versionen | |
|---|---|
| drupal6 – drupal7 | search_query_extract($keys, $option) |
Extract a module-specific search option from a search query. e.g. 'type:book'
modules/
<?php
function search_query_extract($keys, $option) {
if (preg_match('/(^| )' . $option . ':([^ ]*)( |$)/i', $keys, $matches)) {
return $matches[2];
}
}
?>
Kommentare
Kommentar hinzufügen