This page redirects to an external site: https://developer.wordpress.org/reference/functions/get_category/
Languages: English • 한국어 • 日本語 (Add your language)
주어진 카테고리 ID 또는 카테고리 객체를 가지고 카테고리 데이터를 반환합니다.
만약 $category 매개변수에 객체를 넘기면 데이터베이스로부터 반환된 카테고리 row 객체일 것입니다.
만약 $category 매개변수에 카테고리 ID(정수)를 넘기면 데이터베이스로부터 반환된 카테고리일 것입니다. if it isn't already cached, and pass it back.
get_term()을 보면, 두 타입 모두 $filter 매개변수값을 기반으로 몇몇 필터를 거쳐 가공됩니다.
The category will converted to maintain backwards compatibility.
참고: 카테고리 ID를 근거로 카테고리 링크를 얻으려면 get_term() 을 사용하세요. get_category는 오직 포스트 타입의 카테고리만 반환합니다.
<?php get_category( $category, $output, $filter ) ?>
null 값을 반환합니다.$thisCat = get_category(get_query_var('cat'),false);
print_r($thisCat);
produces;
stdClass Object
(
[term_id] => 85
[name] => Category Name
[slug] => category-name
[term_group] => 0
[term_taxonomy_id] => 85
[taxonomy] => category
[description] =>
[parent] => 70
[count] => 0
[cat_ID] => 85
[category_count] => 0
[category_description] =>
[cat_name] => Category Name
[category_nicename] => category-name
[category_parent] => 70
)
count 속성에 커스텀 포스트 타입도 포함한 값이 됩니다.get_category() 함수는 wp-includes/category.php파일에 위치합니다.