Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # plugins/cforms-custom/my-functions.php
- function my_cforms_filter($POSTdata) {
- if ( isset($POSTdata['sendbutton3']) && is_array($POSTdata)) {
- $title = $POSTdata['cf3_field_4'];
- // Create post object
- $my_post = array(
- 'post_title' => $title,
- 'post_content' => '',
- 'post_status' => 'pending',
- 'post_author' => 1,
- 'post_category' => array( 6 ),
- 'post_type' => 'post',
- 'comment_status' => 'closed'
- );
- // Insert the post into the database
- $post_id = wp_insert_post( $my_post );
- add_post_meta( $post_id, 'qa_email', $POSTdata['cf3_field_3']);
- }
- return $POSTdata;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement