[wp-hackers] post id in custom template

Mark Jaquith mark.wordpress at txfx.net
Sun Jun 5 19:36:49 GMT 2005


For getting the post ID in a the_content filter, I've just either 
declared $id global and used that, or declared $post global and used 
$post->ID  Using $post is better if you need other stuff as well, 
because you can just "globalize" the $post object and be done with it.

ml_wordpress at copperleaf.org wrote:

> I have a plugin that modifies "the_content" with a registered content 
> filter. I'd like to be able to have the part being modified be defined 
> with an optional template file but need to know the post id and misc 
> data in the template page. Let me try and illustrate. 



More information about the wp-hackers mailing list