Advertisement
Guest User

Untitled

a guest
Jan 29th, 2015
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. for ($i = 0; $i < $numberOfPosts; $i++) {
  2. global $wpdb;
  3. $wpdb->query( 'SET autocommit = 0;' );
  4. $wpdb->query( $wpdb->prepare("INSERT IGNORE INTO `".$wpdb->prefix."posts`(post_author,post_content,post_title,comment_status,ping_status,post_name,post_type) VALUES(%s,%s,%s,'closed','closed',%s,'post')", $user_ID,$newPost['post_content'],$newPost['post_title'],$newPost['post_name']));
  5. }
  6. $wpdb->query( 'COMMIT;' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement