wp_get_link_cats() WordPress Function
The wp_get_link_cats() function is used to get the link category objects associated with a link.
wp_get_link_cats( int $link_id ) #
Retrieves the link category IDs associated with the link specified.
Parameters
- $link_id
(int)(Required)Link ID to look up.
Return
(int[]) The IDs of the requested link's categories.
Source
File: wp-admin/includes/bookmark.php
function wp_get_link_cats( $link_id = 0 ) { $cats = wp_get_object_terms( $link_id, 'link_category', array( 'fields' => 'ids' ) ); return array_unique( $cats ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
2.1.0 | Introduced. |