We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7251828 commit 28f1213Copy full SHA for 28f1213
src/Terms/Term.php
@@ -13,6 +13,7 @@ class Term
13
public string $name = '';
14
public string $slug = '';
15
public string $description = '';
16
+ public string $url = '';
17
public self $parent;
18
19
public function __construct(int $id, string $taxonomy)
@@ -29,6 +30,7 @@ public function withAll()
29
30
->withName()
31
->withSlug()
32
->withDescription()
33
+ ->withUrl()
34
->withParent();
35
36
return $this;
@@ -55,6 +57,13 @@ public function withDescription()
55
57
56
58
}
59
60
+ public function withUrl()
61
+ {
62
+ $this->url = \get_term_link($this->WP_Term);
63
+
64
+ return $this;
65
+ }
66
67
public function withParent()
68
{
69
$this->parent = new self($this->WP_Term->parent, $this->taxonomy);
0 commit comments