WordPress.org

Support

Support » Plugins and Hacks » Hacks » determine which post is being edited?

determine which post is being edited?

  • I created a meta box to support my plug-in’s functionality. It augments the post edit screen in the admin panel. However, I need to know which post is being edited. I have to know the post ID as this is how I reference the data for my plug-in.

    How do I look up the post ID when in the admin post edit panel?

    Thanks

Viewing 1 replies (of 1 total)
  • Within the metabox, you can use the $post variable. Just make sure to declare it:

    global $post;
    
    echo "My post is:  $post->ID";

    Cheers,

    Anca.

Viewing 1 replies (of 1 total)
  • The topic ‘determine which post is being edited?’ is closed to new replies.