A combination of user_register and wp_insert_post should work fine:
add_action('user_register', 'create_postset');
function create_postset($user_id) {
// userinfo
$user_info = get_userdata($user_id);
// Create post objects
$post_1 = array(
'post_title' => '1st post created for ' . $user_info->user_login,
'post_content' => 'Lorem Ipsum',
'post_status' => 'publish',
'post_author' => $user_id
);
$post_2 = array(
'post_title' => '2nd post created for ' . $user_info->user_login,
'post_content' => 'Lorem Ipsum',
'post_status' => 'publish',
'post_author' => $user_id
);
// Insert posts into the database
wp_insert_post($post_1);
wp_insert_post($post_2);
}
Related Posts:
- Update post counts (published, draft, unattached) in admin interface
- How to Display a List of Users Who Have Made at Least 1 Post?
- Find out who deleted a page or post?
- WordPress: How to get the current logged in author page URL?
- disable password protected page for logged users
- Force “Submit to review” when a post is updated
- Overview with latest edited posts and pages
- Navigation link to specific user page
- Get how many days since last post of the current user
- Hide comments awaiting moderation from user who submitted the comments
- Query All users that has post
- Limit number of posts a user can make per minute?
- How do I allow users to follow a post and then allow admins to email all users who have followed that post?
- wp_insert_post let users post to without login…broke
- Get user’s most published categories
- Allow anonymous users to post to my site for moderation
- disable column on post and user list
- how to find user ids of all commenters in a post
- How to list users and their post amount?
- Is there any way to allow users to access content before it’s published?
- UberMenu list current user’s posts as menu items
- Create post for every user?
- count the total number of comments the user has received for his published posts
- Restrict users post for himself
- How to allow logged in users to post anonymously
- Allow public to post on blog
- current post with current author
- How to verify wp user password by sql query in wp? [closed]
- How can i delay reading posing in 3days for not logined user?
- Encountering “Wrong nonce. Action prohibitied.” when trying to alter User Role and unable to Post via WP Admin
- Users problem (multi-author plus multisite)
- How do I manage my users post before publish?
- How do I retrieve a users’ last 5 posts?
- Gather posts into a cart/lightbox and share with another user
- Assign published posts to another user automatically
- Add field to user meta table in database when link is clicked
- Hide comments and posts posted by other user
- Summary of Posts by an User
- Display a list of users who have viewed the post you are viewing
- Check if current user has a post and that post has any term/s from a specific custom taxonomy outside the loop
- Echo Text If User Is Logged in But NOT the Author of post
- Deleted a user with administrator rights. Now all the data/content/images are lost. how to recover them back
- Show number of posts by logged in user
- Retrieve data from post meta meta_key having ‘_product_fq_image’ while having author_id and post type is PRODUCT
- Cannot select certain authors for posts after import
- How to limit post (Exception pages) for current user in each role in front end?
- How can get the last post date of the user?
- Is there a way to save different data when USER interacts with the same POST?
- How to display particular categorie’s post which associated to specific user?
- WordPress Delete Users from backend doesn’t work
- Allow users to post their videos to my wordpress website?
- Compare date of user’s last posts
- Add new post only in assigned category
- WordPress each user has each content for a page,how to do that?
- User rank in wordpress post
- Count how many posts a user has viewed
- Allow users to create their own page/s
- Get current user array with post string
- My posts section for logged in user
- Show Custom Post From Logged In Author
- Delete old post with new post
- How to handle dates, trying to calculate time since a post
- each user having category with their name and can add sub categories post in that category
- The post order is different for logged-in and non-logged-in users? [closed]
- User submitted post
- Automatically select category based on user role
- Undefined Function Fatal Error with Shortcode [closed]
- How to allow Contributors to edit their own posts, whilst still needing to be reviewed by an admin?
- Allow users to edit post without logging in
- Divide Post content into separate divs for every 500 characters (or any other character counts)
- Change default screen option value for posts per page
- post_exists() in an external script?
- Show the author’s count of total amount of posts assign to a custom taxonomy term
- post_date vs. post_modified – what’s the difference? [closed]
- Invalid post type when click “Filter” or “Apply” button in WordPress admin Post list [closed]
- Adding a cancel button to edit post screen
- Disable Jquery UI post tabs
- If Specific Post, Link Elsewhere
- Can’t Delete or find a blog post (unknown)
- Which WordPress hook fires after post content loaded?
- Enable Comments Box On Custom Post Type
- Prevent additional top level categories but allow more children
- Remove current category from post but display all others
- How to get links to the last N posts in a specific category?
- Run query_posts if SESSION is empty?
- Update all posts in a loop everyday
- Change url-structure for wordpress pages – pages in strucutre not top-level
- Post Templates and Post ID’s
- Delete media from the post but keep my featured image and post
- Every time I try accessing a post it redirects me to the feed
- Loop and output 4 rows of posts on home page
- List posts of assigned categories in list of all categories on single.php
- Display result of custom form
- How can I choose and change a post title at random from an array when it is published?
- How to show the posts list into a static page? Problems to use the loop into a static page
- new blog post does not appear in blog after publishing
- wordpress taxonomy results
- Custom post page has attributes of latest post [closed]
- Edit Page button is gone
- Set Featured Image of a post