Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for ($i = 0; $i < $numberOfPosts; $i++) {
- global $wpdb;
- $wpdb->query( 'SET autocommit = 0;' );
- $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']));
- }
- $wpdb->query( 'COMMIT;' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement