s2memberRecently we were working on a project involving wordpress and a membership site. For the site the client was looking for a way to register users but wanted them to be able to have custom capabilities for the actions they wanted their users to take. They want a new users to have the ability of an author on their website but still wanted to limit the permissions of an author. We wanted to share a workaround for this and maybe it will work for you as well.

The first step in the process is that we went through the normal steps of setting up the plugin s2member, this is a great plugin for anyone wanting to setup a site that features a paid-member site and it has many features that are well worth and the best thing is that it is FREE.

Download s2member Plugin

The only draw back is that s2member will make the default role a subscriber on wordpress and this can be changed in the wordpress code or s2member code but this will only be overridden when the plugin is updated.

The workaround solution for this to use the s2member plugin with another plugin called “Members

Download the Members Plugin

The various choices for roles with s2member are:

  • administrator
  • editor
  • contributor
  • subscriber (default role)
  • s2member_level1
  • s2member_level2
  • s2member_level3
  • s2member_level4

When both plugins are activated at the same time they can work together for added functionality and help you accomplish a great deal of other items. Each of the levels 1 – 4 have the same capabilities as a subscriber they just have access to different levels of post (if you have this enabled).

In your wordpress admin panel under the users section select “Roles”, you will then see a listing of all of the roles that have been created in wordpress. View the Author role and look at the capabilities that an author can do, if you would like a subscriber or any of the s2member levels to have the same ability as an author simple enable the same capabilities that an author would have. Since s2member uses the subscriber as a default role when members sign up, changing the abilities and access of what a subscriber is authorized to do will give this added functionality for members of your site.

Let’s look at an example, for the client that we were helping they wanted anyone who registered for their site to have the same capabilities as an author. By default an author has the following abilities:

  • edit_posts
  • read
  • delete_posts
  • edit_published_posts
  • delete_published_posts
  • publish_posts
  • upload_files
  • access_s2member_level0
  • access_s2member_level1
  • access_s2member_level2
  • access_s2member_level2
  • access_s2member_level4

Now that we know what an author can do, we can view the role of subscriber (since this is the default role chosen by s2member) we can enable the same capabilities as the author but we will not allow access over .

*The same logic can be applied to the other access levels of s2member as well.

You can find the various roles with WordPress here: http://codex.wordpress.org/Roles_and_Capabilities

administrator
editor
author
contributor
subscriber
s2member_level1
s2member_level2
s2member_level3
s2member_level4

Tags: , , , , , , ,

4 Responses to “Changing the default role in s2member”

  1. Buy Plus Ones July 3, 2011 at 6:54 am #

    So you cant actually change the default to one of the membership levels but you can change the default “Subscriber” role to have the same abilities as the membership level you want to be default…. a bit confusing and hopefully they will make a fix for it soon.

    • Free & Easy Blog Staff July 4, 2011 at 10:31 pm #

      We do apologize if it is somewhat confusing and can clarify on any step if need be. There is a way to try and edit the default role but you would basically be recoding the plugin itself which is more trouble than it’s worth. Using the membership plugin + s2 member should accomplish changing the default role.

      Also at the time this tutorial was written we submitted this solution to s2member and asked if they would update the plugin with the ability to change the default and have yet to hear back.

      For now I guess we have to use the suggested method above.

  2. Amanda August 4, 2012 at 12:27 pm #

    Thank you for this! I have done as you’ve directed. My level 1 and 2 are now allowed to “publish_posts” …except I have a test account for level 2 and there is no option for them to actually create a post. Did I miss a step or something?

    • Free & Easy Blog Staff August 8, 2012 at 3:59 pm #

      You will want to make sure that level 1 & level 2 have the right roles and capabilities.

      These are the features you would need to make sure are enabled for someone who is able to publish posts. Visit http://codex.wordpress.org/Roles_and_Capabilities and make sure that each person has the capabilities of an author or editor.

Leave a Reply

Notify me of followup comments via e-mail. You can also subscribe without commenting.