• Resolved jons7

    (@jons7)


    Hi, I was wondering if I can use one of the existing filters to create a new child post where the form post is the parent?

    So the post hierarchy would be…

    • 1. Form on a custom post type post
    • 1.1 Completed form 1
    • 1.2 Completed form 2 etc

    Thanks.

    • This topic was modified 7 years, 7 months ago by jons7.
    • This topic was modified 7 years, 7 months ago by jons7.
Viewing 1 replies (of 1 total)
  • Plugin Author Aurovrata Venet

    (@aurovrata)

    HI @jons7

    I don’t really understand what you mean by child post.

    are you referring to the the concept of parent page? You can assign a parent page to a page. However, this is not possible with std posts.

    You can,

    1. map your form to page, and assign the last submitted form page as its parent.
    2. map your form to a post/cusotm post and create your own parent-child link using a meta field, by creating a cusotm field to store the parent post ID.

    In both case you would need to store your last mapped submission post ID in an option field.

    You can use the action ‘cf7_2_post_form_mapped_to_{$post_type}’ (see the dcoumentation for more details) fired at the end of the post saving process afer each submission to get the post ID to updaet your option field, but also to save the parent meta field ID with last submitted ID.

    I hope that answers your question.

Viewing 1 replies (of 1 total)
  • The topic ‘How to publish as child of form post’ is closed to new replies.