[wp-trac] [WordPress Trac] #16349: return list of images actually being used in post
WordPress Trac
wp-trac at lists.automattic.com
Sat Jan 22 21:03:34 UTC 2011
#16349: return list of images actually being used in post
-------------------------+--------------------------------------
Reporter: mcmasterp | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 3.0.4
Severity: normal | Keywords: image, attachment, query
-------------------------+--------------------------------------
Currently you can return a list of images attached to a post. This does
not help if you want a plugin for example to be able to list just the
images currently being used on a post. if you use the get_posts with type
= attachment and post_parent = post->ID you get back a list of every image
ever attached to that post whether or not they are on the post anymore.
further if you reuse the image on a second post, and then run the same
query on this new post, the image will not be returned at all because it
is attached to the original post it was uploaded in. I am working with a
plugin that adds an image notes feature to the post editor and it tries to
list all images in a post on the editor but ends up listing irrelevant
images or missing images that are attached to other posts. the plugin is
knspr-imgnote if that helps. If I am wrong about this PLEASE I beg you let
me know as it will help me a great deal.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/16349>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list