Creating a client-side content submission form
The first step toward giving visitors the ability to contribute to a website is to present a form that they can use to submit new content. This recipe shows how to create a shortcode that can easily be inserted on any WordPress page to render a simple form.
You should be running the final version of the Chapter 4 - Book Reviews plugin created in Chapter 4, The Power of Custom Post Types. Alternatively, you can download the final resulting code (
ch4/ch4-book-reviews/ch4-book-reviews-v12.php) from the book's GitHub page.
How to do it...
Follow these steps to create a new shortcode that displays a simple form:
- Navigate to the WordPress
pluginsdirectory of your development installation.
- Create a new directory called
ch7-book-review-user-submissionand open it.
- Create a text file called
- Open the new file in a code editor and add an appropriate header at...