1 | <?php |
||
35 | class Taxonomy extends Type |
||
36 | { |
||
37 | /** |
||
38 | * Taxonomy Constructor. |
||
39 | * |
||
40 | * @param object $taxonomy The taxonomy object |
||
41 | * |
||
42 | * @throws NonExistentTaxonomyException |
||
43 | */ |
||
44 | public function __construct($taxonomy) |
||
52 | |||
53 | /** |
||
54 | * Create a new instance using the taxonomy identifier. |
||
55 | * |
||
56 | * @param string $identifier Taxonomy name/identifier |
||
57 | * |
||
58 | * @throws InvalidTaxonomyNameException |
||
59 | * |
||
60 | * @return static|Builder |
||
61 | */ |
||
62 | public static function make($identifier) |
||
74 | |||
75 | /** |
||
76 | * Create a new instance from an existing taxonomy. |
||
77 | * |
||
78 | * @param string $identifier The taxonomy identifier |
||
79 | * |
||
80 | * @throws NonExistentTaxonomyException |
||
81 | * |
||
82 | * @return static |
||
83 | */ |
||
84 | public static function load($identifier) |
||
92 | |||
93 | /** |
||
94 | * Check if the given taxonomy exists. |
||
95 | * |
||
96 | * @param string $id The taxonomy key/identifier |
||
97 | * |
||
98 | * @return bool |
||
99 | */ |
||
100 | public static function exists($id) |
||
104 | |||
105 | /** |
||
106 | * Start a new query for terms of this taxonomy. |
||
107 | * |
||
108 | * @return QueryBuilder |
||
109 | */ |
||
110 | public function terms() |
||
114 | |||
115 | /** |
||
116 | * Get all post types associated with this taxonomy. |
||
117 | * |
||
118 | * @return Collection |
||
119 | */ |
||
120 | public function postTypes() |
||
127 | |||
128 | /** |
||
129 | * Unregister the taxonomy. |
||
130 | * |
||
131 | * @throws NonExistentTaxonomyException |
||
132 | * @throws WP_ErrorException |
||
133 | * |
||
134 | * @return $this |
||
135 | */ |
||
136 | public function unregister() |
||
148 | } |
||
149 |