PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

How 2 protect posts based on custom_post_type /taxonomy ?!?!

s2Member Plugin. A Membership plugin for WordPress®.

How 2 protect posts based on custom_post_type /taxonomy ?!?!

Postby candy » August 27th, 2011, 11:30 pm

Hi,

Just hanging on a new issue now :-)

I have defined a new "custom post type" (called "movies") and a bunch of custom taxonomies for it.

How can I now restrict user access to that kind of posts (let's say called "movies") !??! So that only logged in users will see?
And what about taxonomies !??!

Not from the admin, as I have users posting from the frontend in that custom_post_type, so I'll need to use a php trick somehow based on that new "custom_post_type" and restrict access based on that, maybe smth like

<?php if (is_user_not_logged_in() && $level_req == 1) { ?>
<?php if ($id == ???) { ........

How to?
Thanks!
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: How 2 protect posts based on custom_post_type /taxonomy

Postby Cristián Lávaque » August 28th, 2011, 2:41 am

This may help give you some ideas to achieve that: viewtopic.php?f=4&t=14651&p=32731#p32731
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: How 2 protect posts based on custom_post_type /taxonomy

Postby candy » August 28th, 2011, 8:24 pm

Hiii,

Was about to write a long complicated post about taxonomies & co, when I got the super simple brilliant idea to look to URI and protect them that way :D

Worked for my easy case, for more complicated ones I don't know if this will be enough. If you just want to protect some content based on these new defined taxonomies but make it available to level zero, all those paypal buttons will not really help :-(

C.
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: How 2 protect posts based on custom_post_type /taxonomy

Postby Cristián Lávaque » August 29th, 2011, 3:33 pm

I'm very glad that solved it for you! :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 3 guests

cron