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.

List of custom capabilities posts/pages

Home Forums Community Forum List of custom capabilities posts/pages

Tagged: ,

This topic contains 3 replies, has 3 voices. Last updated by  Agneta Lundström 3 years, 8 months ago.

Topic Author Topic
Posted: Saturday Apr 20th, 2013 at 9:39 am #47994

I want the login welcome page to show the member a complete list of posts and pages that are available. I’m using custom capabilities. I found this http://www.s2member.com/kb/list-custom-capability-protected-files/ but as I understand this is files only? Could I modify it to work with both pages and posts?

/Agneta

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Saturday Apr 20th, 2013 at 6:26 pm #48020
cassel
Username: cassel

If you are using ccaps, you can surely create a page with a list of various pages, posts, documents, with the links inside conditionals. You could do something like this (not the actual code here):
if user has ccap = lesson1:
display lesson1 link

if user has ccap = page23:
display link to page 23

I am actually in the process of creating such a page for my own site. I made a “MyAccount” page and a link that will appear once the user is logged in, and that MyAccount page will display ALL the possible ccaps, so each user will see what they are entitled to, depending on the ccaps they have.

Posted: Monday Apr 22nd, 2013 at 6:52 pm #48118
Bruce
Username: Bruce
Staff Member

Thank you for your inquiry.

s2Member does not provide a way to query posts, but WordPress does.

See: http://codex.wordpress.org/Template_Tags/get_posts

s2Member saves the required Custom Capabilities in the meta key s2member_ccaps_req. You’ll need to query a serialized array value to get the correct value. Alternatively, you could query a number (or all) of your Posts, and use this s2Member function to tell if they are protect by s2Member:

is_post_protected_by_s2member()

That’s about as far as we can go with custom code. If you need further assistance, we recommend http://jobs.wordpress.net, or another freelance web site where WordPress® experts are offering their expertise through a bid on your project.
Posted: Tuesday Apr 23rd, 2013 at 2:37 am #48150

I’ve left the idea about listing (for now). Instead I’m using tags on pages and post. That way I can link to the tag-content. That way I can use several tags to divide the content.

Thank you guys!

/Agneta

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