[wp-hackers] Passing post_id as filter argument
peter.westwood at ftwr.co.uk
Tue Dec 11 20:20:32 GMT 2007
-----BEGIN PGP SIGNED MESSAGE-----
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.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the wp-hackers