From b5c08852a38b2d3a5ecf65c456ba3c0de1a8a2e1 Mon Sep 17 00:00:00 2001 From: vnmedeiros Date: Fri, 11 Oct 2019 11:01:59 -0300 Subject: [PATCH] add return URL to terms #310 --- src/classes/entities/class-tainacan-term.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/classes/entities/class-tainacan-term.php b/src/classes/entities/class-tainacan-term.php index 13c245e1a..972885ff6 100644 --- a/src/classes/entities/class-tainacan-term.php +++ b/src/classes/entities/class-tainacan-term.php @@ -145,6 +145,16 @@ class Term extends Entity { return wp_get_attachment_url( $this->get_header_image_id() ); } + /** + * @return false|string + */ + function get_url(){ + $url = get_term_link( $this->get_id() ); + if (is_wp_error($url)) + return ""; + return $url; + } + // Setters /**