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?
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.
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!
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.
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!
© 2022 Advanced Custom Fields.