[wp-hackers] wp_get_attachment_url() checking for attachment post_type, really necessary?

Otto otto at ottodestruct.com
Fri Nov 12 16:02:51 UTC 2010


On Fri, Nov 12, 2010 at 8:36 AM, Leo germani <leogermani at gmail.com> wrote:
> Ok. This is how it worked so far.
>
> But I think we can think of a new way to llok at it. We have now the
> possibility to create new post types, we could have new 'attachment post
> types'. For instance: 'portfolio image' and 'clipping'.
>
> This could be an option in register_post_type().
>
> Dont you think it would be usefull?

No, that's not useful. An attachment is an attachment. Giving it a
different post_type name doesn't make it functionally different, it
just breaks all the assumptions in the core code.

You're using post_types wrong. A post_type describes the type of the
item, not a categorization of it. A "portfolio image" and a "clipping"
are both still attachments so you don't need a separate post_type for
them.

If you want to have different ways of categorizing things, then you
should use categories, or tags, or a custom taxonomy. Custom
post_types define what things actually are. Custom taxonomies are
there to sort them into different buckets.

-Otto


More information about the wp-hackers mailing list