WPDev.one
Core Function
View Source on Trac ↗

get_the_category()

get_the_category( mixed $post_id = false )

Retrieves post categories.

Parameters 0 required

Name / Type Description
$post_id
int

Optional. The post ID. Defaults to current post ID.

Return Value

(WP_Term[])
Array of WP_Term objects, one for each category assigned to the post.

Function Information

Since Version
0.71
Source File
wp-includes/category-template.php
Advertisement