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



get_category_link › WordPress Function

Od1.0.0
Przestarzałyn/a
get_category_link ( $category )
Parametry:
  • (int|object) $category Category ID or object.
    Wymagane: Tak
Zobacz:
Powrót:
  • (string) Link on success, empty string if category does not exist.
Zdefiniowane na:
Codex:

Retrieves category link URL.



Źródło

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