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

Filipe Fortes fil at fortes.com
Wed Mar 14 14:35:54 GMT 2007


You can use the save_post, etc hooks to automatically change the status of
the post, so you won't require your authors to change the status themselves.




On 3/14/07, Chris <chris.hearn01 at ntlworld.com> wrote:
>
> Filipe,
> Thanks, i will look at your code. I thought this might be the way to go.
> I was hoping to "automate" it so that authors did not have to set
> "private", so I have arranged my categories so that all the member-only"
> categories are all children of a root level category. With pages I can
> then easily hide them from menus etc using this structure :)
> I expect that after the latest release of WP has stabilised the plugin
> folks will start taking account of the full range of post status!
>
> Do the default theme core files not respect "private" in archives etc? I
> shall find out by digging around I guess.
>
> I think WP now allows a good combination of features, and fortunately I
> am happy with php, sql, html coding.. but the majority of course are not!
> I'm still reluctant to hack core code tho, so will have to investigate
> plugin API once I have got the site actually launched!
> Thanks again
> Chris
>
>
> Filipe Fortes wrote:
> > 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
> >>
> > _______________________________________________
> > 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