If you are you using WooCommerce, you can use the “woocommerce_before_thankyou” hook to achieve this.
In frontend you can create a custom AJAX action to upload all form data and append the WooCommerce product ID (use WC()->cart->add_to_cart()) and your own post type logic (maybe you can add this post as draft and store the post ID in SESSION or transient API to publish when user completes the order [using “woocommerce_before_thankyou” hook]).
Related Posts:
- Get post ID from wp_insert_post()
- Create page to handle form submission
- How to save contact form 7 data in Custom Post Types (CPT) [closed]
- Conditional two level dropdown filter for custom post type
- Dynamic dropdown custom post list based on dropdown selection
- Reason action hook won’t work with update_post_meta from frontend form? Alternative?
- How can I fix a slow redirect after form submit from frontend (no plugin)?
- How to embed form data within the ‘Add new post’
- Using shortcodes to parse POST request (containing the data from a front-end form)
- Linking three taxonomies with ACF
- Custom query form submission pagination
- How to add the post ID (or any other post data) to a Contact Form 7 mail?
- WordPress posts with multiple fields
- How to Submit Post Via cURL & PHP
- Send email button in custom post type backend
- How to query custom post types posts filtered by multiple custom taxonomies through a form selection
- How to retain $_POST data when submitting form to custom page
- Display users uploaded files as posts
- Post form as custom post
- Form action/link to render a plugin in WordPress front-end
- How to integrate a form (Ninja Form or Contact Form 7) with Custom Post Types?
- A form that can save/edit after first input
- How to make front end form only accept certain values
- Edit Custom Post Type on Custom Admin Page instead Post Admin
- Using POST method in meta box, no results
- Form action doesn’t work if slug isn’t same as custom post title
- 404 Error on form submission within custom post type
- show custom value from frontend form in a post (custom post type)
- Direct form to a custom page template
- How to selected value default in option list?
- Making a form for user to add new custom post with custom taxonomies and custom fields
- Submit Custom Postypes from frontend
- How to upload two input files [closed]
- Change dynamically the dropdown list value
- Why it doesn’t create a custom post type after form submitting
- How to submit the date with ajax?
- ‘Simple’ Reservation System
- Attend event form with ajax
- WordPress retrieving $post based on random key in $_POST
- Change the term based on the value of a $variable using wp_update_post in submitting a form
- Guided post type create based on category tree
- Show ajax form resuslts in page
- Advanced search form with multiple custom fields
- custom search form for custom post
- Getting Custom post category from Form
- Submitting custom post from frontend,jQuery ajax, and custom validation – can’t find proper place to insert wp_insert_post()
- Understanding the workflow of form creation plugin
- Front end page submission form does not attach custom post type
- How to create a petition like form based on custom post types?
- Front-end form submission not creating post
- Forms with multiple element types using custom post types
- Displaying database table in backend of wordpress
- Submiting custom form give error 404
- From form submission values – dynamically update CPT “has_archive” slug and custom taxonomy “rewrite” slug value
- Custom plugin contact form connecting to mailchimp API
- How to add categories to a custom post type using wp_insert_post($new_post);
- How do you get the count of posts in an archive page?
- Remove admin menu for custom taxonomy attached to custom post type
- How do I list custom taxonomy terms without the links?
- Page not found taxonomy custom post type
- how to filter by last name for custom post
- Custom comment status possible?
- Get categories for a specific post – Custom post type
- Assign Page Template Within A Custom Post Type
- WPMU: Programmatically adding CPT posts to specific blog id
- Custom post types not imported properly
- Error after deleting Custom Post Type with a function (no trash used)
- Rewrite Custom Post Type URL slug
- Posts navigation in custom post type single.php not working
- Custom Post Type | Fatal Error on register_post_type()
- How to sort custom post type posts in default order by multiple fields?
- WordPress theme options vs custom post types
- if custom posts type exists and there are posts load script
- Custom Post-to-Post with multiple parents?
- Get custom taxonomies from multiple posts
- Post image in WordPress not appearing on home page
- Displaying Posts from Custom Post Types
- Custom Post Types strange pagination problem
- Warning after create Custom post type with Roots theme
- Set featured image to archive.php
- Custom WP_Query doesn’t display all posts
- How can I use archive-{post_type}.php theme template?
- How to properly delete custom post type posts programmatically
- Query within a foreach within a query (queryception)
- How to implement a different permalink structure for custom post type?
- Custom Post Type for Shortcode Use – Prevent it display as a post (with slug)
- Query Custom Posts – Add To Selection
- Related “custom post type” using “custom taxonomy”
- How to have multiple search result pages in wordpress with taxonomy terms listed
- Change custom post taxonomy values from front-end
- Wp Query sort order from custom MetaBox
- Custom Post Types UI paragraph style
- How to manage a custom post type archive as a page?
- Displaying taxonomy icon outside archive page
- Limit number of posts under a post type?
- Why is my custom form saving with ‘autodraft’ as title and slug?
- Select Menu for Custom post Type does not save
- How to stream a linked file in WordPress
- the_post_navigation in single page with multiple taxonomies
- display related posts based on the PAGE TITLE