WordPress at a glance

get_category_link() WP 1.0

Retrieve category link URL.

  • See: get_term_link()
Works based on: get_term_link()

No Hooks.

Return

String. Link on success, empty string if category does not exist.

Usage

get_category_link( $category );
$category(int/object) (required)
Category ID or object.

Code of get_category_link: wp-includes/category-template.php VER 5.0.1

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

Related Functions

From category: Categories

No comments
    Hello, !     Log In . Register