When inserting an image via media uploader into a wordpress Post, is there a way to know all the properties of that image the same way wp has global $post which shows all properties of the post it’s in?
When inserting an image via media uploader into a wordpress Post, is there a
Share
Not sure if this is quite what you mean but a WP attachment (be it an image or any other type of uploaded media) is treated as a post. Therefore you can run
get_poststo get an array of attachment objects that match your criteria. Then use aforeachloop to display whatever data you need from these objects e.g.:You can also use any other parameters of the WP_Query class to build your query within get_posts and narrow down the attachements that you’re after – you will need to specify attachement as the post type though
Resources you want to check out:
http://codex.wordpress.org/Template_Tags/get_posts
http://codex.wordpress.org/Function_Reference/the_attachment_link (also look at the related functions at the bottom)