This guide provides step-by-step instructions on how to create an edit form for a custom post type in WordPress using the Advanced Custom Fields (ACF) plugin. Following these instructions will allow users to easily edit and update their custom post types with a 100% custom user interface.
Our CPT: Video
For the sake of this tutorial, we created an ACF custom post type called “Video” and we added two custom fields: “Link” and “Author”. However, this tutorial is relevant to any Custom Post Type added to your website.
Custom Fields
“Link” stores the url of the video while “Author” stores the creator of the video post on our website. The Author field is only available in Frontend Admin (Free or Pro)
As you can see, this field group is assigned to the Video custom post type.
Now we can edit Videos from the WordPress Admin Panel. However, we would like to edit Videos from the front end of your site using a custom UI.
To do this, hover over Frontend Admin and click Forms.
Creating the form
Then click “Add New”
We will label this form “Edit Video Form”
Set the form type to “Edit Post Form”
Now click Publish
Configure form fields
By default, the standard post fields are shown. Edit or Delete these according to your needs.
To add ACF fields to the form, click Add Field
And change the field type to “ACF Fields”
Under “Fields or Field Groups”, choose the fields you would like to show.
You can add multiple instances of the “ACF fields” in order to arrange and position the fields in any way you want.
Post to Edit field
The Post to Edit field allows you to select any post and load that post’s data into the form in order to edit it. This is not limited to just posts, you can use this for custom post types as well.
Under “Filter Post Type” remove Post and select Video
Don’t forget to change the label and placeholder from “Post” to “Video”
Click “Save Changes”
Click “View Form”
Now you have a frontend Edit Video Form.