search_query_extract

Versions
4.7 – 6
search_query_extract($keys, $option)

Extract a module-specific search option from a search query. e.g. 'type:book'

▾ 2 functions call search_query_extract()

node_search in modules/node.module
Implementation of hook_search().
search_query_insert in modules/search.module
Return a query with the given module-specific search option inserted in. e.g. 'type:book'.

Code

modules/search.module, line 613

<?php
function search_query_extract($keys, $option) {
  if (preg_match('/(^| )'. $option .':([^ ]*)( |$)/i', $keys, $matches)) {
    return $matches[2];
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.