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.2.1 4.2.2 4.3.0 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7 4.3.8 4.3.9 4.4.0 4.4.1 4.4.10 4.4.11 4.4.12 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 5.10 5.10.1 5.10.2 5.11 5.11.1 5.11.2 5.11.3 5.11.4 5.12 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.6.10 5.6.2 5.6.3 5.6.4 5.6.5 5.6.6 5.6.7 5.6.8 5.6.9 5.7.0 5.7.1 5.7.10 5.7.12 5.7.13 5.7.2 5.7.3 5.7.4 5.7.5 5.7.6 5.7.7 5.7.8 5.7.9 5.8.0 5.8.1 5.8.10 5.8.11 5.8.12 5.8.13 5.8.14 5.8.2 5.8.3 5.8.4
advanced-custom-fields / includes / acf-taxonomy-functions.php
advanced-custom-fields / includes Last commit date
admin 1 month ago ajax 3 months ago api 4 weeks ago fields 4 weeks ago forms 4 weeks ago legacy 5 months ago locations 1 month ago post-types 5 months ago rest-api 4 weeks ago walkers 5 months ago acf-bidirectional-functions.php 5 months ago acf-field-functions.php 5 months ago acf-field-group-functions.php 5 months ago acf-form-functions.php 5 months ago acf-helper-functions.php 5 months ago acf-hook-functions.php 5 months ago acf-input-functions.php 5 months ago acf-internal-post-type-functions.php 5 months ago acf-meta-functions.php 2 months ago acf-post-functions.php 5 months ago acf-post-type-functions.php 5 months ago acf-taxonomy-functions.php 5 months ago acf-user-functions.php 5 months ago acf-utility-functions.php 5 months ago acf-value-functions.php 5 months ago acf-wp-functions.php 5 months ago assets.php 5 months ago class-acf-data.php 5 months ago class-acf-internal-post-type.php 5 months ago compatibility.php 5 months ago deprecated.php 5 months ago fields.php 5 months ago index.php 2 years ago l10n.php 5 months ago local-fields.php 5 months ago local-json.php 3 months ago local-meta.php 5 months ago locations.php 5 months ago loop.php 5 months ago media.php 5 months ago rest-api.php 5 months ago revisions.php 3 months ago third-party.php 5 months ago upgrades.php 2 months ago validation.php 5 months ago wpml.php 5 months ago
acf-taxonomy-functions.php
273 lines
1 <?php
2 /**
3 * @package ACF
4 * @author WP Engine
5 *
6 * © 2026 Advanced Custom Fields (ACF®). All rights reserved.
7 * "ACF" is a trademark of WP Engine.
8 * Licensed under the GNU General Public License v2 or later.
9 * https://www.gnu.org/licenses/gpl-2.0.html
10 */
11
12 /**
13 * Get an ACF taxonomy as an array
14 *
15 * @param integer|string $id The post ID being queried.
16 * @return array|false The taxonomy object.
17 */
18 function acf_get_taxonomy( $id ) {
19 return acf_get_internal_post_type( $id, 'acf-taxonomy' );
20 }
21
22 /**
23 * Retrieves a raw ACF taxonomy.
24 *
25 * @since 6.1
26 *
27 * @param integer|string $id The post ID.
28 * @return array|false The taxonomy array.
29 */
30 function acf_get_raw_taxonomy( $id ) {
31 return acf_get_raw_internal_post_type( $id, 'acf-taxonomy' );
32 }
33
34 /**
35 * Gets a post object for an ACF taxonomy.
36 *
37 * @since 6.1
38 *
39 * @param integer|string $id The post ID, key, or name.
40 * @return object|boolean The post object, or false on failure.
41 */
42 function acf_get_taxonomy_post( $id ) {
43 return acf_get_internal_post_type_post( $id, 'acf-taxonomy' );
44 }
45
46 /**
47 * Returns true if the given identifier is an ACF taxonomy key.
48 *
49 * @since 6.1
50 *
51 * @param string $id The identifier.
52 * @return boolean
53 */
54 function acf_is_taxonomy_key( $id ) {
55 return acf_is_internal_post_type_key( $id, 'acf-taxonomy' );
56 }
57
58 /**
59 * Validates an ACF taxonomy.
60 *
61 * @since 6.1
62 *
63 * @param array $taxonomy The ACF taxonomy array.
64 * @return array|boolean
65 */
66 function acf_validate_taxonomy( array $taxonomy = array() ) {
67 return acf_validate_internal_post_type( $taxonomy, 'acf-taxonomy' );
68 }
69
70 /**
71 * Translates the settings for an ACF taxonomy.
72 *
73 * @since 6.1
74 *
75 * @param array $taxonomy The ACF taxonomy array.
76 * @return array
77 */
78 function acf_translate_taxonomy( array $taxonomy ) {
79 return acf_translate_internal_post_type( $taxonomy, 'acf-taxonomy' );
80 }
81
82 /**
83 * Returns an array of ACF taxonomies for the given $filter.
84 *
85 * @since 6.1
86 *
87 * @param array $filter An array of args to filter results by.
88 * @return array
89 */
90 function acf_get_acf_taxonomies( array $filter = array() ) {
91 return acf_get_internal_post_type_posts( 'acf-taxonomy', $filter );
92 }
93
94 /**
95 * Returns an array of raw ACF taxonomies.
96 *
97 * @since 6.1
98 *
99 * @return array
100 */
101 function acf_get_raw_taxonomies() {
102 return acf_get_raw_internal_post_type_posts( 'acf-taxonomy' );
103 }
104
105 /**
106 * Returns a filtered array of ACF taxonomies based on the given $args.
107 *
108 * @since 6.1
109 *
110 * @param array $taxonomies An array of ACF taxonomies.
111 * @param array $args An array of args to filter by.
112 * @return array
113 */
114 function acf_filter_taxonomies( array $taxonomies, array $args = array() ) {
115 return acf_filter_internal_post_type_posts( $taxonomies, $args, 'acf-taxonomy' );
116 }
117
118 /**
119 * Updates an ACF taxonomy in the database.
120 *
121 * @since 6.1
122 *
123 * @param array $taxonomy The main ACF taxonomy array.
124 * @return array
125 */
126 function acf_update_taxonomy( array $taxonomy ) {
127 return acf_update_internal_post_type( $taxonomy, 'acf-taxonomy' );
128 }
129
130 /**
131 * Deletes all caches for the provided ACF taxonomy.
132 *
133 * @since 6.1
134 *
135 * @param array $taxonomy The ACF taxonomy array.
136 * @return void
137 */
138 function acf_flush_taxonomy_cache( array $taxonomy ) {
139 acf_flush_internal_post_type_cache( $taxonomy, 'acf-taxonomy' );
140 }
141
142 /**
143 * Deletes an ACF taxonomy from the database.
144 *
145 * @since 6.1
146 *
147 * @param integer|string $id The ACF taxonomy ID, key or name.
148 * @return boolean True if taxonomy was deleted.
149 */
150 function acf_delete_taxonomy( $id = 0 ) {
151 return acf_delete_internal_post_type( $id, 'acf-taxonomy' );
152 }
153
154 /**
155 * Trashes an ACF taxonomy.
156 *
157 * @since 6.1
158 *
159 * @param integer|string $id The taxonomy ID, key, or name.
160 * @return boolean True if taxonomy was trashed.
161 */
162 function acf_trash_taxonomy( $id = 0 ) {
163 return acf_trash_internal_post_type( $id, 'acf-taxonomy' );
164 }
165
166 /**
167 * Restores an ACF taxonomy from the trash.
168 *
169 * @since 6.1
170 *
171 * @param integer|string $id The taxonomy ID, key, or name.
172 * @return boolean True if taxonomy was untrashed.
173 */
174 function acf_untrash_taxonomy( $id = 0 ) {
175 return acf_untrash_internal_post_type( $id, 'acf-taxonomy' );
176 }
177
178 /**
179 * Returns true if the given params match an ACF taxonomy.
180 *
181 * @since 6.1
182 *
183 * @param array $taxonomy The ACF taxonomy array.
184 * @return boolean
185 */
186 function acf_is_taxonomy( $taxonomy ) {
187 return acf_is_internal_post_type( $taxonomy, 'acf-taxonomy' );
188 }
189
190 /**
191 * Duplicates an ACF taxonomy.
192 *
193 * @since 6.1
194 *
195 * @param integer|string $id The ACF taxonomy ID, key or name.
196 * @param integer $new_post_id Optional ID to override.
197 * @return array|boolean The new ACF taxonomy, or false on failure.
198 */
199 function acf_duplicate_taxonomy( $id = 0, $new_post_id = 0 ) {
200 return acf_duplicate_internal_post_type( $id, $new_post_id, 'acf-taxonomy' );
201 }
202
203 /**
204 * Activates or deactivates an ACF taxonomy.
205 *
206 * @param integer|string $id The ACF taxonomy ID, key or name.
207 * @param boolean $activate True if the taxonomy should be activated.
208 * @return boolean
209 */
210 function acf_update_taxonomy_active_status( $id, $activate = true ) {
211 return acf_update_internal_post_type_active_status( $id, $activate, 'acf-taxonomy' );
212 }
213
214 /**
215 * Checks if the current user can edit the taxonomy and returns the edit url.
216 *
217 * @since 6.1
218 *
219 * @param integer $post_id The ACF taxonomy ID.
220 * @return string
221 */
222 function acf_get_taxonomy_edit_link( $post_id ) {
223 return acf_get_internal_post_type_edit_link( $post_id, 'acf-taxonomy' );
224 }
225
226 /**
227 * Returns a modified ACF taxonomy ready for export.
228 *
229 * @since 6.1
230 *
231 * @param array $taxonomy The ACF taxonomy array.
232 * @return array
233 */
234 function acf_prepare_taxonomy_for_export( array $taxonomy = array() ) {
235 return acf_prepare_internal_post_type_for_export( $taxonomy, 'acf-taxonomy' );
236 }
237
238 /**
239 * Exports an ACF taxonomy as PHP.
240 *
241 * @since 6.1
242 *
243 * @param array $taxonomy The ACF taxonomy array.
244 * @return string|boolean
245 */
246 function acf_export_taxonomy_as_php( array $taxonomy ) {
247 return acf_export_internal_post_type_as_php( $taxonomy, 'acf-taxonomy' );
248 }
249
250 /**
251 * Prepares an ACF taxonomy for the import process.
252 *
253 * @since 6.1
254 *
255 * @param array $taxonomy The ACF taxonomy array.
256 * @return array
257 */
258 function acf_prepare_taxonomy_for_import( array $taxonomy = array() ) {
259 return acf_prepare_internal_post_type_for_import( $taxonomy, 'acf-taxonomy' );
260 }
261
262 /**
263 * Imports an ACF taxonomy into the database.
264 *
265 * @since 6.1
266 *
267 * @param array $taxonomy The ACF taxonomy array.
268 * @return array The imported taxonomy.
269 */
270 function acf_import_taxonomy( array $taxonomy ) {
271 return acf_import_internal_post_type( $taxonomy, 'acf-taxonomy' );
272 }
273