Custom Fields
Re-Envisioned
Support General Custom CSS class on meta box

This topic contains 6 replies, has 3 voices, and was last updated by  phil 1 month, 1 week ago.

  • Creator
    Topic
  • #15372
    Resolved
    Ryan Lauritsen
    Participant

    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.

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • #15382

    Anh Tran
    Keymaster

    Hi Ryan,

    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.

    #15420

    Ryan Lauritsen
    Participant

    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).

    #16049

    Ryan Lauritsen
    Participant

    Anh, can you confirm if this is a bug?

    #16051

    Anh Tran
    Keymaster

    Hi Ryan,

    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.

    #16130

    Anh Tran
    Keymaster

    Hi Ryan, I’ve just added class param to meta box settings, which allows you to set an unique CSS class.

    #16131

    phil
    Participant

    @rilwis, thanks for adding this! I was about to open a feature request for it 🙂

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.