Custom Fields
Re-Envisioned
Support Meta Box Group clone and readonly

  • Creator
    Topic
  • #26809
    DavideMelle
    Participant

    If I set a group with clone=true and readonly=true, I expect the group and its fields to be read only, instead, only fields are read only while the group itself still permits to add and remove clones.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #26810
    Long Nguyen
    Moderator

    Hi Davide,

    Thank you for reaching out.

    The group field does not support adding the setting readonly. This setting only applies to some simple fields like text, url, email, checkbox, radio, date, time, datetime which are sub-fields inside the group.

    #26811
    DavideMelle
    Participant

    I have some posts that once in a state needs to have some values read only, and some of them are cloned groups. Is there a way to show a readonly group or should I keep using readonly and hide the add and remove buttons with some js?

    #26817
    Long Nguyen
    Moderator

    Hi,

    For some flexible cases, I think you can try to use the extension MB Conditional Logic. Example, you can show/hide a field base on a checkbox.
    https://docs.metabox.io/extensions/meta-box-conditional-logic/

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.