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.

Custom Capabilities expiration date

Home Forums Community Forum Custom Capabilities expiration date

This topic contains 1 reply, has 1 voice. Last updated by  Sergiu Ghita 3 years, 11 months ago.

Topic Author Topic
Posted: Friday Jan 4th, 2013 at 7:01 pm #36192

Hello.

I have a custom post type “foobar”.

Each foobar post has a custom field which contains a unique ID custom field.
To access a specific foobar post, you need to have it’s unique ID custom capability.
I also added the possibility to gain access to a whole category, by requiring the custom capability with the category name.

Thus when you access a foobar post the following conditionals would be passed:
1. is_user_logged_in()
2. current_user_can(“access_s2member_level1”)
3. current_user_can(“access_s2member_ccap_category_name“) || current_user_can(“access_s2member_ccap_foobar_post_unique_id“))

I then made two types of buttons:
1. 7 days access to foobar post with the unique ID ccap
2. 7 days access to category with category name ccap

All remains now is to make the user profile page; the login area.

Questions for building a paid/purchased/bought product list:
1. How can i display all the custom capabilities that the current logged in user has?
2. How can i display all the custom capabiltiies that the current user had in the past but expired? (history)
3. How can i get the expiration date for each custom capability?

Yours thankfully,
Sergiu.

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Tuesday Jan 15th, 2013 at 12:06 pm #37585

After over 11 days, Bump :)

  • This reply was modified 3 years, 11 months ago by  Sergiu Ghita.
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.