More of a general question than a bug. I’m using acf_form on my site to build a user submitted form. I’m grabbing the field groups with the following code:
$field_group = get_page_by_title( 'Opportunities', null, 'acf-field-group' );
$args = array(
'post_id' => 'new',
'field_groups' => array( $field_group->ID ),
'post_title' => true,
'form_attributes' => array(
'id' => 'post',
'class' => '',
'action' => '',
'method' => 'post',
'enctype' => 'multipart/form-data',
),
Along with that I am using the new acf-json for my staging site to keep things consistent without having to pull from the database every time. Problem with that is now there is no database record of the ACF Field, so the above code doesn’t grab the field group ID. Any ideas on how to solve this without importing the json fields into the staging site? Thanks!
Have you ever been able to solve this? I’m also have this problem.
Thanks
Daniele
I’m also coming against this same issue. I’ve tried passing the group ‘slug’ (group_5b44c8acacd2c) instead of the post ID but that doesn’t seem to work. Is there any way to call an acf_form without syncing the fields on my live site?
Never mind. This totally works with the key/slug and pulls the form directly from the json. I was using a shortcode which was wrapping my slug in intval() thus returning 0.