[wp-hackers] Add a Filter or use new PRIVATE status (WP2.1)

Filipe Fortes fil at fortes.com
Wed Mar 14 13:07:13 GMT 2007


You've got two options:

   1. Change the post_status of the posts in your private category to
   "private" and then use the filters to display them only to members with
   privileges. This stops most other plugins from displaying your posts.
   The biggest drawback is the lack of filters for archive / category / etc
   listings which will keep your posts out of that view. For my
plugin<http://fortes.com/projects/wordpress/postlevels>,
   I ended up using the query filter, which can be tricky to keep compatible
   with the many plugins out there.
   2. Do the reverse of #1, and try to make sure that other plugins hide
   your special (but public) posts ... this would involve changing the sql
   calls through the query filter

Best of luck! Feel free to look at my source ...



On 3/14/07, Chris <chris.hearn01 at ntlworld.com> wrote:
>
> I have tried that on the index page, that works, adding (cat=-4), but
> the calendar plugin, recent events etc listed in my sidebar are
> unaffected..
>
> > Chris wrote:
> >> b) adding some sort of filter that filters out everything in
> >> cat=members if user not logged in
> >> But where to attach this filter to have global impact and work with
> >> the plugins? assuming I can make the filter in the first place!
> >
> > use the the_posts filter, it is ran before the loop and receives all
> > posts as an array.
> >
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> >
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list