function get_cat_name( $cat_id ) {}

Retrieve the name of a category from its ID.


  • int $cat_id: Category ID

Return values

returns:Category name, or an empty string if category doesn’t exist.

Source code

function get_cat_name( $cat_id ) {

	$cat_id = (int) $cat_id;

	$category = &get_category( $cat_id );

	if ( ! $category || is_wp_error( $category ) )

		return '';

	return $category->name;



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: