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 Capabilities manually perMember

Home Forums Community Forum Adding Custom Capabilities manually perMember

This topic contains 1 reply, has 2 voices. Last updated by  Jason (Lead Developer) 3 years, 11 months ago.

Topic Author Topic
Posted: Tuesday Jan 29th, 2013 at 2:06 pm #39917

I watched the video on custom capabilities and how to set them up on your site. It looks like this is a much better solution for our organization. Basically, we have a membership base. When that membership base is paid, they can then take classes. After they complete classes, they get the ability to reserve equipment.

Our members can take any class in any order.

With custom capabilities, it seems like I can have everyone on one paid level. Then what I want to do is manually add their custom capability per member. Is this possible with s2member?

Scenarios:
Member A completes Class 1. I add to their membership this custom capability to see a certain page that has reservation software on it. But Member A could complete Class 3 next. Once they complete Class 3, they get those capabilities that go with Class 3. Now Member A has capabilities for Class 1 and 3.

Member B may start with Class 2 first, then go to Class 1. So adding capabilities to each member is individualistic. Each member completes a different path, in a different time frame.

Further more, if they allow their membership to expire, when they pay again in what could be 6 months or a year, they still hold onto those custom capabilities. I don’t have to re-add their capability.

But using the php coding from the video, I can make sure that my theme is always checking for if they have a membership AND a custom capability.

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Thursday Jan 31st, 2013 at 8:49 am #40122
Staff Member

Thanks for your inquiry. ~ We appreciate your patience :-)

Example of adding/removing Custom Capabilities on a per-User basis in WordPress®.

<?php
	$user = wp_get_current_user();
	$user->add_cap('access_s2member_ccap_music');
	$user->remove_cap('access_s2member_ccap_music');
?>

See also: http://codex.wordpress.org/Class_Reference/WP_User

Viewing 1 replies (of 1 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.