Home › Forums › General Issues › Editing an ACF field and submitting in $_POST › Reply To: Editing an ACF field and submitting in $_POST
You should still be able to use acf_form()
( similar to how you would a front-end from ) tell it not to display the form just the fields:
https://www.advancedcustomfields.com/resources/create-a-front-end-form/
Even though it’s not on the front-end it’s still a way to get a Field Group into a custom form:
acf_form( array(
'form' => false,
'field_groups' => array( 'acfieldgroupkeyhere' ),
) );
You would still need to call acf_form_head()
to get the neat functionality and styles ACF provides. The biggest problem with this is that the fields are POSTed into an array $_POST[‘acf’] and keyed by the Field IDs instead of the field names – you can either either keep track of the field IDs in your code and what ID gets saved where or you can loop through the ACF fields array by Key to get the name using get_field_object( $key )
.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.