Opened 4 years ago
Closed 4 years ago
#47806 closed defect (bug) (fixed)
The get_term_link returns a URL but it's @return and name lead you to believe it's returning an HTML link
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.3 | Priority: | normal |
Severity: | normal | Version: | 2.5 |
Component: | Taxonomy | Keywords: | has-patch |
Focuses: | Cc: |
Description
Hello,
I went to use the get_term_link
function after reading the documentation and was confused by it returning a URL and not an HTML link as it was indicated. The function name also leads you to believe it'll be a link returned and not a URL.
<?php /** * Generate a permalink for a taxonomy term archive. * * @since 2.5.0 * * @global WP_Rewrite $wp_rewrite * * @param object|int|string $term The term object, ID, or slug whose link will be retrieved. * @param string $taxonomy Optional. Taxonomy. Default empty. * @return string|WP_Error HTML link to taxonomy term archive on success, WP_Error if term does not exist. */ function get_term_link( $term, $taxonomy = '' ) {
I doubt renaming the function is viable due to back-compat but it would be nice at least to correct the php docblock to indicate the return is a URL and not an HTML Link.
Thanks
Attachments (1)
Change History (4)
Note: See
TracTickets for help on using
tickets.
Updated phpdocblock to replace
HTML Link
verbiage withURL