Custom Fields
Re-Envisioned
Support Meta Box Conditional Logic Show or Hide Fields Based On Role

  • Creator
    Topic
  • #30543
    Resolved Martin
    Participant

    Hi, I have a need to be able to show or hide certain fields based on user role.

    My specific scenario is that I have a Custom Field form which has dates and checkboxes. I want admins to be able to use the date fields to enter dates and a different role to be able to edit the checkboxes.

    Admin will access the form via the Dashboard against a CPT. The other roles will access it via a view in the frontend.

    So I don't mind how the fields are made to show or not show. It could be via the view (ie show the dates as their values and the checkboxes from the forms) but I can't see a way to do it there. It could be using Conditional Logic but that only seems to be for inclusion based on other form values. The Include/Exclude options have code for user role but this applies to the whole form rather than individual fields (that would be great if we had that level of feature at a field scope).

    Any suggestions?

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

    Hi Martin,

    The extension MB Conditional Logic does not support show/hide a field based on user role. You can use the extension MB Include Exclude to do that and separate fields for other meta boxes.

    #30560
    Martin
    Participant

    As far as I can see from the docs you set the Include Exclude at the whole meta box form level rather than the individual field level. I need that functionality at the field level if that's possible.

    #30573
    Long Nguyen
    Moderator

    Hi,

    Thanks for your feedback. I'm going to inform the developer team to consider adding it to the to-do list for the future development of the plugin.

    #30589
    Martin
    Participant

    Cool. Thanks. I'll split my fields out to 2 custom field groups for now so I can control them separately that way.

    #30622
    justdoit123
    Participant

    please update, I also need that functionality at the field level if that's possible.

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