Home › Forums › Feature Requests › Feature Request: Hidden / Disabled Field Type › Reply To: Feature Request: Hidden / Disabled Field Type
Hi,
I have found a solution to hide easily a field :
add_filter( 'acf/load_field/name=inscription_classe', [ $this, 'hide_field' ] );
public function hide_field( $field ) {
$field['conditional_logic'] = 1;
return $field;
}
The only problem is : if the field is manually posted with the form (by dom modification or http request modification), the field is saved to the db.
Not terrible because i don’t want form submitter can change this field. I tried readonly
disabled
no effect on db saving.
Always no solution to hide completely a field without the possibility to submit it ?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.