I have added a taxonomy field to my entity via the module install file and I need to disable this field i.e. I need it to look the same as a normal field in the form that has the 'disabled' => TRUE, settings.
What do I have to type in the instance creation code: field_create_instance($instance); to make this work? and where should I type it? i.e. inside the widget code? or just as a normal parameter of the instance array?
You can’t do it using
field_create_instanceas that function/system has no concept of adisabledattribute on the input element.You’ll need to use a
hook_form_alterto add adisabledattribute to the elements you require.