Community Documentation

search_get_keys

5 search.module search_get_keys()
6 search.module search_get_keys()

Helper function for grabbing search keys.

▾ 1 function calls search_get_keys()

search_view in modules/search/search.pages.inc
Menu callback; presents the search form and/or search results.

File

modules/search/search.module, line 968
Enables site-wide keyword searching.

Code

<?php
function search_get_keys() {
  static $return;
  if (!isset($return)) {
    // Extract keys as remainder of path
    // Note: support old GET format of searches for existing links.
    $path = explode('/', $_GET['q'], 3);
    $keys = empty($_REQUEST['keys']) ? '' : $_REQUEST['keys'];
    $return = count($path) == 3 ? $path[2] : $keys;
  }
  return $return;
}
?>
Login or register to post comments