Warning: This function has been deprecated. Use get_category() instead.

get_linkcatname( int $id )

Gets the name of category by ID.


Description Description

See also See also


Top ↑

Parameters Parameters

$id

(int) (Required) The category to get. If no category supplied uses 0


Top ↑

Return Return

(string)


Top ↑

Source Source

File: wp-includes/deprecated.php

function get_linkcatname($id = 0) {
	_deprecated_function( __FUNCTION__, '2.1.0', 'get_category()' );

	$id = (int) $id;

	if ( empty($id) )
		return '';

	$cats = wp_get_link_cats($id);

	if ( empty($cats) || ! is_array($cats) )
		return '';

	$cat_id = (int) $cats[0]; // Take the first cat.

	$cat = get_category($cat_id);
	return $cat->name;
}


Top ↑

Changelog Changelog

Changelog
Version Description
2.1.0 Use get_category()
0.71 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.