Never realized you could do that, thanks Otto. I'll give that a shot. :)
Would be a lot better than guessing.

On 12 March 2010 17:35, Otto <[email protected]> wrote:

> On Thu, Mar 11, 2010 at 7:33 PM, Paul Robinson <[email protected]>
> 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
> _______________________________________________
> wp-testers mailing list
> [email protected]
> http://lists.automattic.com/mailman/listinfo/wp-testers
>
_______________________________________________
wp-testers mailing list
[email protected]
http://lists.automattic.com/mailman/listinfo/wp-testers

Reply via email to