PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Keeping s2member roles during upgrades

Common Questions/Problems/Tips. Posted by Administrators & Support Reps.

Keeping s2member roles during upgrades

Postby dwdutch » October 4th, 2011, 2:18 pm

I allow certain capabilities within assigned S2Member roles --- for example, the s2member_level2 has the "delete_posts" capability enabled.

I've noticed that on the past couple of upgrades, however, the S2Member roles are "reset" so, that any added capabilities are cleared and I have to remember to go back in to re-assign this capability to those group of users.

Is it possible that future upgrades can simply "retain" the existing assignments allocated to the roles?
User avatar
dwdutch
Registered User
Registered User
 
Posts: 24
Joined: January 16, 2011

Re: Keeping s2member roles during upgrades

Postby Cristián Lávaque » October 5th, 2011, 1:53 am

Thanks for the feedback. I'll ask Jason about this.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Keeping s2member roles during upgrades

Postby Jason Caldwell » October 8th, 2011, 7:54 pm

Thanks for the heads up on this thread Cristián.

Yes, you may create this directory and file to lock-in your Roles/Capabilities for s2Member.
/wp-content/mu-plugins/s2-hacks.php
Code: Select all
<?php
add_filter
("ws_plugin__s2member_lock_roles_caps", "__return_true");
?>
* This will prevent future upgrades from resetting/re-configuring your Roles/Caps.

In addition, this will disable the Reset Roles/Capabilities button in the Dashboard, under:
s2Member -> General Options -> Membership Levels/Labels. Actually, the button is not disabled completely, but clicking the button does no good, because s2Member will simply return a message indicating that Roles/Capabilities have been locked by this Filter.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Keeping s2member roles during upgrades

Postby dwdutch » October 24th, 2011, 12:46 pm

Thanks for the feedback. I'll try to remember to re-post my result after the next upgrade opportunity.

By the way, I don't have a multi-user installation of WordPress so I don't have a mu-plugins directory. I just placed the recommended line in my own hacks file.
User avatar
dwdutch
Registered User
Registered User
 
Posts: 24
Joined: January 16, 2011

Re: Keeping s2member roles during upgrades

Postby Jason Caldwell » October 25th, 2011, 4:02 pm

Sure, thanks for the follow-up, much appreciated!

Note, /wp-content/mu-plugins/ = MUST USE plugins, and this does not require you to have a Multisite installation. MUST USE plugins are an easy way to inject your own code ( i.e. custom plugins ). See: http://codex.wordpress.org/Must_Use_Plugins
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Keeping s2member roles during upgrades

Postby dwdutch » November 2nd, 2011, 6:02 pm

I just did an upgrade and this fix worked wonderfully. Thanks for the info and the clarification on mu-plugins :)
User avatar
dwdutch
Registered User
Registered User
 
Posts: 24
Joined: January 16, 2011

Re: Keeping s2member roles during upgrades

Postby Jason Caldwell » November 3rd, 2011, 11:43 am

Very welcome. Thanks for reporting back on this!
dwdutch wrote:I just did an upgrade and this fix worked wonderfully. Thanks for the info and the clarification on mu-plugins :)
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA


Return to Common Questions/Problems/Tips

Who is online

Users browsing this forum: No registered users and 2 guests

cron