[wp-hackers] getting post_id at plugin load time

Brett Taylor brett at webfroot.co.nz
Tue Apr 5 06:27:04 GMT 2005


David House wrote:
> My best idea would be to add a hook in yourself, in
> wp-blog-header.php. Search for 'query_posts', then in the next line,
> add this:
> 
> do_action('post_query_posts');
> 
> Then you can hook onto this from inside your plugin:
> 
> function write_cookie() {
>   //your code goes here
> }
> 
> add_action('post_query_posts', 'write_cookie');
> 
> That won't be called as soon as your plugin is loaded, but it will be
> executed as soon as $post is created.

Thanks for the help, David :)

Unfortunately, it seems like output has occured before this point :(

Any other ideas?

Cheers,

-- 
Brett Taylor
- Webmaster
www.webfroot.co.nz

ICQ: 8473626  MSN: weednix at hotmail.com  AIM: webfroot
JABBER: Glutnix at jabber.org.nz   http://inner.geek.nz/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : http://comox.textdrive.com/pipermail/wp-hackers/attachments/20050405/be54dda4/signature-0001.bin


More information about the wp-hackers mailing list