Advertisements

get_category

Definition:
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.

Parameters

  • 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;

}

1242

Advertisements

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:

WordPress.com Logo

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

Google+ photo

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

Twitter picture

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

Facebook photo

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

Connecting to %s

%d bloggers like this: