wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



get_linkcatname › WordPress Function

Da0.71
Deprecato2.1.0
get_linkcatname ( $id = 0 )
Parametri:
  • (int) $id The category to get. If no category supplied uses 0
    Richiesto: No
    Default:
Vedi:
Ritorna:
  • (string)
Definito a:
Codex:

Gets the name of category by ID.



Sorgenti

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