[wp-hackers] Post ID using 'the_title' in the Latest Activity box

Otto otto at ottodestruct.com
Fri Jan 25 20:37:41 GMT 2008

Isn't $post a global at that point?

global $post;
$id = $post->ID;

That should work.

On Jan 25, 2008 2:11 PM, Henrik Melin <henrikmelin at yahoo.com> wrote:
> Hi,
> I'm replacing the title of a post to be a combination of two custom fields if they are present, e.g. artist "title". Generally, it is possible to get the id in the 'the_title' hook by:
>         $post = &get_post();
>         $id = $post->ID;
> Now, this does not work on the Latest Activity box on the Dashboard (2.3.2) -- does anyone know how to (always) get the id of the post that the_title() or get_the_title() refers to using the 'the_title' action? Seems to me like there isn't enough context for this action.
> Cheers,
> Henrik.
>       ____________________________________________________________________________________
> Never miss a thing.  Make Yahoo your home page.
> http://www.yahoo.com/r/hs
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

More information about the wp-hackers mailing list