Adding body classes to Customizer
-
Howdy folks,
I’m trying to use Javascript to hide some panels in the Customizer based on user role. I’d like to accomplish this the same way I do in the Block editor and admin interface, by adding a class to the body tag.
Using the admin_body_class filter does not add the classes to the Customizer. Using the body_class filter adds the class to the Customizer preview, inside the iFrame, but that doesn’t allow me to target sections within the Customizer itself.
Is there a filter to add classes to the Customizer? Or do you have to use the Customizer API and conditionally unload panels based on role? That seems a rather heavy solution for my usecase.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Adding body classes to Customizer’ is closed to new replies.