Definition:
function get_the_category( $id = false ) {}
Retrieve post categories.
Parameters
- int $id: Optional, default to current post ID. The post ID.
Defined filters
- get_the_categories
apply_filters( 'get_the_categories', $categories )
Source code
function get_the_category( $id = false ) { $categories = get_the_terms( $id, 'category' ); if ( ! $categories ) $categories = array(); $categories = array_values( $categories ); foreach ( array_keys( $categories ) as $key ) { _make_cat_compat( $categories[$key] ); } // Filter name is plural because we return alot of categories (possibly more than #13237) not just one return apply_filters( 'get_the_categories', $categories ); }
1815
No comments yet... Be the first to leave a reply!