Support › General › Custom CSS class on meta boxResolved
Is it possible to add a custom CSS class to a meta box?
Or have it auto-generate a unique CSS class or ID from the meta box ID?
I tried adding a class and a custom data-* attribute via custom attributes on a meta box but that doesn't seem to work.
There's no support for meta box CSS class. But each meta box will have a auto-generated ID. You can inspect and see it.
I see the auto-generated IDs on post type meta boxes in the admin but not on frontend forms (Frontend Submission extension). The auto-generated ID does not work on user meta boxes either in the admin or on frontend (User Profile extension).
Anh, can you confirm if this is a bug?
It's not a bug. It's different implementations by WordPress in different areas. I think I'll add an extra param for the meta box for you to add custom CSS class easier. Please wait.
Hi Ryan, I've just added class param to meta box settings, which allows you to set an unique CSS class.
@rilwis, thanks for adding this! I was about to open a feature request for it 🙂