add return URL to terms #310

This commit is contained in:
vnmedeiros 2019-10-11 11:01:59 -03:00
parent 207b1ac0ec
commit b5c08852a3
1 changed files with 10 additions and 0 deletions

View File

@ -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
/**