Site icon Hip-Hop Website Design and Development

How to get future ID for post which haven’t been created yet?

Calling Post ID: Lets go first with calling post id definition 🙂 This name i actually find inside a core file wp-admin/includes/media.php which means for the post you requested the media upload. Media gets attached to the that post which the media uploader gets called.

Question: Well, for new post (when you click “add new post” or “add new cpt” and you open up wp-admin/post-new.php page. You will notice there is a post id already assigned to the possible new post. To check hover over the media upload button and notice the url.

So, how to I find the post_id of the possible post? I am trying to find out how to get that post id and searching through core file with no luck.

Appreciate your help 🙂

Update: Parhaps my question was little missleading. As i did not said where i am going to use the code. I am making a front end user dashboard where I need to get the id not backend admin panel, the image was for demonstration purpose. Going to use the code like on this question Image uploader with "Set Featured Image" link on front end