[wp-hackers] filtering posts

Nathan Olsen nateomedia at yahoo.com
Sat Jan 20 03:15:12 GMT 2007


I posted this question to wordpress.org, but I figured
that many of the people on this list may not bother to
look there.

For my plugin to work right, I need to be able to
filter out posts when the Wordpress loop is called. My
plugin is called before the loop, which will set the
conditions for what should be filtered.

add_filter does not seem to be the right fit for the
job. Using add_filter causes filtering to occur
EVERYWHERE even if my plugin is not called. add_filter
also filters results before the loop, which does not
allow my plugin the chance to decide what needs to be
filtered out.

I had the thought that maybe I could alter
$wp_query->posts to get what I need, but I'm not sure
what the right way to do that would be. I've been
studying the $wp_query class but it's rather daunting
and Google hasn't provided a good example to follow
yet.

I've been banging my head against the wall on this one
for a couple of weeks now and I'd love some help.
Suggestions?

Thanks!


 
____________________________________________________________________________________
The fish are biting. 
Get more visitors on your site using Yahoo! Search Marketing.
http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php


More information about the wp-hackers mailing list