[wp-hackers] filtering posts

Chris Williams chris at clwill.com
Sat Jan 20 19:30:41 GMT 2007


Set a global variable in your plug-in so later you can check it and
farkle with in the posts_where filter.

Another option that I use is to create your own query_var and pass it as
a parameter to the page, but from the info you provide isn't complete
enough to understand the exact situation.

This is not nuclear physics, it's all in the code.  Just step through it
in a debugger and you can see what's happening, when filters are called,
even how WP itself handles similar situations to your own.

One of the best is to watch what happens when standard archive queries
are done (e.g. by date).  This tells you a lot about how WP handles this
itself.  You can then do thou likewise.

-----Original Message-----
From: Nathan Olsen
Subject: Re: [wp-hackers] filtering posts

Thanks for the reply, but this isn't quite what I
need. Your plugin relies on knowing what data to
filter before the page loads. I need to be able to
decide what data to filter as the page is loading.
That is, the most important test will be: has my
plugin been called? If it's been called, alter the
data; if it hasn't been called, don't alter the data.


More information about the wp-hackers mailing list