[wp-hackers] get_categories() add post type to arguments?

Mike Little wordpress at zed1.com
Tue Apr 2 09:45:17 UTC 2013

On 1 April 2013 18:04, Radi Varbanov <aparoph at gmail.com> wrote:

> My problem is not with taxonomies, but post types.
> Does it make sense?
Are you saying that you have post categories assigned to posts and to a
custom post type? And that you want to use get_categories() to retrieve the
categories for the custom post type?

If so, you are probably not using them correctly. If categories apply to
both posts and a custom post type, it doesn't make sense to request a list
of just the ones assigned to a particular post type.

And if some category terms only apply to the custom post type, then you
probably should have created a custom taxonomy for that custom post type.
Then get_categories() could be used to retrieve the terms for just that
custom post type via it's custom taxonomy.

Mike Little

More information about the wp-hackers mailing list