[wp-trac] [WordPress Trac] #16349: return list of images actually being used in post
WordPress Trac
wp-trac at lists.automattic.com
Sun Jan 23 05:39:28 UTC 2011
#16349: return list of images actually being used in post
--------------------------------------+-----------------------
Reporter: mcmasterp | Owner:
Type: feature request | Status: reopened
Priority: normal | Milestone:
Component: Media | Version: 3.0.4
Severity: normal | Resolution:
Keywords: image, attachment, query |
--------------------------------------+-----------------------
Comment (by mikeschinkel):
Replying to [comment:3 mcmasterp]:
> I think it would be very useful to plugin and theme developers to be
able to return a list of ALL the images on a post(not just the first) and
use them in their plugin in the admin section. the plugin I gave as an
example shows in the post editor a list of images from the post, except if
you have added then removed an image it still shows in the list,
conversely if you add an image that you already added to another post it
won't show up in the list. This is a deficiency with the WP core code. the
problem is that the WP core only tracks an images attachment to the first
post it is added to.
+1
Replying to [comment:5 scribu]:
> Also, what would be the benefit of this? besides the example you gave,
which isn't clear why it would be useful, by the way.
This would enable a plugin author to write image image management tools
that would actually know where the images are used. It would allow a
developer to write SQL scripts to remove image records that are not needed
yet keep ones that are. There are at least 3 distinct places in a recent
project where I could have used this functionality. It's like asking why
it's important to have a `post_id` field in wp_postmeta; without it data
integrity is a challenge. I'm really surprised the use-cases are not more
obvious.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/16349#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list