Support

Account

Home Forums Backend Issues (wp-admin) Repeater to manage a custom post type Reply To: Repeater to manage a custom post type

  • I do, in a way, understand what you are doing. I have a setup where I have a repeater field that lets the client add child posts in the same post type. My setup is different.

    On save I have an acf/save_post action that looks at the repeater and compares it with the posts to child posts to see
    1) What has been added
    2) What has been deleted
    and then I add or delete child posts as needed.

    In my case I do not have an ID. the child posts are based on start and end date. If any start/end date combination is new I create a new post and for every existing child post if the start/end date combination does not exist then I delete that post.

    In my case I store all the needed information in the child posts and not in the repeater.

    Have you thought about having a post object field in the child post that points back to the parent instead of a value in the parent that is pointing to the child.