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



get_category_link › WordPress Function

Depuis1.0.0
Dépréciéen/a
get_category_link ( $category )
Paramètres:
  • (int|object) $category Category ID or object.
    Requis: Oui
Voir:
Retourne:
  • (string) Link on success, empty string if category does not exist.
Défini(e) dans:
Codex:

Retrieves category link URL.



Source

function get_category_link( $category ) {
	if ( ! is_object( $category ) ) {
		$category = (int) $category;
	}

	$category = get_term_link( $category );

	if ( is_wp_error( $category ) ) {
		return '';
	}

	return $category;
}