You can try using wp_insert_post_data for the task. Something like:
function assign_new_post_to_specific_author( $data , $postarr ) {
// Where author_ID is the ID of the author you want to assign the new post
$data['post_author'] = author_ID;
return $data;
}
add_filter( 'wp_insert_post_data', 'assign_new_post_to_specific_author', '99', 2 );
Tried it on c9.io and it works, but you need to check the filter priority for yourself.
Related Posts:
- Limit number of posts a user can make per minute?
- count the total number of comments the user has received for his published posts
- How do I manage my users post before publish?
- Update post counts (published, draft, unattached) in admin interface
- add action only on post publish – not update
- How to prevent posts from being published too close to each other?
- How to Display a List of Users Who Have Made at Least 1 Post?
- Find out who deleted a page or post?
- Is it possible to Schedule Attachments in WordPress?
- Elegant way to include only published posts with get_objects_in_term()?
- WordPress: How to get the current logged in author page URL?
- WordPress plugin to publish to multiple remote WordPress blogs
- Post publish only hook?
- Publish pending article from front end with a button?
- disable password protected page for logged users
- How to add a “publish” link to the quick actions
- How to limit user to publish post per day and per role?
- When a user creates a post (pending), send a confirmation link that allows them to publish
- Force “Submit to review” when a post is updated
- In what sequence are the hooks fired when a post is “published”?
- Restrict the Number of Posts an Author can Publish (over time)?
- Add javascript when post is published
- featuring old articles without messing up with the archive
- Publish posts only after the condition is met
- Overview with latest edited posts and pages
- Navigation link to specific user page
- Hiding by default specific post status on backend list?
- Get how many days since last post of the current user
- Hide comments awaiting moderation from user who submitted the comments
- Detect Post Type when publish_post is ran
- How can I display a specific user’s first published post?
- Does WordPress remove draft status automatically?
- Query All users that has post
- What Can I Use To Add A Custom Button Between Publish button and Move To Trash?
- Prevent post from being published if no category selected
- Send email to user that his post has been rejected
- 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
- Every possible way to get data (posts) from WordPress
- publish_post conflicts with save_post
- disable column on post and user list
- Notification to Admin or Author upon new post [duplicate]
- What differences are there between a Privately Published post and a Draft post?
- How to run a function when post is edited or updated using publish post action?
- How can I create custom button in post.php
- 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
- How to rename “Publish” metabox title in post screen
- Create post for every user?
- Automatically Updating Publish Date Bug
- How can I schedule a PAGE to go live at a future date/time?
- Restrict users post for himself
- How to give capability (publish contributors posts) to author role?
- How to allow logged in users to post anonymously
- Allow public to post on blog
- Print a message if excerpt is empty after posts have been publish/update!
- current post with current author
- Check if checkbox is marked on publish/update post
- How to verify wp user password by sql query in wp? [closed]
- Decide user that can publish a post
- How to switch wordpress post status between publish and schedule in MySQL?
- 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
- Prevent scheduled post being published if date/time is past current date/time
- Users problem (multi-author plus multisite)
- Calling Different Custom Post Timestamps in a table
- Copy post to separate database with “add_action(….)”
- Do action on publish or update?
- transition_post_status hook doesn’t have any POST data when publish with Gutenberg [closed]
- How do I retrieve a users’ last 5 posts?
- Gather posts into a cart/lightbox and share with another user
- do more action after I publish a post
- Add field to user meta table in database when link is clicked
- Hide comments and posts posted by other user
- Automatically create a default set of posts for each new registered user
- Display password protected posts to logged in users
- Stop wordpress from creating empty/null entries
- Summary of Posts by an User
- WordPress bulk category select when publishing post
- 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
- How can I tell if a post has been published at least once?
- Send email for pending post
- Post: how to set created date after post has been published [closed]
- Show number of posts by logged in user
- Add delay to publish post
- Retrieve data from post meta meta_key having ‘_product_fq_image’ while having author_id and post type is PRODUCT
- Publish a Silent Post without updating Feed
- How can my plugin display a populated new post window
- Cannot select certain authors for posts after import
- How to limit post (Exception pages) for current user in each role in front end?
- How to set a Post’s default visibility to ‘Private’ in Gutenberg?
- WordPress doesn’t save or publish new posts
- Hook when post is set from published to draft?