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.