[wp-hackers] Re: Working with Post Attachments

Scot Hacker shacker at birdhouse.org
Fri Jul 27 21:33:13 GMT 2007

> From: "Tom Sampoli" <bayportblues at gmail.com>
> I'm attempting to display post attachments depending on the
> attachment's mime type, name, size, etc and am not sure if this is
> possible without using a plugin. I see the functions discussed at
> http://mdawaffe.wordpress.com/2006/12/05/hitting-wordpress- 
> attachment-handling/,
> but without studying each function's references a great deal, I'm not
> sure how to use these. They do appear to be available within a theme.
> My searching on the codex didn't yield anything on these either - I
> may just be missing it.
> Is there something out there about doing this sort of thing? Is a
> plugin necessary? The author of this plugin,
> http://blog.designdelineations.com/2006/05/17/wordpress-plugin- 
> autolink-attachment/,
> seems to indicate that v2.1 includes the functionality that plugin
> provided, I just can't find it.

I was looking for sample code for  this kind of thing too, and also  
coming up short. Take  a look at this plugin:


It  seems to  be  doing an OK  job  of getting at some of the  
attachment info  without using the new hooks - just  by querying.  
It's pretty simple  and  you might be  able  to  modify it to  do  
what  you  need, or use it  as an example (though it would be nicer   
to use the API of course).


More information about the wp-hackers mailing list