wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



wp_get_link_cats › WordPress Function

Depuis2.1.0
Dépréciéen/a
wp_get_link_cats ( $link_id = 0 )
Paramètres:
  • (int) $link_id Link ID to look up.
    Requis: Non
    Défaut:
Retourne:
  • (int[]) The IDs of the requested link's categories.
Défini(e) dans:
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 );
}