WordPress.org

Forums

determine which post is being edited? (2 posts)

  1. weinerschizel
    Member
    Posted 4 years ago #

    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

  2. ancawonka
    Member
    Posted 4 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.