Support

Account

Home Forums Backend Issues (wp-admin) Nested custom post type forms

Solving

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 Events and EventDates work.

    I have two custom post types, Event and EventDates. Each 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 Events and 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 EventDates.

    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 Event

    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?

    -CS

  • 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.

  • Hi John,

    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?

    Thanks

    Daniel

  • 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?

    Thanks

    Daniel

  • 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.

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Nested custom post type forms’ is closed to new replies.