クラス WP_Query::is_category()
2014/12/16
WP_Query::is_category()
定義ファイル :/blog/wp-includes/query.php 8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | public function is_category( $category = '' ) { if ( !$this->is_category ) return false; if ( empty($category) ) return true; $cat_obj = $this->get_queried_object(); $category = (array) $category; if ( in_array( $cat_obj->term_id, $category ) ) return true; elseif ( in_array( $cat_obj->name, $category ) ) return true; elseif ( in_array( $cat_obj->slug, $category ) ) return true; return false; } |