Guest User

Untitled

a guest
Jul 12th, 2012
90
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $new_post = array(
  2.     'post_title'    => '',
  3.     'post_content'  => '',//$post_title,
  4.     'post_status'   => 'publish', // Choose: publish, preview, future, etc.
  5.     'post_type'     => 'name_of_custom_post_type', // Set the post type based on the IF is post_type X
  6.     'post_author' => 1
  7. );
  8. $new_post_id = wp_insert_post($new_post); // http://codex.wordpress.org/Function_Reference/wp_insert_post
  9. if($new_post_id){
  10.    
  11.     update_post_meta($new_post_id, 'ip', $ip);
  12.     update_post_meta($new_post_id, 'email', $email);
RAW Paste Data