Page 1 of 1

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

PostPosted: August 27th, 2011, 11:30 pm
by candy
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!

Re: How 2 protect posts based on custom_post_type /taxonomy

PostPosted: August 28th, 2011, 2:41 am
by Cristián Lávaque
This may help give you some ideas to achieve that: viewtopic.php?f=4&t=14651&p=32731#p32731

Re: How 2 protect posts based on custom_post_type /taxonomy

PostPosted: August 28th, 2011, 8:24 pm
by candy
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.

Re: How 2 protect posts based on custom_post_type /taxonomy

PostPosted: August 29th, 2011, 3:33 pm
by Cristián Lávaque
I'm very glad that solved it for you! :)