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.