I would like to allow my subscribers to post classifieds, which are nothing but a custom post type with a few metas for the price, etc. (The existing classifieds plugins I have tried are way too complex for my needs.) I would like to know if the following makes sense.
-
I define a [classifieds-form] shortcode displaying the form and I create a page (ie., a “page” post in the admin section) calling it.
-
The content of the form is POST’ed to another page which calls the [handle-classified] shortcode, which checks if the user is logged in, parses the $_POST data, and inserts the custom post (with a ‘pending’ status, until an admin validates it).
Does this sound reasonable to you? Or would you recommend a more “standard” way of doing this?
Thanks a lot!
Alway send submissions to the page the form is displayed. In your shortcode callback you can then display proper error or success messages.
Sample:
Make sure you don’t use a reserved variable or WordPress will drop the content silently.