i want to streamline the visual output of the embed privacy content. For instance i need to add a certain class to the checkbox input (currently it is “embed-privacy-input”). I took a look into your code and noticed all the classes are hardcoded. Can you please apply_filter here? Thank you!
because the theme has already a complex css rule for certain plugins and therefore i would like to use one of these selectors like “ct-checkbox” for your plugin:
Okay, I understand your request, why you want this. However, this is not how CSS should work. Different elements should have different classes. If you add another class, it could have unintended side-effects, especially when CSS targeting theses classes suddenly changes by their original package.
Additionally, having multiple selectors with the same applied CSS is exactly how CSS should work. It doesn’t make the selector more complex, just larger.
Thus, I have no intention to implement such a filter. If you want, you can use the filter embed_privacy_markup to search for the original class of the input field and extend it (you should not entirely replace it as this may break functionality of Embed Privacy, which may rely on the availability of this class).
thank you – i really appreciate your opinion and the time you spend into this ticket. but i do not agree at all. there are many plugins out there allowing to change / add css classes. but glad there is an outer wrapper filter to change the markup to my needs. that is absolutely fine for me. thank you!
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘add filter to modify html classes’ is closed to new replies.