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

Jake Goldman wphackers at jakemgold.myfastmail.com
Wed Jul 7 23:13:59 UTC 2010


  I'll put it inside of an init hook, but this strikes me as peculiar. I 
can confirm that the taxonomy exists and has been registered right above 
the post type registration via get_taxonomy('category')...

(I write this from Rhode Island, where it's 95 degrees, and my AC died 
today, so it's quite possible my brain has simply melted :-P )

Jake

On 7/7/2010 6:45 PM, Andrew Nacin wrote:
> 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.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers


More information about the wp-hackers mailing list