Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7437891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:28:07+00:00 2026-05-29T10:28:07+00:00

I am creating a WordPress website for multi author and want to set user

  • 0

I am creating a WordPress website for multi author and want to set user role as per article submission. Means if any user have 0-10 article they will go to Contributor role, if 11-30 will go to Author role if 31-100 will go to Editor role.

Also I want to make registration system where default registration group will be Subscriber. They will get a link into verification email like

If you want to become a Contributor please click on below link. (To submit an article you must have at least Contributor permission)
http:// link will be here … this link automatically change user role from Subscriber to Contributor.

Hope I will get solution from you expert. I am posting this issue with lots of hope from you friends.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:28:08+00:00Added an answer on May 29, 2026 at 10:28 am

    What you want to do is when they post their submission check to see how many posts they have authored and then change the role. So in your theme’s functions.php file you’d need a hook that is like this.

    add_action('publish_post', 'update_roles');
    

    and then a function to update the roles.

    function update_roles()
    {
    
       global $wpdb;
    
       // Get the author
       $author = wp_get_current_user();
    
       // Not sure if $author and $u are the same object I suspect they are. 
       // so this may not be necessary, but I found this code elsewhere.
       // You may be able to do without this and just replace $u with $author later in the code.
       // Get post by author
       $posts = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_author = " . $author->ID );
    
       $numPost = count($posts);
    
       // Do the checks to see if they have the roles and if not update them.
       if($numPost > 0 && $numposts <= 10 && current_user_can('subscriber'))
       {
           // Remove role
           $author->remove_role( 'subscriber' );
    
           // Add role
           $author->add_role( 'contributor' );
    
       }
    
       ...... other conditions .......
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I'm creating a Wordpress website with user login and a small e-commerce. When
I have a wordpress website I'm creating for a client temporarily hosted on http://dev.eatfit.co.nz/
I am creating a website.It is not a wordpress website.I want to create username
I have 2 custom fields in my WordPress system when creating new posts. One
I'm creating a wordpress plugin and I was wondering if wordpress has any function
I am creating a wordpress blog for a magazine. They have a legacy blog
Hi I am creating a wordpress custom page theme, I have included the code.
I'm creating a customized WordPress theme based on an existing site. I want to
Simple question. I'm creating a wordpress theme and I want to display the post
I'm creating a wordpress plugin to fetch data from another website, It will be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.