wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema



wp_get_link_cats › WordPress Function

Desde2.1.0
Obsoleton/a
› wp_get_link_cats ( $link_id = 0 )
Parâmetros:
  • (int) $link_id Link ID to look up.
    Required: No
    Padrão: —
Retorna:
  • (int[]|WP_Error) The IDs of the requested link's categories, or else a WP_Error if the `link_category` taxonomy was unregistered.
Definido em:
Codex:

Retrieves the link category IDs associated with the link specified.



Fonte

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