Advertisement
Mihalytch

Untitled

Dec 7th, 2013
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.87 KB | None | 0 0
  1. # plugins/cforms-custom/my-functions.php
  2.  
  3. function my_cforms_filter($POSTdata) {
  4.         if ( isset($POSTdata['sendbutton3']) && is_array($POSTdata)) {
  5.  
  6.                 $title = $POSTdata['cf3_field_4'];
  7.                 // Create post object
  8.                 $my_post = array(
  9.                         'post_title' => $title,
  10.                        'post_content' => '',
  11.                         'post_status' => 'pending',
  12.                         'post_author' => 1,
  13.                         'post_category' => array( 6 ),
  14.                         'post_type' => 'post',
  15.                         'comment_status' => 'closed'
  16.                 );
  17.  
  18.                 // Insert the post into the database
  19.                 $post_id = wp_insert_post( $my_post );
  20.                 add_post_meta( $post_id, 'qa_email', $POSTdata['cf3_field_3']);
  21.         }
  22.         return $POSTdata;
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement