[wp-testers] jpegs are turned to jpgs when thumbnailed

Otto otto at ottodestruct.com
Fri Mar 12 17:35:02 UTC 2010


On Thu, Mar 11, 2010 at 7:33 PM, Paul Robinson <pablorobinson at gmail.com> wrote:
> I would ask WordPress for the
> URL but I don't think there is a way to take a URL & find the attachment ID
> from it, is there?

get_posts and the normal post query mechanism support the meta_key and
meta_value parameters, to select posts based on their metadata. If you
look at the metadata of an attachment, you'll find things like
_wp_attached_file and _wp_attached_metadata and so forth. You could
probably use those to select and grab the post based on a URL, or part
of one.

-Otto


More information about the wp-testers mailing list