[wp-trac] [WordPress Trac] #12306: Custom attachment types

WordPress Trac wp-trac at lists.automattic.com
Sat Feb 20 17:17:32 UTC 2010


#12306: Custom attachment types
-------------------------+--------------------------------------------------
 Reporter:  jfarthing84  |       Owner:                               
     Type:  enhancement  |      Status:  new                          
 Priority:  normal       |   Milestone:  Unassigned                   
Component:  Media        |     Version:  3.0                          
 Severity:  normal       |    Keywords:  developer-feedback, has-patch
-------------------------+--------------------------------------------------
 I am testing using custom post types as custom attachment types and it
 seems that the only blockade is the function wp_get_attachment_url(). Here
 is why:

 {{{
 if ( 'attachment' != $post->post_type || empty($url) )
         return false;
 }}}

 So, my proposal is to either allow a filter to supply valid attachment
 types instead of checking against 'attachment' or (the better method) use
 the 'inherit_type' argument from within the register_post_type function
 and check for an 'inherit_type' of 'attachment'.

 I will attach my implementation of both methods, and the developers can
 choose which one to use.

 The only other problem is that many parts of the query have 'attachment'
 hardcoded in, but, you can get around this with filters. However, my
 proposal introduces a simple solution to have this fully built-in (check
 for inherit_type of 'attachment').

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12306>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list