You can attach code to change role when post status is changing from “pending” to “published” see documentation: http://codex.wordpress.org/Post_Status_Transitions Then, if user has role “contributor” you can change this to “author”:
add_action( 'pending_to_publish'. 'my_function', 10, 1 );
function my_function( $post )
{
$wp_user_object = new WP_User( $post->post_author );
if ( in_array('contributor', $wp_user_object->roles ) ) {
$wp_user_object->remove_role( 'contributor' );
$wp_user_object->add_role( 'author' );
}
}
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
- 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
- allow user to create a draft post but not publish wordpress
- 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
- Random sort within an already sorted query
- How to validate XML-RPC post creation and cancel when needed?
- Display the latest post from a category in a page
- rewind_posts() – what actually the use of it, and where using is required or preferred?
- Custom Field in Featured image for A particular post
- Custom permalink structure only for default posts
- List latest posts in WP-Admin
- WordPress Number of Posts Not Changing With posts_per_page
- Problem ordering posts with numbers for titles numerically E.g. 1, 10, 100
- Comments enabled, but disabled at the same time
- Post in Multiple Categories to stay in current category (permalink, next previous post link)
- set role specific screen options in post summary page
- How to get a nofication when post submitted
- Post preview and oembed provider issue using polylang plugin with subdomains
- Any idea why wp_insert_post is succeeding but not returning?
- How would I get 1 latest post from a query for 5 posts?
- How can I link a CSS file only on single posts?
- add_action not using ‘delete_post’ action with wp_delete_post
- Getting post id from wp_insert_post_data function?
- Exclude posts from featuring
- Lazy Load using WP_Query pagination
- Enable post revisions for a specific post
- Is there any way to allow users to access content before it’s published?
- Restrict users post for himself
- Driving a random quote like functionality with database
- How could I change my Permalink from blog to custom structure? [closed]
- how can i change WP main archives loop to sort by name or title
- If statement to check if post has image
- Is there any upper limit for the number of posts that can be created with wordpress
- Automatically create a default set of posts for each new registered user
- why the same code got different results when using query_posts in functions.php and index.php
- WP_Query: Show 10 posts in date order, first three random
- Exclude post category in a blog page
- Get a post’s ID
- How to make posts being uncategorized
- how can display a post on home screen without images
- Custom Select Query – Selecting the Year?
- how to create a sub section in posts
- Filter out posts based on a certain post_meta on the WordPress REST API
- Save / Update meta data as multidimensional array
- WordPress Query – Display 5 posts (same post type), each from a given tag
- Edit post & page option does not display on latest wordpress
- Permalink Short code showing unnecessary link text inside the loop
- How to Create another Page Category like the “Post” and “Pages”
- Show code only on WooCommerce Pages
- WP_Query that targets all categories
- Category posts show on local install, they do not show on live server
- Only show related posts when another post has same term
- single- and archive- templates not being applied to custom post types, not even after flushing permalinks
- Sort Events by Venue Title – Sort Post set by related post ids
- Posts per page, reverse count
- get_the_ID() fails the first time, returns a value the second time it’s called
- How to Test a Blog Post for Update vs. Publish Status — Unique
- Inserting image into post content – Front End
- How to get all the terms of a post
- How to create three columns from selected posts
- Commenting on a post from the admin panel?
- How to filter categories of a post
- Columns in a “post”
- Adding a content rating system
- how to show all post with its contents
- Cannot Create a new Post [closed]
- Last updated post in wordpress homepage first position
- How to make category for word post_content
- How to monitor the first publish date?