Commit eaf86890 authored by geoffreyr's avatar geoffreyr Committed by Mike Keran
Browse files

Issue #2733975 by geoffreyr: Allow modification of display options for custom filter types

parent ea41d70f
......@@ -18,3 +18,18 @@ function hook_better_exposed_filters_settings_alter(&$settings, $context) {
$settings['field_price_value']['slider_options']['bef_slider_min'] = 500;
$settings['field_price_value']['slider_options']['bef_slider_max'] = 5000;
}
/**
* Modify the array of BEF display options for an exposed filter.
*
* @param array $display_options
* The set of display options available to this filter.
* @param object $filter
* The exposed filter.
*/
function hook_better_exposed_filters_display_options_alter(&$display_options, $filter) {
if ($filter instanceof CustomViewsFilterFoo) {
$display_options['bef_links'] = t('Links');
}
}
......@@ -460,6 +460,9 @@ Title Desc|Z -> A</pre> Leave the replacement text blank to remove an option alt
$display_options['bef_hidden'] = t('Hidden');
}
// Alter the list of available display options for this filter.
drupal_alter('better_exposed_filters_display_options', $display_options, $filter);
$filter_key = $filter->options['is_grouped'] ? 'group_info' : 'expose';
$identifier = '"' . $filter->options[$filter_key]['identifier'] . '"';
if (!empty($filter->options[$filter_key]['label'])) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment