Support

Account

Home Forums General Issues Field with some privilege

Helping

Field with some privilege

  • Hi
    I want add a text or numeric field to post type with this privilege:
    if User is admin then field is active
    if User is contributor then field is disable (or readonly).
    How can I do for this?

  • Hi @aminkh17

    Currently, there is no way to customize the attributes (disabled / readonly) for a custom field input.

    However, you could write a PHP funciton and hook into the acf/input/admin_head action to look at the current logged in user, and depending on the role, you could render some javascript which would add the attribute on document.ready

    Hope that helps.

    Thanks
    E

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Field with some privilege’ is closed to new replies.