latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

About: Norm Sash

Sorry, I've not written a description yet. I'll get to it soon!


Topics I'm Subscribed To

Viewing 2 topics - 1 through 2 (of 2 total)
Topic Count Last Reply
Source value for Referencing Customer

By:  Norm Sash in: Community Forum

voices: 2
replies: 1

3 years, 11 months ago  Eduan

Assigning a default user role

By:  Norm Sash in: Community Forum

voices: 6
replies: 15

4 years, 9 months ago  Shawn Ellis

Viewing 2 topics - 1 through 2 (of 2 total)

Topics I've Started

Viewing 2 topics - 1 through 2 (of 2 total)
Topic Count Last Reply
Source value for Referencing Customer

By:  Norm Sash in: Community Forum

voices: 2
replies: 1

3 years, 11 months ago  Eduan

Assigning a default user role

By:  Norm Sash in: Community Forum

voices: 6
replies: 15

4 years, 9 months ago  Shawn Ellis

Viewing 2 topics - 1 through 2 (of 2 total)

My Latest Replies (From Various Topics)

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Monday Mar 19th, 2012 at 11:55 am #8539
Norm Sash
Username: NormsIM

I don’t believe that the s2-hacks is the solution for you, but maybe you can confirm my understanding of what you are doing. What you want to do is give someone author or editor rights when they become a paid subscriber via S2.

You memtion that you use the Members plugin to edit/assign capabilities. Do you mean that you are using the “User Roles Editor” plugin, or are you editing capabilities in a different manner. My thought would be that you could assign editor rights to the S2 level that is appropriate and that should work for what you want to do… s2-hacks would be unesessary in that case.

Norm Sash
http://nerdmans.com

Posted: Wednesday Mar 14th, 2012 at 11:14 pm #8194
Norm Sash
Username: NormsIM

I’m not sure if there is another work-around other than the one above. I still get an error in the User Role plugin if I try to set the default level to specific roles. It seems that I can set the default level to some of the standard WP roles (subscriber, contributor, editor, author, etc), but if I try to set it to any of the other roles, e.g. S2 Member, I get the error messages. If I keep trying for whatever reason sometimes I can get the requested role to be accepted, but then when I come back into User Roles I get another error.

Not sure where the conflict is – possibly S2 forcing a specific default role and not allowing User Roles to specify one???

But try similar code to the code in this thread and maybe it will work. This is an unsupported forum but maybe someone at S2 will notice this and figure out what the conflict is with the ability of User Roles to set a default role.

Posted: Wednesday Mar 14th, 2012 at 4:50 pm #8162
Norm Sash
Username: NormsIM

Thanks for the suggestings, guys… got it to work! It was a combination of both of your suggestions. The final code that worked is below. I don’t understand why the “Calendar Contributor” had to be entered as “calendar_contributor” when all the references I see to it on my sites roles is as “Calendar Contributor”, but it probrably has to do with internal pointer verses displayed content. I’m not sure how to display the internal pointer. But anyway, it works. And I did have to follow the suggestion of passing the number of arguments (I assumed 1) to get it to work.

<?php
	/* Forces the default role of a new user to be set to "Calendar Contributor" instead of "Subscriber" */
	add_filter("ws_plugin__s2member_force_default_role", "default_role",10,1);
	function default_role($role){
		$return = 'calendar_contributor';
		return $return;
	}
?>
<?php
	/* locks custom roles and capabilities from being reset during S2 upgrade */
    add_filter("ws_plugin__s2member_lock_roles_caps", "__return_true");
?>
Viewing 3 replies - 1 through 3 (of 3 total)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.