I am having an issue with adding default text to multi-select taxonomy filters in Toolset, as the default_label only works for select taxonomy filters.
Solution:
To add a value-less option with the desired text to the multi-select input, use the following JavaScript code:
document.addEventListener("DOMContentLoaded", function() {
// Get the select element
const selectElement = document.querySelector('select[name="wpv-offering[]"]');
// Create a new option element
const defaultOption = document.createElement('option');
defaultOption.value = 'any';
defaultOption.text = 'Any';
// Set the new option as the default selected option
defaultOption.selected = true;
// Add the new option to the beginning of the select element
selectElement.insertBefore(defaultOption, selectElement.firstChild);
});
This code waits for the DOM content to be loaded, gets the select element, creates a new option element, sets it as the default selected option, and adds it to the beginning of the select element.