• Hi,

    I’m using the acf/load_field filter to set fields readonly but it does not work with True/False fields.

    I set a breakpoint and verified my function is being called and $field[‘disabled’] is being set to 1, but when the page loads the field is not disabled (same behavior with $field[‘readonly’] = 1;).

    Here is my code:

    function set_cancel_order_read_only($field) {
      $field['disabled'] = 1; 
      return $field;
    }
    add_filter('acf/load_field/name=order_canceled', 'set_cancel_order_read_only');

    I tried lower and higher priorities as well but no luck. Please advise.

    Thanks,
    Brian

  • The topic ‘Can’t set True/False field disabled or readonly’ is closed to new replies.