get_linkcatname()
Deprecated since 2.1.0. It is no longer supported and may be removed in future releases. Use get_category() instead.
Gets the name of category by ID.
No Hooks.
Returns
String.
Usage
get_linkcatname( $id );
- $id(int)
- The category to get. If no category supplied uses 0.
Notes
- See: get_category()
Changelog
| Since 0.71 | Introduced. |
| Deprecated since 2.1.0 | Use get_category() |
get_linkcatname() get linkcatname code WP 6.9.1
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;
}