[wp-hackers] Adding built in taxonomies to custom post types

Andrew Nacin wp at andrewnacin.com
Wed Jul 7 22:45:27 UTC 2010


On Wed, Jul 7, 2010 at 6:05 PM, Jake Goldman <
wphackers at jakemgold.myfastmail.com> wrote:

>  Anybody here have any luck adding the built in taxonomies (post_tags,
> category) to a custom taxonomy?


Using the taxonomies argument is the same as calling
register_taxonomy_for_object_type(). (Mike pointed this out, though from the
iPad mixed the name up.) The key is that the taxonomy already has to be
registered. It's half cart-before-the-horse, half chicken-or-the-egg.

As long as you're waiting until the init hook (core registers taxonomies and
post types at priority 0), then you should be fine.


More information about the wp-hackers mailing list