0
votes
0answers
7 views

wp_insert_post another database with custom field

wp_insert_post with the command you want to transfer the contents to another database, I use the following command <?php require('wp-config.php'); $conn = mysql_connect($dbHost, $dbUser, ...
0
votes
3answers
124 views

How do I insert a post with custom post type and relate it to a custom taxonomy?

I'm trying to figure out how to insert a new post. I have a custom post-type (course) that is related to a custom taxonomy (categorycourses). I've managed to insert a post with custom post type ...
0
votes
1answer
101 views

create parent post using wp_insert_post

how can i create php function where i can create a post in one custom post type also create a child post type, i have already create a parent post type, i.e post type "a = car" post type "b = user" ...
1
vote
1answer
182 views

Creating a post from data returned from HTML form

I am trying to write a WordPress plugin and I have hit a bump. The Background: I have some data in a mySQL DB that I am using (each row has a unique ID and some other information I have added). I am ...
0
votes
1answer
657 views

post category in wp_insert_post

I'm building a wordpress theme where people can submit posts using wp_insert_post. The code below adds the post title but does not add the category specified by the user. Instead it puts it in ...
0
votes
1answer
149 views

Insert new post for each user infinite loop error

I wrote this little function to automatically create a post for every user of the blog but it creates an infinite loop (I disabled it to stop it creating new posts). I'm not very skilled in php, I ...
1
vote
0answers
175 views

Posts added with wp_insert_post are moved to trash automatically

I've got a script that loops through some data and automatically creates some posts. foreach($data['title'] as $title) { $my_post = array( 'post_title' => $title, 'post_content' ...
1
vote
1answer
502 views

duplicate posts when trying to update a post using the wp_insert_post.

On an empty wordpress database, I insert one sample post using the wp_insert_post. Since it's an empty database, the first post I add ends up with id 1. And I check that in the wp_posts, everything ...
3
votes
1answer
745 views

Create posts on user registration

How can I create let say 3 posts after the user finish the registration ? The ideal outcome would be to create 3 posts using the user as the author of the posts and with some pre-defined values. ...
1
vote
1answer
168 views

post_content sanitization / transformation process

What kind of transformation does the post_content go thru when wp_insert_post inserts a post_content into wp_posts programmatically? I'd like to be aware of this before I process 50000 recs into ...
0
votes
1answer
222 views

wp_insert_post - duration

i try to import a custom DB to the WP DB with about 2000 rows (custom post type). the problem is that the insert by wp_insert_post takes about a second per insert. Is this normal ? Is there a ...
0
votes
3answers
3k views

Prevent duplicate posts in wp_insert_post using custom fields

My source links are something linke this : http://sample.com/entertainment/default.aspx?tabid=2305&conid=102950 http://sample.com/entertainment/default.aspx?tabid=2418&conid=104330 ...
0
votes
3answers
730 views

How to prevent duplicate posts with wp_insert_post on single.php?

I'm getting a really strange bug (WP 3.1.3). My goal is to have users create a new post simply by landing on a single post. In order to make that happen, I have the following code in my single.php: ...