Hello @phpnukes
You can apply the hook and get form data that use that to create a new post.
add_action('wpcf7_before_send_mail','insert_new_post',10,3);
function insert_new_post( $contact_form, $abort, $submission ) {
if( $contact_form->id() == 'YOUR_FORM_ID' ) {
// Get Submitted post data.
$data = $submission->get_posted_data();
$name = $data[ 'your-name' ];
//Post Insert Code
}
}
See Accessing user input data
if php ain’t your thing, search WordPress repository for ” CF7 ” there is a plugin that does what you’re asking for
Jainil
Thank you for your time, response and input here.
Love php need to do a bit of a catch up. It’s been a very long time since I played with coding.
Been using WordPress since 1996 clearly getting into lazy habits.
Looking at the code snippet this goes into the post function file?
With upgrades in the plug-in or WordPress would be affected?
This is why plug-ins are much easier than having to update the code in future upgrades.
Thank you
Hello @phpnukes
Yes, this code needs to add to the theme’s functions.php file.
With upgrades in the plug-in or WordPress would be affected?
>>> This depends on your code. The CF7 hook and function will be the same.