Uses
Uses | Description |
---|---|
wp-includes/taxonomy.php: get_term_link() | Generate a permalink for a taxonomy term archive. |
wp-includes/load.php: is_wp_error() | Check whether variable is a WordPress Error. |
Retrieves category link URL.
(int|object) (Required) Category ID or object.
(string) Link on success, empty string if category does not exist.
File: wp-includes/category-template.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; }
Version | Description |
---|---|
1.0.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_category_link