wpseek.com
WordPress开发者和主题制作者的搜索引擎



wp_get_link_cats › WordPress Function

Since2.1.0
已弃用n/a
wp_get_link_cats ( $link_id = 0 )
参数:
  • (int) $link_id Link ID to look up.
    Required: No
    默认:
返回:
  • (int[]) The IDs of the requested link's categories.
定义在:
文档:

Retrieves the link category IDs associated with the link specified.



源码

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