wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



wp_get_link_cats › WordPress Function

Od2.1.0
Przestarzałyn/a
› wp_get_link_cats ( $link_id = 0 )
Parametry:
  • (int) $link_id Link ID to look up.
    Wymagane: Nie
    Domyślny: —
Powrót:
  • (int[]|WP_Error) The IDs of the requested link's categories, or else a WP_Error if the `link_category` taxonomy was unregistered.
Zdefiniowane na:
Codex:

Retrieves the link category IDs associated with the link specified.



Źródło

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 );
}