Saving user-submitted content in custom post types
When visitors click on the Submit Review button on the form created in the previous recipe, the target of the form is set to be the page that is hosting the submission form. Since this page is not capable of handling form data, we must implement an action hook that intercepts this post data and sends it to a processing function that we will define before returning visitors to the submission form page.
You should be running the final version of the Chapter 4 - Book Reviews plugin created in Chapter 4, The Power of Custom Post Types, and should have already followed the Creating a client-side content submission form recipe. Alternatively, you can get the files from the book's GitHub page (
ch7/ch7-book-review-user-submission/ch7-book-review-user-submission-v1.php) and rename