[wp-hackers] Passing post_id as filter argument

Peter Westwood peter.westwood at ftwr.co.uk
Tue Dec 11 20:20:32 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
Vladimir Ghetau wrote:
> Hi guys,
>
> I'm trying to figure out how to pass the post_ID as argument when
> using the add_filter hook.
>
> Besides the content I'm receiving automatically, I really can't
> figure out an workaround to passing the post_ID argument to the
> called function using add_filter('the_content', 'myfunc').
You can't add extra arguments to the add_filter hook in order to
request that your receive arbitary data.

What you want to do is globalise the post ID global in your function
and use that.

westi
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
iD8DBQFHXvEQVPRdzag0AcURAreWAKCtOeGZdFLCs4dtAtK+UUThY7jzuQCgoPtw
5CpBdOtfu9I/PnH/yzSzVj0=
=Ih5V
-----END PGP SIGNATURE-----



More information about the wp-hackers mailing list