Advanced Post Addon and ACF Fields

I’ve been experiementing with the Advanced Post Creation addon - which works well - but I keep coming up against the same issue.

Data posted to ACF fields does not show up on the front end of the post.

If the post is viewed in the back-end, the ACF data fields are populated with the GF form data as expected. However, in order to make this data visible on the front end, it is necessary to re-save the post. Only then does the data show up.

I have experiemented with this a lot. I should also add that I have tried using other form submission post creation methods and teh same issue exists.

I should also add that one of the fields I use in the tests is the ACF date field. Could it be that the way date data is stored is too complex (in some way) for it to work with a form post submission?

Many thanks for any insights.

Antar

You need to make sure your post Status on the Post Creation Feed is set to Published. Otherwise, you will have to visit the post and save it before it will be visible on the front-end.

I did just test this locally with a ACF Datepicker field fed from a Date field in Gravity Forms. I set the Status to published and the post was immediately visible with the date field (since it’s written to post_meta when the Post Creation Feed runs).

Jim -

Can you try viewing the output in a post loop - not just the post itself.

Thanks

Antar

The display process for wp_post and wp_postmeta are identical in the single post or the post loop. All you have to verify is: is the data written to the post meta after the form is processed and is the post published? That’s what makes it visible to the loop.

If you can see it in the single post but not the output loop, you need to shift to your theme at that point.

But, yes, just confirmed, it works in Archive Loop as well.

Thanks for checking.

I see the ACF output on the post page - but not on the post archive page. The rest of the post appears as normal - just not the ACF field data. I have to manually save (“Update button”) the post to make the data appear.

I have replicated this issue on several different sites. Something is wrong somewhere.

Jim -

Take a look at this screenshot. It illustrates the problem.

Screenshot

The page shows two different post lists of various dates. The list on the right is correct. The list on the left is not. The two items at the top are not showing their respective ACF fields: date and location. In order to make this data appear I would need to open each post in the admin and re-save them.

Both list are ordered by the ACF date field. The order is incorrect. In order to reset the data I would (again) need to manually re-save the first two entries.

Jim -

I’ve done some more tests and discovered the reason for one of the issues.

The post order is wrong because Gravity Forms saves the date in the folloing format:

2020-02-21

When a post is manually re-saved, WP changes this to:

20200221

This works. When I remove the hyphens in phpMyAdmin and reload the post list, the eroneous posts are ordered correctly. However the missing ACF data is still not visible.

Screenshot

That means we’re writing the content when we’re supposed to and the issue is you’re not matching the format to the style you require.

Remember, post meta has no ‘type’, it’s just a gigantic text block in the database. If you need it written in a specific format, you need to save it in that format with your DatePicker in Gravity Forms and have that match with your ACF field (which has both display and type format). If you want it within a specific format, you need to use the gform_advancedpostcreation_post_after_creation filter to change it before it writes to your post meta. See this example:

1 Like

I am having the same problem, but not with dates. I have 3 text areas and one URL field in 1 group that contains these 4 ACF fields. When I set up the post creation feed, I have all fields mapped properly. All field formats match as well.

After testing the form, the post is created, but the data in the 4 fields that are part of an ACF group do not show on the front end of the post until either the draft is resaved or a published post is updated.

Could it be that referencing grouped ACFs is the problem? I’m going to try creating individual ACFs and test the form again. If that’s the case, it would definitely be a good idea to both add this workaround/issue to the documentation and then solve for it. Will let you know if I have success or not.

Nope, Moving away from grouped fields to singles was not the issue. Something isn’t right with the addon.

This post essentially addresses this issue. http://bionicteaching.com/wp-content/uploads/2019/03/Screen-Shot-2019-03-30-at-9.42.54-AM.png

Hi @stephylewis I recommend opening a support ticket for this issue if you continue to have trouble. Thank you.

https://www.gravityforms.com/open-support-ticket/

lol. Yeah, you’re right. :slight_smile: