I try to show a front end form with acf_form() but I need to hide some speciffic fields.
<?php $options = array( 'fields' => array( array( 'key' => 'field_57bd818860053' ) ), 'submit_value' => 'Crear anuncio' ); acf_form($options); ?>
How do I hide a field?
You can’t hide a field, what you need to do is list all the fields that you want to show in the ‘fields’ argument.
where can I see an example of this? I see in the documentation https://www.advancedcustomfields.com/resources/acf_form/#overview but I don’t know how to list the fields I want to show in the array.
There are no example of this. Your OP has what you need, you simply need to list every field that you want to include in the form in the
Maybe you mean where to you get the fields keys from. Go into the page to edit the field group, under page options check the “show field keys” option. Copy the field keys from there.
This is my code, following your instructions, but I don’t get it to work. All fields are shown.
<?php $options = array( 'fields' => array( 'field_57624bf5aaf38', 'field_57bd81ca68524', 'field_57bd8deef084b' ), 'submit_value' => 'Crear anuncio' ); acf_form($options); ?>
Do I need any other elements in the array? Any clue?
Thanks a lot!
What version of ACF are you using?
Im using 4.4.8 ACF free version
ACF 4 does not include the
fields option. The correct documentation for
acf_form() in ACF 4 is here https://www.advancedcustomfields.com/resources/acf_form/?version=4.
You cannot do what you are trying to do with ACF4.
Ok, I see.
So, should I go PRO in order to get it done?
If this is really something you need then yes, the only way you’ll do it is if you switch to ACF5.
As my plugin is up to date I conclude that ACF5 is PRO version isnt it?
Thanks a lot!
Yes, ACF5 is only available in the Pro version at this time.
You must be logged in to reply to this topic.
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 are looking for a talented designer to help reimagine the ACF website and identity. Is this you?— Advanced Custom Fields (@wp_acf) September 27, 2019
❤️ Love for GUI apps & tools.
🦄 Skills in modern web & identity design.
🥳 Fun to work with.
You know what to do.
© 2019 Advanced Custom Fields. Subscribe