Hi, I’m trying to set a text field to the post title for an ACF field group that’s being used as a frontend form to create new posts (to a custom post type) when users fill it out. The field group itself has a lot of conditional fields that show/hide depending on what’s selected (so it’s somewhat lengthy on the backend, just not on the frontend for users) which is why I’m trying to avoid just creating the field group in php manually (plus I’m bad at it). However I don’t see a way to set a user-entered text field to be saved as the new post’s title?
For example in the field group I have the image upload field with the field name saved as _thumbnail_id and this saves the user uploaded image as the featured thumbnail for the post. Is there a simple way to replicate that for the post title?
The form itself is in a custom page template specifically for this use case, so this is the code I have for making the form appear on that page:
Any help appreciated. I imagine there has to be some way to set a field code to save as the post title? I’m probably over complicating it! But most answers I’ve found are from 8+ years ago and involve registering the field group manually.
Thank you! I apparently misread that documentation multiple times, first thinking it needed to go in the function for the field group (and not in the form on the template) and then putting it inside the new post array instead of the form array 😅.
Managed to get it working though, thanks for pointing out the obvious!
Viewing 3 posts - 1 through 3 (of 3 total)
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