wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_get_link_cats › WordPress Function

Since2.1.0
Deprecatedn/a
wp_get_link_cats ( $link_id = 0 )
Parameters:
  • (int) $link_id Link ID to look up.
    Required: No
    Default:
Returns:
  • (int[]) The IDs of the requested link's categories.
Defined at:
Codex:

Retrieves the link category IDs associated with the link specified.



Source

function wp_get_link_cats( $link_id = 0 ) {
	$cats = wp_get_object_terms( $link_id, 'link_category', array( 'fields' => 'ids' ) );
	return array_unique( $cats );
}