Alex Belke
Alex Belke

Reputation: 2233

Wordpress let user create only on page/post

I have a website on wordpress. The goal is to let new register user to create only one post in category Companies. The user can create post about his company. When he creates it than he is not allowed to create more posts in category Companies. And also he should not have permission to edit/delete posts of others users in category Companies. Is there a possibility to do that somehow? Maybe there is some plugin? If not. How to do it in other way? Maybe create other group of users and give them such restrictions?

Upvotes: 1

Views: 203

Answers (1)

user5201742
user5201742

Reputation:

There's two options:

1) Use plugins. For example: https://wordpress.org/plugins/restrict-author-posting/

2) Program it yourself

You'll need to:

  • create an specific role or use an existing one.
  • create some capabilities and then add to your specific role

This goes to the functions.php file of your theme:

function add_capabilities() {

    $role = get_role( 'company_creator' );

    $role->add_cap( 'restrict_to_category' );
    $role->add_cap( 'create_only_one' );
}

You have to create the capabilities before. There's a lot of information out there.

Upvotes: 2

Related Questions