Use wp_insert_post_data
filter. Then check the user role. If user have specific role set-up post status. ( I don’t test below script)
add_filter( 'wp_insert_post_data', 'filter_handler', '99');
function filter_handler( $data ) {
$user = wp_get_current_user();
$userRole = $user->roles ? $user->roles[0] : false;
if ( $userRole === 'author') {
$data['post_status'] = 'pending';
}
return $data;
}
Related Posts:
- Allow user to “edit_others_posts” to save only, not publish
- How to limit user to publish post per day and per role?
- Add role that restricts user to post in specific category
- Remove Posts Quick Edit link for specific user role? WP 3.3
- Allow role to delete posts but block him the wp-admin
- Multiple authors for single post without plugin
- If specific user role then sticky post
- Downgrade user from role that allows post creation
- Remove the Edit button in posts for permalinks on certain user roles? WP 3.3
- Posts with multiple authors with different roles
- Update a users role based on number of posts published
- Change user role when post approve
- Stop users posting into category while still seeing contents of the category
- How to allow users to post only in certain category and hide elements from edit page?
- Post visibility based on user role
- “edit_published_posts” and “edit_other_post” issue
- User levels and post visibility
- (solved) getting post author’s user role
- Delete post after x minutes if user role is
- Show posts by author of membership level (Paid Membership Pro)
- Hide comments and posts posted by other user
- Show 10 latest posts only from users with contributors role
- Limit Post Creation Count by Author or Role
- Administrator Posts
- allow editor/author to publish others posts but not publish their own
- Changing a users posts to drafts upon role change
- Allow author to duplicate but not edit post
- Disable `create_post` for built-in post type
- Add new post only in assigned category
- Remove All in One Seo from Posts for Contributors
- Admin Post List Only Show One Category
- Authors can edit all posts, except when an owner is specified?
- each user having category with their name and can add sub categories post in that category
- WordPress strips some attributes for author posts
- Display posts with id equal to relationship value
- How to get post ID of the current page/post inside a widget?
- add action only on post publish – not update
- Remove post title input from edit page
- WordPress: How to get the current logged in author page URL?
- How to disable drafts?
- Why can posts never have a number as the link?
- How to load post content on index page using ajax when post title in sidebar is clicked
- How to display links in specific page
- Importing data from spreadsheet into wordpress DB, along with custom taxonomies and their terms
- Does WP get all post_meta on POST page?
- Posting via email, where do I start troubleshooting?
- Creating a Post, can authors be ordered by last name?
- Append Text to $post->post_excerpt
- Are posts updated or built from revisions + autosaves?
- Get permalink of post that an attachment is linked to
- Filter Custom Post Type by Category with Ajax
- SQL query to retrieve all the records that have not indicated category
- open selected wordpress post with javascript
- do_shortcode within post query
- How to change the setting so there is no post on home page
- How should I add links to other pages/posts from my post?
- Unautop / Sanitize content added to a post through a plugin
- problems with loading posts in a table-row
- How can I get global $post to work for CPT and update user?
- Unable to restore from backup – how to obtain old blog posts?
- Show only one page link in content pagination
- Include sticky posts on the static page front page
- Exclude current custom post on single post
- Why Query is returning empty array?
- meta_value timestamp older than now
- Total number of posts in query (category/tag/author/search results/main page…)
- Very complex post query
- Echo Text If User Is Logged in But NOT the Author of post
- Getting Whitescreen when publishing a post [closed]
- How do I link a Post Type to a Template in Masterplan?
- Where is the “Posts”/”Blog” template?
- How to get posts ordered by using their categories?
- Where to insert the other site image url for our wordpress post
- How to get value in radio input in post meta box?
- Automate post update for all posts?
- ACF date picker to trigger category change
- DEL media from the post but keep my featured image or post
- wordpress admin missing Posts button
- Set post title font size automatically according to number of words in post title
- Posts are not displaying on their category and tag page
- Random post_id at wp_insert_post
- I need show posts by customer (Shortcode)
- Show custom post category for single post
- How to delete all posts with dead image urls?
- Get a list of categories that are related to posts
- Post Per Page For Portfolio
- Update all images url imported from HTML pages
- How to modify specific parts of a post content in WordPress
- How do I allow my post to update it’s date every week
- Loop through posts by each term and exclude duplicate posts assigned to several terms
- Change link to permalink inside post content
- Is possible to create a custom link that creates a post that’s already categorized?
- How to change link with broken link?
- How to change date_format in entry-info
- Only show posts with image and the correct ammount of posts in loop
- Related posts by searching post tags of single post as terms
- How to make a local “scroll to ID” on post?
- Full width images within post content
- What is $post->ID
- Custom Admin Post Column change order