function &get_category( $category, $output = OBJECT, $filter = 'raw' ) {}

Retrieves category data given a category ID or category object.
If you pass the $category parameter an object, which is assumed to be the category row object retrieved the database. It will cache the category data.


  • int|object $category: Category ID or Category row object
  • string $output: Optional. Constant OBJECT, ARRAY_A, or ARRAY_N
  • string $filter: Optional. Default is raw or no WordPress defined filter will applied.

Return values

returns:Category data in type defined by $output parameter.

Source code

function &get_category( $category, $output = OBJECT, $filter = 'raw' ) {

	$category = get_term( $category, 'category', $output, $filter );

	if ( is_wp_error( $category ) )

		return $category;

	_make_cat_compat( $category );

	return $category;



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: