In Drupal 7, I have a content type that displays a content view within it. This view display contains 4 exposed filters. On the content type, I have a custom select field which allows the author to choose which exposed filters they want to hide on the embedded view.
I then take these selections from the node. Using
hook_views_pre_build(), I’m able to hide (by unsetting) any filter they don’t want. It works great upon initial load of the page.
However, the exposed filters use AJAX. When a visitor uses one of the exposed filters and the view loads the filtered display, it no longer respects my
hook_views_pre_build() settings. Any filter I hid in that hook are now exposed again in the AJAX-generated views display.
Which hook (or combination of hooks) can I use to hide filters not only in the initial page load, but also when an AJAX filter is used/loaded and the view refreshes?