Support

Account

Home Forums General Issues Create a read-only field in backend but not in frontend

Solved

Create a read-only field in backend but not in frontend

  • Hello,

    How to make an ACF field that can be input on the frontend, but in the backend can only be seen for reporting (no edit capabilities)? I’ve tried $field['readonly'] = true; with acf_prepare_field but those function will disable the front and backend at once.

    Here’s the field type that I need to apply those states: text, number, select, and repeater (which include an image inside).

    Thank you.

  • 
    if (is_admin()) {
      $field['readonly'] = true;
    }
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.