function hook_global_filter_value_alter in Views Global Filter 7
Same name and namespace in other branches
- 8 global_filter.api.php \hook_global_filter_value_alter()
Alter the value passed to the Global Filter.
This hook allows you to change the Global Filter value before it is set.
Parameters
string $name: The name of the field used as a Global Filter.
mixed $value: The value of the Global Filter, passed by reference, so it can be changed.
1 invocation of hook_global_filter_value_alter()
- global_filter_set_on_session in ./
global_filter.storage.inc - Sets the filter of the supplied name to the supplied value.
File
- ./
global_filter.api.php, line 20 - This file contains no working PHP code; it exists to provide additional documentation for doxygen as well as to document hooks in the standard Drupal manner.
Code
function hook_global_filter_value_alter($name, &$value) {
// Global Filter for city using Smart IP.
if ($name == 'field_city' && $value == '') {
$value = $_SESSION['smart_ip']['location']['city'];
}
}