get_linkcatname()

最后更新于:2021-11-26 09:15:37

get_linkcatname( int$id)

Gets the name of category by ID.

参数

$id

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

响应

(string)

源文件

文件: gc-includes/deprecated.php

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

	$id = (int) $id;

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

	$cats = gc_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;
}