Home › Forums › Backend Issues (wp-admin) › Nested custom post type forms
TL;DR: As an admin user, while creating an
Event (which is a custom post type post), I’d like to be able to easily create
EventDates (which are custom post types too) in a nested form/repeater field, to save time.
So I’m still on my quest to make
I have two custom post types,
EventDate hast an ACF relationship field to associate it to an
Event. This way each
Event has multiple dates, so if Lady Gaga decides to give two concerts, I have one
Event “Lady Gaga live” and two dates (e.g. one on friday and one on sunday) and I can have an
EventDate calendar in the frontend.
Now to my problem:
How do I convince Lady Gaga to come Currently
EventDates are handled separately in the backend, which is very repetitive and cumbersome, since for every
Event you create you have to switch to the
EventDate section afterwards and create multiple
An ideal solution from the user perspective would look like this:
1. In the WordPress Backend, click on “create Event”
2. Insert content (title, description, details etc.)
3. scrolling down to section “dates”
4. have some kind of repeater field, where each item is basically a date picker
5. after clicking on “create/update Event”, WordPress creates/updates the
EventDates with their ACF-date-field set correctly and wires them to the
This would save the backend-users a lot of clicks. I understand that this is nothing I can get out of the box from somewhere and that I have to make my hands dirty to achieve that. But currently I have no good idea how to tackle the problem, so maybe you guys have something?
First, there is a plugin that will let you do something similar to this https://wordpress.org/plugins/quick-and-easy-post-creation-for-acf-relationship-fields/ is only for ACF4 version and there is a premium version for 5.
You might want to look at how they accomplish this if you wanted to do it yourself.
this was written quite a while ago and it looks like that plugin hasn’t been developed in a long time. Is there a new solution to this?
There are currently no plugins that I am aware of the will do this.
Hi John and thanks for the reply.
This strikes me as a fairly common sense feature so I’m surprised that no solution exists. I need to do similar to the above where I have businesses with multiple locations. The locations sit inside their own custom post type but I need to be able to add them from the business custom post type.
Are there any other avenues possible here?
I once covered a way that I did events with multiple dates. https://support.advancedcustomfields.com/forums/topic/helping-planning-acf-project/
I don’t think that creating another post while creating a post is something that is required and personally it is not something that I would ever supply to a client. They must understand that the related post must exist before they can select it in a relationship field.
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
Helping others is a great way to earn karma, gain badges and help ACF development!
CPT registration is coming to ACF! We demoed the new feature during the most recent session of ACF Chat Fridays. Check out the summary for the details. https://t.co/k2KQ3WWBAz— Advanced Custom Fields (@wp_acf) March 7, 2023
© 2023 Advanced Custom Fields.