PDA

View Full Version : How to get the pixelpost image ID from admin addon?


sebatl
10-29-2006, 06:43 PM
Hi there,
I am working on an admin addon and I am trying to access the pixelpost ID from my addon when a new image is added , basically from the function registered with add_admin_functions("myfunction", "image_uploaded", ...).

When I edit a post, I have no problem getting it using $_GET['id'] but I can't find a way to get it when I am adding a new one.

The reason I need that is my addon is saving extra custom information for each post in a new DB table and I need the pixelpost id to cross reference this data with the pixelpost images.

If anyone knows where to get it, that would be very appreciated. :)

Thanks,
-Sébastien

GeoS
10-29-2006, 11:41 PM
$theid - this is a variable which stores ID info.

You can grab it by adding to your function:
global $theid;

sebatl
10-30-2006, 12:49 AM
Works great. Thanks!