I have exposed filters in a view as select lists. How can I change the text for the default filter option of "- Any -"? In previous versions it was suggested to use a preprocess function like this:
if($form['#id'] == 'views-exposed-form') {
foreach ($form['FIELDNAME']['#options'] as $key => &$option) {
if ($key === 'All') {
$option = 'All';
}
}
}
But in Drupal 8, instead of a modifiable key/value, it is stuck inside a protected class.
protected string -> string(7) "- Any -"
How can I modify this?
Note: I also tried Better Exposed Filters, but it is unable to rewrite the "- Any -" option.