[wp-hackers] parse_query filter
Owen Winkler
ringmaster at midnightcircus.com
Wed Oct 5 21:26:49 GMT 2005
Mike Little wrote:
> On 05/10/05, Owen Winkler <ringmaster at midnightcircus.com> wrote:
>
>>I was looking for a plugin hook that would allow me to inject the
>>query_vars with a value or two before the default posts array is
>>generated. That's when I came upon this:
>>
>>if ( !empty($query) ) {
>> do_action('parse_query', array(&$this));
>>}
>>
>>Why does $query have to be empty to fire this hook? There seems to be
>>no other way to modify the query_vars on the home page from a plugin.
>>
>>Owen
>>
>
>
> Surely that says *not* empty. I.e only call the hook if there is a
> query to process.
Er... Let's try that again...
Why does $query have to be NON-empty to fire this hook? There seems to
be no other way to modify the query_vars on the home page from a plugin.
Put a different way: If the request is for the home page ($query == '')
then the hook isn't fired.
Attached is my proposed, possibly easier-to-manage solution.
Owen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: classes.php.diff
Type: text/x-patch
Size: 340 bytes
Desc: not available
Url : http://comox.textdrive.com/pipermail/wp-hackers/attachments/20051005/901c80ee/classes.php.bin
More information about the wp-hackers
mailing list