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.

Adding custom capability to existing members

Home Forums Community Forum Adding custom capability to existing members

This topic contains 4 replies, has 3 voices. Last updated by  Cristián Lávaque 4 years, 4 months ago.

Topic Author Topic
Posted: Friday Sep 7th, 2012 at 9:06 am #24512
Hamid
Username: zawiyaprojects

Hello Support,

If I want to add a custom capability to certain members (regardless of the membership level) how do I do that.

I have about 200 members (level 0, 1 and 2) that I need to give special access to a certain page as well as the links within that page.

I have seen the tutorials that show how to create the shortcode, form or buttons for custom caps but how do I assign them to certain members? Please keep in mind I don’t what the form available to all member to register to, but rather I want to assign the cc individually.

Here is my form, just not sure how to assign it the the particular users:

[s2Member-Pro-PayPal-Form register="1" level="0" ccaps="private" desc="Private Content" custom="www.domain.com" tp="0" tt="D"] 

Thanks
Hamid

  • This topic was modified 4 years, 4 months ago by  Hamid.

List Of Topic Replies

Viewing 4 replies - 1 through 4 (of 4 total)
Author Replies
Author Replies
Posted: Friday Sep 7th, 2012 at 10:09 am #24527
Eduan
Username: Eduan
Moderator

Hello Hamid,

In that case what you would do is edit the user’s ccaps, not add them through a shortcode (since you can’t separate content by member).

So you would go under WP Dashboard -> Users -> All Users -> [Username] and you would add that ccap to the user under the s2Member section of the user’s info.

Hope this helps. :)

Posted: Friday Sep 7th, 2012 at 10:56 am #24530
Hamid
Username: zawiyaprojects

Thanks Eduan,

OK I see that now. So I would have to do it for each user via the dashboard.

Is there a way to do it with a SQL statement? Something like “update cc with private where user id=1, 2, 3”.

Sorry about the syntax, I don’t know SQL very well but couldn’t I run a query that updates all the userids that I would like to give the “private” custom capability to?

Posted: Friday Sep 7th, 2012 at 12:14 pm #24535
Eduan
Username: Eduan
Moderator

You might be interested in doing this through PHP, you can check this article for that:
Knowledge Base » Changing Roles/Capabilities via PHP

Hope this helps. :)

Posted: Saturday Sep 8th, 2012 at 7:00 am #24616

Hi Hamid.

I have about 200 members (level 0, 1 and 2) that I need to give special access to a certain page as well as the links within that page.

The import tool can help you with this, to update the existing users so you give them the new access. [hilite path]Dashboard -› s2Member® -› Import/Export -› User/Member Importation[/hilite]

I hope it helps. :)

Viewing 4 replies - 1 through 4 (of 4 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

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.