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
Parameters Parameters
- $id
-
(int) (Required) The category to get. If no category supplied uses 0
Return Return
(string)
Source Source
File: wp-includes/deprecated.php
1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 | 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; } |
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
2.1.0 | Use get_category() |
0.71 | Introduced. |