The wp-insert-post tag has no wiki summary.
4
votes
3answers
9k views
How do I set a featured image (thumbnail) by image URL when using wp_insert_post()?
While looking through the function reference entry for wp_insert_post(), I noticed that there's no parameter in the array it requires which will allow me to set the 'Featured Image' for a post, ...
1
vote
1answer
304 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 ...
0
votes
3answers
2k 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
...
3
votes
1answer
1k views
When and Where to use wp_insert_post()
I'm building a function that creates a group of pages with a common parent ID.
If I run wp_insert_post() on a parent ID twice, does the function create the pages twice while altering the slugs? Or am ...
2
votes
1answer
421 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. ...
0
votes
1answer
389 views
preventing the duplicate wp_insert_post
Right of the bat, let me say that this is not the same question as I posted the other day ( that is duplicate posts when trying to update a post using the wp_insert_post. ) Cause, in that question, ...
0
votes
3answers
357 views
Trying to save custom post type from frontend partially working
I've created the following custom post type (lugares means places) with a custom taxonomy of tacos and it works fine form the backend:
/**
* Custom post-type lugares
**/
add_action('init', ...
0
votes
2answers
875 views
how can I set the post author of a post I just created with php?
I'm using php to dynamically create a custom post, and I need the author to be someone other than the logged in user. I found this ...
4
votes
1answer
514 views
wp_insert_post incorrectly escapes HTML comments when they include tags
I'm working on writing a script to import data from a custom CMS into Wordpress. As part of this, I need to import the post content exactly, without modifying anything. However, some of the posts ...
0
votes
3answers
525 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:
...