Hook your form processing code to an action that runs before the page is rendered and no redirect will be necessary.
function wpd_check_submission(){
if( isset( $_POST['start'] ) ) {
// do your post insertion here
}
}
add_action( 'init', 'wpd_check_submission' );
Related Posts:
- How to embed form data within the ‘Add new post’
- How to Submit Post Via cURL & PHP
- How to integrate a form (Ninja Form or Contact Form 7) with Custom Post Types?
- Some posts from custom post type to subdomains
- Making a form for user to add new custom post with custom taxonomies and custom fields
- redirect after submiting post for review
- WordPress retrieving $post based on random key in $_POST
- Front-end form submission not creating post
- Resolve a custom post type name vs. page permalink conflict (same slug)
- Get the ID of the latest post
- Change permalinks for posts but not for custom post types
- Front end post editing using a form
- Set posts of a custom post type to be private by default?
- flush_rewrite_rules on save_post Does Not Work on First Post Save
- How make get_next_post() return first post when viewing last one
- modify all posts of a category to “no comments allowed”
- Getting a div content of a post in wordpress?
- How can I add dropdown widget/box to admin post page?
- Custom permalinks – post type – hierarchical taxonomy’s
- How do I redirect all 404 errors of a specific post type to another URL?
- Loading post content in FancyBox
- How to show related posts by category or custom post type?
- ascending order custom post type
- get_page_by_title() not returning anything [closed]
- Phantom 302 status code when sending a POST requests on pages
- Linking three taxonomies with ACF
- get_queried_object error How to show post count by month in the taxonomy page
- How to create A-Z index listing for custom post types?
- Custom Taxonomy – Tags Metabox is showing instead of Categories
- How to set up htaccess to redirect a particular post type or subdirectory to HTTPS?
- How to post twitter like updates on wordpress
- WordPress posts with multiple fields
- How Can I Set the Post Author of a Post I Just Created With PHP?
- WordPress Orderby Numeric Value Not Working
- Deleting Custom Post type data using mySQL command
- Notice: Undefined index: suppress_filters
- Storing posts from query and accessing later via AJAX call
- If post has custom field then display css-class
- Missing Posts in Custom Taxonomy List
- How can i add thumbnails images to particular post (using code not admin pannel) in wordpress
- Showing posts from different categories and from custom post type
- Form action/link to render a plugin in WordPress front-end
- custom post type category count shortcode
- Add post location with mile radius allowing search
- Get the category from custom post type
- Is it possible to store Custom Post Type data in separate set of tables and still have wp_post class functionality?
- Custom Post Slug same as Parents Category Slug
- How to get all tags of a custom post type by id
- How to define which register_post_status goes to which register_post_type?
- Create new custom post and post category of same name
- Load Next WordPress Posts With AJAX?
- If there is only one post (show elements) else (show other elements)
- Creating separate feeds for custom post types
- Custom post type menu
- Modify Posts from Custom_Post_Type within the plugin
- How do I edit the WordPress post.php file?
- Posts are not rendering perfectly [closed]
- How I can made a custom post type to page templates?
- Easy reading or transfer of data from posts?
- List all posts in taxonomy term
- how to redirect to a custom post template
- Post/Custom Post Type URL Access
- Submit Custom Postypes from frontend
- Adding /blog in front of single posts (only)
- Invalid content when I try to import custom post type from the old template wordpress
- list articles in admin showing nested categories or slugs?
- How to upload two input files [closed]
- Search CPT by tag ids
- Post template with breadcrumb needs to show page navigated from
- Define multiple prefixes for custom post type
- Publishing failed. The response is not a valid JSON response
- add all blog posts to folder
- ‘Simple’ Reservation System
- Post Click Redirect to Custom URL instead of Single Post Page
- Show posts from WP Custom Post Type selected from a field in a metabox
- order custom post type posts by custom date
- How to show posts of the same category on a page?
- custom post type to post association in wordpress
- Need to display author’s email id in the “Edit post” field in wp dashboard. How do I do this?
- How to get all posts related to a taxonomy?
- Redirect users in first login to a dynamic link
- call a function when insert and update a custom post type
- Work and Display a Custom Post Type as a normal Post
- Most efficient way of showing children posts?
- Custom post type with two templates
- One Post with different content, depending on a Page
- Custom Post Type
- Popup panel is only displaying 1 entry ignoring all others
- Custom Post Status & Taxonomies
- How to display data with pagaination on backend?
- Edit post meta direct from post.php?
- How to Arrange Support => Thumbnail
- Redirect preview single post link to a page
- Linking custom taxonomies and posts
- Post being scheduled that shouldnt be schedulded
- Get custom post type parent category
- How to delete unnecessary custom post types in the UI
- show the most recent date of all posts to display on front end
- Error 403 when posting comments to a custom post type from a different page
- Two pagination in one page without AJAX