Hi psperkins,
I needed to do the same thing and could only find a solution where i changed the core files of the plugin (not advised, but I had no choice).
In the ‘Form to Post’ plugin folder there is a file called ‘FormToPost_Plugin.php’ .. on line 142 there is some code as followed:
$post = array(
'post_status' => 'publish',
'post_type' => 'post',
'post_category' => array(0)
);
Change ”post_type’ => ‘post’,’ to whatever you need… worked for me!
Yeah that was what I ended up doing as well. Was hoping for something more…#AHEM…elegant I guess.
Thanks for your input though!
This is a mysterious bug. The code you cite is just setting default values for post status, type & category in case they are not set in the form. These are overwritten a little further down in the code:
// Add in any additional fields
foreach ($simpleFields as $field) {
if (isset($cf7->posted_data[$field])) {
$post[$field] = stripslashes($cf7->posted_data[$field]);
}
}
(where $simpleFields includes post_status, etc.)
Since I cannot reproduce this behavior, I would be interested if someone having this issue would inject a call to write out the contents of $cf7->posted_data to a log file to see if you are in fact getting post_status.
You could do this by adding this line:
error_log('Form Submission: ' . print_r($cf7, true));
and create a wp-content/plugins/contact-form-7-to-database-extension/php.ini file with an line that points to a where a log files should be written:
error_log=/path/to/error_log.txt
Hi,
Here is a great tutorial on WordPress custom post type add form in frontend http://unitedwebsoft.in/blog/wordpress-custom-post-type-add-form-in-frontend-for-users/.
also added to custom taxonomy with image upload field.