How to add HTML to filter element options?

I’m trying to add HTML to filter options using bricks/filter_element/populated_options. Unfortunately, get_option_text_with_count() runs esc_html() on the option text before it adds its own HTML, and the render function in Filter_Checkbox (and the others) echoes without running any other filters. What can I do?

Specifically, I want to add taxonomy descriptions to the options that will be shown in a tooltip on hover.

Thanks for any help.

2 Likes

Hello, I’ve got the exact same question and am wondering if you ever figured this out. And if so, what solution worked for you?

Thanks.

Nope. There’s no good solution. Bricks does want us to customize this output. There’s no reason to run esc_html here, and Bricks is sorely lacking filters on output before display in a number of places.

Thank you. I used some AI tools to see if there was a way, and there is – but it requires a fair amount of php and/or javascript to make it happen. I haven’t tried it yet, I was hoping for an easier solution.

Thanks again.