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

get_linkcatname() WordPress Function

The get_linkcatname() WordPress function retrieves the name of a link category. This function can be used with any link category, including the default link categories.

get_linkcatname( int $id ) #

Gets the name of category by ID.


Description

Top ↑

See also


Top ↑

Parameters

$id

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


Top ↑

Return

(string)


Top ↑

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
VersionDescription
2.1.0Use get_category()
0.71Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More