WordPress WP_Queryオブジェクトでタクソノミーに関わる項目

$wp_query->query_vars = array(
 [category_name] => slug
 [category__in]  => array(id, id,...)
 [category__and] => array(id, id,...)
 [tag__in]       => array(id, id,...)
 [tag__and]      => array(id, id,...)
 [tag_slug__in]  => array(slug, slug,...)
 [tag_slug__and] => array(slug, slug,...)
)

$wp_query->query = array(
 [taxonomy]  => slug
 [terms]     => slug
 [category_name] => path/to/category/slug
)

$wp_query->tax_query = WP_Tax_Query Object(
 queries = array(
  [0] => array(
   [taxonomy] => slug
   [term]     => array(slug, slug,...)
   [field]    => 'slug'
  ),
  [1] => array(
   :
  ),
  :
[relation] => AND ) ) $wp_query->queried_object = Object( term_id => id slug => slug name => name term_taxonomy_id => id category_nicename => slug ) $wp_query->queried_object_id = id $wp_query->request => SQL Syntax

Leave a Reply