[wp-trac] [WordPress Trac] #33827: WP Query: Custom Post Types and Categories

WordPress Trac noreply at wordpress.org
Fri Sep 11 14:08:14 UTC 2015


#33827: WP Query: Custom Post Types and Categories
--------------------------+----------------------
 Reporter:  atomicjack    |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Query         |     Version:  4.3
 Severity:  normal        |  Resolution:  invalid
 Keywords:                |     Focuses:
--------------------------+----------------------
Changes (by boonebgorges):

 * status:  new => closed
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Comment:

 As noted by swissspidy, this seems to be a misunderstanding of
 terminology. 'cat' is short for 'category'. 'category' is a specific
 taxonomy. When you register a custom taxonomy 'product_category', this is
 *not* the same as a WP 'category'. The two are siblings (they're both
 types of taxonomies); 'product_category' is not a type of category.

 I do recommend full `WP_Tax_Query` syntax in your code, for clarity.
 However, you can also use the following shorthand:

 `'product_category=foo,bar&...'`

 where 'foo' and 'bar' are the slugs of terms in your 'product_categories'
 taxonomy.

 Thanks for the ticket!

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33827#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list