Skip to content

Let Visitors Post ACF Listings With Gravity Forms (Classifieds Example)

Use Gravity Forms Advanced Post Creation to turn submissions into ACF posts, and fix the ACF checkbox, image and field reference problems with one snippet.

Chris Eggleston 3 min read

To let visitors post ACF listings with Gravity Forms, map your form to an ACF post type with the Advanced Post Creation add-on, then add a short snippet that saves the mapped fields through ACF. Advanced Post Creation creates the post, the featured image and the category, but it saves custom fields as plain post meta. ACF can’t read some of those values: checkbox choices show up unchecked, and approving the post in the editor deletes them. The snippet saves each mapped field the way ACF expects, so the editor, get_field() and GenerateBlocks all show the right values.

This is lesson 3 of the ACF and Gravity Forms series. Lesson 1 sent a contact form to the email in a team member’s ACF profile, and lesson 2 filled a form’s choices and prices from ACF. This time it goes the other way: the form writes to ACF.

What We’re Building

A neighborhood classifieds board. Anyone can fill in a Post a Listing form with a title, price, condition, location, pickup and delivery options and photos. Each submission becomes a pending Listing post with ACF fields. Once you approve it, it shows up on the Classifieds page, built with a GenerateBlocks query loop:

Classifieds page with five listing cards showing a photo, price, title, condition and location
Every card comes from the listing’s ACF fields and featured image.

Each listing page shows the description, any extra photos, the details from ACF and a Contact the seller button:

Listing page for a walnut desk with a details box showing Price $240, Condition Like new, Location Gilbert AZ, Pickup and delivery Pickup, Can ship, and a Contact the seller button
The details box reads the ACF fields. The seller’s email is never shown.

The button opens a form that emails the seller at the address they gave, using the snippet from lesson 1. Buyers never see that address.

This part is for Free account members.

Unlock with Free account

Things to Know

  • Advanced Post Creation runs in the background. Posts are created right after the submission through WordPress’s background processing. If listings never appear, check Tools → Site Health for loopback or WP-Cron problems.
  • Choice values have to match. If the form sends Pickup and ACF expects pickup, the box stays unchecked even with the snippet.
  • Want a fuller classifieds form? The Classified Ad Form template adds posting types, sizes, extra images and options to show or hide contact details.
  • Want to send sellers to their listing? See how to redirect to the post Advanced Post Creation made. With Pending status, only logged-in editors can see it until you publish.

Frequently Asked Questions

Does Gravity Forms Advanced Post Creation work with ACF?

Partly. It saves custom fields as plain post meta, which is fine for text and number fields. ACF checkbox, multi-select, image and file fields need a different format and ACF's field references, so they show up empty until a snippet saves them through ACF.

Why are my ACF checkboxes empty after Advanced Post Creation creates a post?

Advanced Post Creation saves the checked choices as text like "pickup, shipping", and ACF expects a list of choices, so nothing shows as checked. If you then update the post, ACF saves the empty checkboxes and the choices are lost. The snippet in this tutorial saves them as a list.

Can Advanced Post Creation fill an ACF image field?

Not on its own, because it saves the file URL and ACF image fields expect an attachment ID. Map the File Upload field to the ACF field name and the snippet will save the attachment ID instead. For the main photo, the Featured Image setting is often simpler.

Do I need ACF Pro?

No. Post types, taxonomies, checkbox, select and image fields are all in the free version. The snippet also handles ACF Pro gallery fields, but not repeaters.

Can sellers edit their listing later?

Advanced Post Creation can let logged-in authors edit the posts they created, but this snippet only runs when a post is created. Editing listings is covered in a later lesson in this series.

Need More Help?

If you still need help, use the chat or leave a comment below and we’ll get back to you.

Comments

Ask a question or leave a comment

Your email is never shown. For help with a specific form, share what you expected and what happened instead.