PluginProbe ʕ •ᴥ•ʔ
Advanced Custom Fields (ACF®) / 6.8.9
Advanced Custom Fields (ACF®) v6.8.9
6.8.9 6.8.8 6.8.7 6.8.6 6.8.5 6.8.4 6.8.3 6.8.2 6.8.1 5.8.5 5.8.6 5.8.7 5.8.8 5.8.9 5.9.0 5.9.1 5.9.2 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9 6.0.0 6.0.1 6.0.2 6.0.3 6.0.4 6.0.5 6.0.6 6.0.7 6.1.0 6.1.1 6.1.2 6.1.3 6.1.4 6.1.5 6.1.6 6.1.7 6.1.8 6.2.0 6.2.1 6.2.2 6.2.3 6.2.4 6.2.5 6.2.6 6.2.6.1 6.2.7 6.2.8 6.2.9 6.3.0 6.3.1 6.3.10.2 6.3.11 6.3.12 6.3.2 6.3.3 6.3.4 6.3.5 6.3.6 6.3.6.1 6.4.0 6.4.0.1 6.4.1 6.4.2 6.4.3 6.5.0 6.5.1 6.6.0 6.6.1 6.6.2 6.7.0 6.7.1 6.7.2 6.8.0 trunk 1.0.0 1.0.2 1.0.3 1.0.5 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.1.1 2.1.3 2.1.4 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.6 3.0.7 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.5.0 3.5.1 3.5.2 3.5.3 3.5.4 3.5.5 3.5.6 3.5.7 3.5.8 4.0.0 4.0.1 4.0.2 4.0.3 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.8 4.2.0 4.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 / fields / class-acf-field-icon_picker.php
advanced-custom-fields / includes / fields Last commit date
class-acf-field-accordion.php 5 months ago class-acf-field-button-group.php 5 months ago class-acf-field-checkbox.php 2 months ago class-acf-field-color_picker.php 5 months ago class-acf-field-date_picker.php 5 months ago class-acf-field-date_time_picker.php 5 months ago class-acf-field-email.php 5 months ago class-acf-field-file.php 5 months ago class-acf-field-google-map.php 5 months ago class-acf-field-group.php 5 months ago class-acf-field-icon_picker.php 6 months ago class-acf-field-image.php 1 month ago class-acf-field-link.php 5 months ago class-acf-field-message.php 6 months ago class-acf-field-number.php 5 months ago class-acf-field-oembed.php 2 months ago class-acf-field-output.php 6 months ago class-acf-field-page_link.php 1 month ago class-acf-field-password.php 5 months ago class-acf-field-post_object.php 1 month ago class-acf-field-radio.php 2 months ago class-acf-field-range.php 5 months ago class-acf-field-relationship.php 1 month ago class-acf-field-select.php 2 months ago class-acf-field-separator.php 6 months ago class-acf-field-tab.php 6 months ago class-acf-field-taxonomy.php 2 months ago class-acf-field-text.php 5 months ago class-acf-field-textarea.php 5 months ago class-acf-field-time_picker.php 5 months ago class-acf-field-true_false.php 5 months ago class-acf-field-url.php 5 months ago class-acf-field-user.php 2 months ago class-acf-field-wysiwyg.php 5 months ago class-acf-field.php 5 months ago index.php 2 years ago
class-acf-field-icon_picker.php
840 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 if ( ! class_exists( 'acf_field_icon_picker' ) ) :
13
14 /**
15 * Class acf_field_icon_picker.
16 */
17 class acf_field_icon_picker extends acf_field {
18 /**
19 * Initialize icon picker field
20 *
21 * @since 6.3
22 *
23 * @return void
24 */
25 public function initialize() {
26 $this->name = 'icon_picker';
27 $this->label = __( 'Icon Picker', 'acf' );
28 $this->public = true;
29 $this->category = 'advanced';
30 $this->description = __( 'An interactive UI for selecting an icon. Select from Dashicons, the media library, or a standalone URL input.', 'acf' );
31 $this->preview_image = acf_get_url() . '/assets/images/field-type-previews/field-preview-icon-picker.png';
32 $this->doc_url = acf_add_url_utm_tags( 'https://www.advancedcustomfields.com/resources/icon-picker/', 'docs', 'field-type-selection' );
33 $this->defaults = array(
34 'library' => 'all',
35 'tabs' => array_keys( $this->get_tabs() ),
36 'return_format' => 'string',
37 'default_value' => array(
38 'type' => null,
39 'value' => null,
40 ),
41 );
42 }
43
44 /**
45 * Gets the available tabs for the icon picker field.
46 *
47 * @since 6.3
48 *
49 * @return array
50 */
51 public function get_tabs() {
52 $tabs = array(
53 'dashicons' => esc_html__( 'Dashicons', 'acf' ),
54 );
55
56 if ( current_user_can( 'upload_files' ) ) {
57 $tabs['media_library'] = esc_html__( 'Media Library', 'acf' );
58 }
59
60 $tabs['url'] = esc_html__( 'URL', 'acf' );
61
62 /**
63 * Allows filtering the tabs used by the icon picker.
64 *
65 * @since 6.3
66 *
67 * @param array $tabs An associative array of tabs in key => label format.
68 * @return array
69 */
70 return apply_filters( 'acf/fields/icon_picker/tabs', $tabs );
71 }
72
73 /**
74 * Renders an icon list tab (i.e. dashicons, custom icons).
75 *
76 * @since 6.4
77 *
78 * @param string $tab_name The name of the tab being rendered.
79 * @param array $field The Icon Picker field being rendered.
80 * @return void
81 */
82 public function render_icon_list_tab( $tab_name, $field ) {
83 $custom_icons = '';
84
85 if ( 'dashicons' !== $tab_name ) {
86 $custom_icons = apply_filters( 'acf/fields/icon_picker/' . $tab_name . '/icons', array(), $field );
87
88 // Bail if this is a custom tab and no icons are provided.
89 if ( ! is_array( $custom_icons ) || empty( $custom_icons ) ) {
90 return;
91 }
92 }
93 ?>
94 <div class="acf-icon-list-search-wrap">
95 <?php
96 acf_text_input(
97 array(
98 'class' => 'acf-icon-list-search-input',
99 'placeholder' => esc_html__( 'Search icons...', 'acf' ),
100 'type' => 'search',
101 )
102 );
103 ?>
104 </div>
105 <div
106 class="acf-icon-list"
107 role="radiogroup"
108 data-parent-tab="<?php echo esc_attr( $tab_name ); ?>"
109 <?php if ( ! empty( $custom_icons ) ) : ?>
110 <?php printf( 'data-icons="%s"', esc_attr( wp_json_encode( $custom_icons ) ) ); ?>
111 <?php endif; ?>
112 ></div>
113 <div class="acf-icon-list-empty">
114 <img src="<?php echo esc_url( acf_get_url( 'assets/images/face-sad.svg' ) ); ?>" />
115 <p class="acf-no-results-text">
116 <?php
117 printf(
118 /* translators: %s: The invalid search term */
119 esc_html__( "No search results for '%s'", 'acf' ),
120 '<span class="acf-invalid-icon-list-search-term"></span>'
121 );
122 ?>
123 </p>
124 </div>
125 <?php
126 }
127
128 /**
129 * Renders icon picker field
130 *
131 * @since 6.3
132 *
133 * @param object $field The ACF Field
134 * @return void
135 */
136 public function render_field( $field ) {
137 $uploader = acf_get_setting( 'uploader' );
138
139 // Enqueue uploader scripts
140 if ( $uploader === 'wp' ) {
141 acf_enqueue_uploader();
142 }
143
144 $div = array(
145 'id' => $field['id'],
146 'class' => $field['class'] . ' acf-icon-picker',
147 );
148
149 echo '<div ' . acf_esc_attrs( $div ) . '>';
150
151 acf_hidden_input(
152 array(
153 'name' => $field['name'] . '[type]',
154 'value' => $field['value']['type'],
155 'data-hidden-type' => 'type',
156 )
157 );
158 acf_hidden_input(
159 array(
160 'name' => $field['name'] . '[value]',
161 'value' => $field['value']['value'],
162 'data-hidden-type' => 'value',
163 )
164 );
165
166 if ( ! is_array( $field['tabs'] ) ) {
167 $field['tabs'] = array();
168 }
169
170 $tabs = $this->get_tabs();
171 $shown = array_filter(
172 $tabs,
173 function ( $tab ) use ( $field ) {
174 return in_array( $tab, $field['tabs'], true );
175 },
176 ARRAY_FILTER_USE_KEY
177 );
178
179 foreach ( $shown as $name => $label ) {
180 if ( count( $shown ) > 1 ) {
181 acf_render_field_wrap(
182 array(
183 'type' => 'tab',
184 'label' => $label,
185 'key' => 'acf_icon_picker_tabs',
186 'selected' => $name === $field['value']['type'],
187 'unique_tab_key' => $name,
188 )
189 );
190 }
191
192 $wrapper_class = str_replace( '_', '-', $name );
193 echo '<div class="acf-icon-picker-tabs acf-icon-picker-' . esc_attr( $wrapper_class ) . '-tabs" data-tab="' . esc_attr( $name ) . '">';
194
195 switch ( $name ) {
196 case 'dashicons':
197 $this->render_icon_list_tab( $name, $field );
198 break;
199 case 'media_library':
200 ?>
201 <div class="acf-icon-picker-tab" data-category="<?php echo esc_attr( $name ); ?>">
202 <div class="acf-icon-picker-media-library">
203 <?php
204 $button_style = 'display: none;';
205
206 if ( in_array( $field['value']['type'], array( 'media_library', 'dashicons' ), true ) && ! empty( $field['value']['value'] ) ) {
207 $button_style = '';
208 }
209 ?>
210 <button
211 aria-label="<?php esc_attr_e( 'Click to change the icon in the Media Library', 'acf' ); ?>"
212 class="acf-icon-picker-media-library-preview"
213 style="<?php echo esc_attr( $button_style ); ?>"
214 >
215 <div class="acf-icon-picker-media-library-preview-img" style="<?php echo esc_attr( 'media_library' !== $field['value']['type'] ? 'display: none;' : '' ); ?>">
216 <?php
217 $img_url = wp_get_attachment_image_url( $field['value']['value'], 'thumbnail' );
218 // If the type is media_library, then we need to show the media library preview.
219 ?>
220 <img src="<?php echo esc_url( $img_url ); ?>" alt="<?php esc_attr_e( 'The currently selected image preview', 'acf' ); ?>" />
221 </div>
222 <div class="acf-icon-picker-media-library-preview-dashicon" style="<?php echo esc_attr( 'dashicons' !== $field['value']['type'] ? 'display: none;' : '' ); ?>">
223 <div class="dashicons <?php echo esc_attr( $field['value']['value'] ); ?>">
224 </div>
225 </div>
226 </button>
227 <button class="acf-icon-picker-media-library-button">
228 <div class="acf-icon-picker-media-library-button-icon dashicons dashicons-admin-media"></div>
229 <span><?php esc_html_e( 'Browse Media Library', 'acf' ); ?></span>
230 </button>
231 </div>
232 </div>
233 <?php
234 break;
235 case 'url':
236 echo '<div class="acf-icon-picker-url">';
237 acf_text_input(
238 array(
239 'class' => 'acf-icon_url',
240 'value' => $field['value']['type'] === 'url' ? $field['value']['value'] : '',
241 )
242 );
243
244 // Helper Text
245 ?>
246 <p class="description"><?php esc_html_e( 'The URL to the icon you\'d like to use, or svg as Data URI', 'acf' ); ?></p>
247 <?php
248 echo '</div>';
249 break;
250 default:
251 do_action( 'acf/fields/icon_picker/tab/' . $name, $field );
252 $this->render_icon_list_tab( $name, $field );
253 }
254
255 echo '</div>';
256 }
257
258 echo '</div>';
259 }
260
261 /**
262 * Renders field settings for the icon picker field.
263 *
264 * @since 6.3
265 *
266 * @param array $field The icon picker field object.
267 * @return void
268 */
269 public function render_field_settings( $field ) {
270 acf_render_field_setting(
271 $field,
272 array(
273 'label' => __( 'Tabs', 'acf' ),
274 'instructions' => __( 'Select where content editors can choose the icon from.', 'acf' ),
275 'type' => 'checkbox',
276 'name' => 'tabs',
277 'choices' => $this->get_tabs(),
278 )
279 );
280
281 $return_format_doc = sprintf(
282 '<a href="%s" target="_blank">%s</a>',
283 acf_add_url_utm_tags( 'https://www.advancedcustomfields.com/resources/icon-picker/', 'docs', 'icon-picker-return-format' ),
284 __( 'Learn More', 'acf' )
285 );
286
287 $return_format_instructions = sprintf(
288 /* translators: %s - link to documentation */
289 __( 'Specify the return format for the icon. %s', 'acf' ),
290 $return_format_doc
291 );
292
293 acf_render_field_setting(
294 $field,
295 array(
296 'label' => __( 'Return Format', 'acf' ),
297 'instructions' => $return_format_instructions,
298 'type' => 'radio',
299 'name' => 'return_format',
300 'choices' => array(
301 'string' => __( 'String', 'acf' ),
302 'array' => __( 'Array', 'acf' ),
303 ),
304 'layout' => 'horizontal',
305 )
306 );
307 }
308
309 /**
310 * Localizes text for Icon Picker
311 *
312 * @since 6.3
313 *
314 * @return void
315 */
316 public function input_admin_enqueue_scripts() {
317 acf_localize_data(
318 array(
319 'iconPickerA11yStrings' => array(
320 'noResultsForSearchTerm' => esc_html__( 'No results found for that search term', 'acf' ),
321 'newResultsFoundForSearchTerm' => esc_html__( 'The available icons matching your search query have been updated in the icon picker below.', 'acf' ),
322 ),
323 'iconPickeri10n' => $this->get_dashicons(),
324 )
325 );
326 }
327
328 /**
329 * Validates the field value before it is saved into the database.
330 *
331 * @since 6.3
332 *
333 * @param integer $valid The current validation status.
334 * @param mixed $value The value of the field.
335 * @param array $field The field array holding all the field options.
336 * @param string $input The corresponding input name for $_POST value.
337 * @return boolean true If the value is valid, false if not.
338 */
339 public function validate_value( $valid, $value, $field, $input ) {
340 // If the value is empty and it's not required, return true. You're allowed to save nothing.
341 if ( empty( $value ) && empty( $field['required'] ) ) {
342 return true;
343 }
344
345 // Validate required.
346 if ( $field['required'] && ( empty( $value ) || empty( $value['value'] ) ) ) {
347 return false;
348 }
349
350 // If the value is not an array, return $valid status.
351 if ( ! is_array( $value ) ) {
352 return $valid;
353 }
354
355 // If the value is an array, but the type is not set, fail validation.
356 if ( ! isset( $value['type'] ) ) {
357 return __( 'Icon picker requires an icon type.', 'acf' );
358 }
359
360 // If the value is an array, but the value is not set, fail validation.
361 if ( ! isset( $value['value'] ) ) {
362 return __( 'Icon picker requires a value.', 'acf' );
363 }
364
365 return true;
366 }
367
368 /**
369 * format_value()
370 *
371 * This filter is appied to the $value after it is loaded from the db and before it is returned to the template
372 *
373 * @since 6.3
374 *
375 * @param mixed $value The value which was loaded from the database.
376 * @param integer $post_id The $post_id from which the value was loaded.
377 * @param array $field The field array holding all the field options.
378 * @return mixed $value The modified value.
379 */
380 public function format_value( $value, $post_id, $field ) {
381 // Handle empty values.
382 if ( empty( $value ) ) {
383 // Return the default value if there is one.
384 if ( isset( $field['default_value'] ) ) {
385 return $field['default_value'];
386 } else {
387 // Otherwise return false.
388 return false;
389 }
390 }
391
392 // If media_library, behave the same as an image field.
393 if ( $value['type'] === 'media_library' ) {
394 // convert to int
395 $value['value'] = intval( $value['value'] );
396
397 // format
398 if ( $field['return_format'] === 'string' ) {
399 return wp_get_attachment_url( $value['value'] );
400 } elseif ( $field['return_format'] === 'array' ) {
401 $value['value'] = acf_get_attachment( $value['value'] );
402 return $value;
403 }
404 }
405
406 // If the desired return format is a string
407 if ( $field['return_format'] === 'string' ) {
408 return $value['value'];
409 }
410
411 // If nothing specific matched the return format, just return the value.
412 return $value;
413 }
414
415 /**
416 * get_dashicons()
417 *
418 * This function will return an array of dashicons.
419 *
420 * @since 6.3
421 *
422 * @return array $dashicons an array of dashicons.
423 */
424 public function get_dashicons() {
425 $dashicons = array(
426 'dashicons-admin-appearance' => esc_html__( 'Appearance Icon', 'acf' ),
427 'dashicons-admin-collapse' => esc_html__( 'Collapse Icon', 'acf' ),
428 'dashicons-admin-comments' => esc_html__( 'Comments Icon', 'acf' ),
429 'dashicons-admin-customizer' => esc_html__( 'Customizer Icon', 'acf' ),
430 'dashicons-admin-generic' => esc_html__( 'Generic Icon', 'acf' ),
431 'dashicons-admin-home' => esc_html__( 'Home Icon', 'acf' ),
432 'dashicons-admin-links' => esc_html__( 'Links Icon', 'acf' ),
433 'dashicons-admin-media' => esc_html__( 'Media Icon', 'acf' ),
434 'dashicons-admin-multisite' => esc_html__( 'Multisite Icon', 'acf' ),
435 'dashicons-admin-network' => esc_html__( 'Network Icon', 'acf' ),
436 'dashicons-admin-page' => esc_html__( 'Page Icon', 'acf' ),
437 'dashicons-admin-plugins' => esc_html__( 'Plugins Icon', 'acf' ),
438 'dashicons-admin-post' => esc_html__( 'Post Icon', 'acf' ),
439 'dashicons-admin-settings' => esc_html__( 'Settings Icon', 'acf' ),
440 'dashicons-admin-site' => esc_html__( 'Site Icon', 'acf' ),
441 'dashicons-admin-site-alt' => esc_html__( 'Site (alt) Icon', 'acf' ),
442 'dashicons-admin-site-alt2' => esc_html__( 'Site (alt2) Icon', 'acf' ),
443 'dashicons-admin-site-alt3' => esc_html__( 'Site (alt3) Icon', 'acf' ),
444 'dashicons-admin-tools' => esc_html__( 'Tools Icon', 'acf' ),
445 'dashicons-admin-users' => esc_html__( 'Users Icon', 'acf' ),
446 'dashicons-airplane' => esc_html__( 'Airplane Icon', 'acf' ),
447 'dashicons-album' => esc_html__( 'Album Icon', 'acf' ),
448 'dashicons-align-center' => esc_html__( 'Align Center Icon', 'acf' ),
449 'dashicons-align-full-width' => esc_html__( 'Align Full Width Icon', 'acf' ),
450 'dashicons-align-left' => esc_html__( 'Align Left Icon', 'acf' ),
451 'dashicons-align-none' => esc_html__( 'Align None Icon', 'acf' ),
452 'dashicons-align-pull-left' => esc_html__( 'Align Pull Left Icon', 'acf' ),
453 'dashicons-align-pull-right' => esc_html__( 'Align Pull Right Icon', 'acf' ),
454 'dashicons-align-right' => esc_html__( 'Align Right Icon', 'acf' ),
455 'dashicons-align-wide' => esc_html__( 'Align Wide Icon', 'acf' ),
456 'dashicons-amazon' => esc_html__( 'Amazon Icon', 'acf' ),
457 'dashicons-analytics' => esc_html__( 'Analytics Icon', 'acf' ),
458 'dashicons-archive' => esc_html__( 'Archive Icon', 'acf' ),
459 'dashicons-arrow-down' => esc_html__( 'Arrow Down Icon', 'acf' ),
460 'dashicons-arrow-down-alt' => esc_html__( 'Arrow Down (alt) Icon', 'acf' ),
461 'dashicons-arrow-down-alt2' => esc_html__( 'Arrow Down (alt2) Icon', 'acf' ),
462 'dashicons-arrow-left' => esc_html__( 'Arrow Left Icon', 'acf' ),
463 'dashicons-arrow-left-alt' => esc_html__( 'Arrow Left (alt) Icon', 'acf' ),
464 'dashicons-arrow-left-alt2' => esc_html__( 'Arrow Left (alt2) Icon', 'acf' ),
465 'dashicons-arrow-right' => esc_html__( 'Arrow Right Icon', 'acf' ),
466 'dashicons-arrow-right-alt' => esc_html__( 'Arrow Right (alt) Icon', 'acf' ),
467 'dashicons-arrow-right-alt2' => esc_html__( 'Arrow Right (alt2) Icon', 'acf' ),
468 'dashicons-arrow-up' => esc_html__( 'Arrow Up Icon', 'acf' ),
469 'dashicons-arrow-up-alt' => esc_html__( 'Arrow Up (alt) Icon', 'acf' ),
470 'dashicons-arrow-up-alt2' => esc_html__( 'Arrow Up (alt2) Icon', 'acf' ),
471 'dashicons-art' => esc_html__( 'Art Icon', 'acf' ),
472 'dashicons-awards' => esc_html__( 'Awards Icon', 'acf' ),
473 'dashicons-backup' => esc_html__( 'Backup Icon', 'acf' ),
474 'dashicons-bank' => esc_html__( 'Bank Icon', 'acf' ),
475 'dashicons-beer' => esc_html__( 'Beer Icon', 'acf' ),
476 'dashicons-bell' => esc_html__( 'Bell Icon', 'acf' ),
477 'dashicons-block-default' => esc_html__( 'Block Default Icon', 'acf' ),
478 'dashicons-book' => esc_html__( 'Book Icon', 'acf' ),
479 'dashicons-book-alt' => esc_html__( 'Book (alt) Icon', 'acf' ),
480 'dashicons-buddicons-activity' => esc_html__( 'Activity Icon', 'acf' ),
481 'dashicons-buddicons-bbpress-logo' => esc_html__( 'bbPress Icon', 'acf' ),
482 'dashicons-buddicons-buddypress-logo' => esc_html__( 'BuddyPress Icon', 'acf' ),
483 'dashicons-buddicons-community' => esc_html__( 'Community Icon', 'acf' ),
484 'dashicons-buddicons-forums' => esc_html__( 'Forums Icon', 'acf' ),
485 'dashicons-buddicons-friends' => esc_html__( 'Friends Icon', 'acf' ),
486 'dashicons-buddicons-groups' => esc_html__( 'Groups Icon', 'acf' ),
487 'dashicons-buddicons-pm' => esc_html__( 'PM Icon', 'acf' ),
488 'dashicons-buddicons-replies' => esc_html__( 'Replies Icon', 'acf' ),
489 'dashicons-buddicons-topics' => esc_html__( 'Topics Icon', 'acf' ),
490 'dashicons-buddicons-tracking' => esc_html__( 'Tracking Icon', 'acf' ),
491 'dashicons-building' => esc_html__( 'Building Icon', 'acf' ),
492 'dashicons-businessman' => esc_html__( 'Businessman Icon', 'acf' ),
493 'dashicons-businessperson' => esc_html__( 'Businessperson Icon', 'acf' ),
494 'dashicons-businesswoman' => esc_html__( 'Businesswoman Icon', 'acf' ),
495 'dashicons-button' => esc_html__( 'Button Icon', 'acf' ),
496 'dashicons-calculator' => esc_html__( 'Calculator Icon', 'acf' ),
497 'dashicons-calendar' => esc_html__( 'Calendar Icon', 'acf' ),
498 'dashicons-calendar-alt' => esc_html__( 'Calendar (alt) Icon', 'acf' ),
499 'dashicons-camera' => esc_html__( 'Camera Icon', 'acf' ),
500 'dashicons-camera-alt' => esc_html__( 'Camera (alt) Icon', 'acf' ),
501 'dashicons-car' => esc_html__( 'Car Icon', 'acf' ),
502 'dashicons-carrot' => esc_html__( 'Carrot Icon', 'acf' ),
503 'dashicons-cart' => esc_html__( 'Cart Icon', 'acf' ),
504 'dashicons-category' => esc_html__( 'Category Icon', 'acf' ),
505 'dashicons-chart-area' => esc_html__( 'Chart Area Icon', 'acf' ),
506 'dashicons-chart-bar' => esc_html__( 'Chart Bar Icon', 'acf' ),
507 'dashicons-chart-line' => esc_html__( 'Chart Line Icon', 'acf' ),
508 'dashicons-chart-pie' => esc_html__( 'Chart Pie Icon', 'acf' ),
509 'dashicons-clipboard' => esc_html__( 'Clipboard Icon', 'acf' ),
510 'dashicons-clock' => esc_html__( 'Clock Icon', 'acf' ),
511 'dashicons-cloud' => esc_html__( 'Cloud Icon', 'acf' ),
512 'dashicons-cloud-saved' => esc_html__( 'Cloud Saved Icon', 'acf' ),
513 'dashicons-cloud-upload' => esc_html__( 'Cloud Upload Icon', 'acf' ),
514 'dashicons-code-standards' => esc_html__( 'Code Standards Icon', 'acf' ),
515 'dashicons-coffee' => esc_html__( 'Coffee Icon', 'acf' ),
516 'dashicons-color-picker' => esc_html__( 'Color Picker Icon', 'acf' ),
517 'dashicons-columns' => esc_html__( 'Columns Icon', 'acf' ),
518 'dashicons-controls-back' => esc_html__( 'Back Icon', 'acf' ),
519 'dashicons-controls-forward' => esc_html__( 'Forward Icon', 'acf' ),
520 'dashicons-controls-pause' => esc_html__( 'Pause Icon', 'acf' ),
521 'dashicons-controls-play' => esc_html__( 'Play Icon', 'acf' ),
522 'dashicons-controls-repeat' => esc_html__( 'Repeat Icon', 'acf' ),
523 'dashicons-controls-skipback' => esc_html__( 'Skip Back Icon', 'acf' ),
524 'dashicons-controls-skipforward' => esc_html__( 'Skip Forward Icon', 'acf' ),
525 'dashicons-controls-volumeoff' => esc_html__( 'Volume Off Icon', 'acf' ),
526 'dashicons-controls-volumeon' => esc_html__( 'Volume On Icon', 'acf' ),
527 'dashicons-cover-image' => esc_html__( 'Cover Image Icon', 'acf' ),
528 'dashicons-dashboard' => esc_html__( 'Dashboard Icon', 'acf' ),
529 'dashicons-database' => esc_html__( 'Database Icon', 'acf' ),
530 'dashicons-database-add' => esc_html__( 'Database Add Icon', 'acf' ),
531 'dashicons-database-export' => esc_html__( 'Database Export Icon', 'acf' ),
532 'dashicons-database-import' => esc_html__( 'Database Import Icon', 'acf' ),
533 'dashicons-database-remove' => esc_html__( 'Database Remove Icon', 'acf' ),
534 'dashicons-database-view' => esc_html__( 'Database View Icon', 'acf' ),
535 'dashicons-desktop' => esc_html__( 'Desktop Icon', 'acf' ),
536 'dashicons-dismiss' => esc_html__( 'Dismiss Icon', 'acf' ),
537 'dashicons-download' => esc_html__( 'Download Icon', 'acf' ),
538 'dashicons-drumstick' => esc_html__( 'Drumstick Icon', 'acf' ),
539 'dashicons-edit' => esc_html__( 'Edit Icon', 'acf' ),
540 'dashicons-edit-large' => esc_html__( 'Edit Large Icon', 'acf' ),
541 'dashicons-edit-page' => esc_html__( 'Edit Page Icon', 'acf' ),
542 'dashicons-editor-aligncenter' => esc_html__( 'Align Center Icon', 'acf' ),
543 'dashicons-editor-alignleft' => esc_html__( 'Align Left Icon', 'acf' ),
544 'dashicons-editor-alignright' => esc_html__( 'Align Right Icon', 'acf' ),
545 'dashicons-editor-bold' => esc_html__( 'Bold Icon', 'acf' ),
546 'dashicons-editor-break' => esc_html__( 'Break Icon', 'acf' ),
547 'dashicons-editor-code' => esc_html__( 'Code Icon', 'acf' ),
548 'dashicons-editor-contract' => esc_html__( 'Contract Icon', 'acf' ),
549 'dashicons-editor-customchar' => esc_html__( 'Custom Character Icon', 'acf' ),
550 'dashicons-editor-expand' => esc_html__( 'Expand Icon', 'acf' ),
551 'dashicons-editor-help' => esc_html__( 'Help Icon', 'acf' ),
552 'dashicons-editor-indent' => esc_html__( 'Indent Icon', 'acf' ),
553 'dashicons-editor-insertmore' => esc_html__( 'Insert More Icon', 'acf' ),
554 'dashicons-editor-italic' => esc_html__( 'Italic Icon', 'acf' ),
555 'dashicons-editor-justify' => esc_html__( 'Justify Icon', 'acf' ),
556 'dashicons-editor-kitchensink' => esc_html__( 'Kitchen Sink Icon', 'acf' ),
557 'dashicons-editor-ltr' => esc_html__( 'LTR Icon', 'acf' ),
558 'dashicons-editor-ol' => esc_html__( 'Ordered List Icon', 'acf' ),
559 'dashicons-editor-ol-rtl' => esc_html__( 'Ordered List RTL Icon', 'acf' ),
560 'dashicons-editor-outdent' => esc_html__( 'Outdent Icon', 'acf' ),
561 'dashicons-editor-paragraph' => esc_html__( 'Paragraph Icon', 'acf' ),
562 'dashicons-editor-paste-text' => esc_html__( 'Paste Text Icon', 'acf' ),
563 'dashicons-editor-paste-word' => esc_html__( 'Paste Word Icon', 'acf' ),
564 'dashicons-editor-quote' => esc_html__( 'Quote Icon', 'acf' ),
565 'dashicons-editor-removeformatting' => esc_html__( 'Remove Formatting Icon', 'acf' ),
566 'dashicons-editor-rtl' => esc_html__( 'RTL Icon', 'acf' ),
567 'dashicons-editor-spellcheck' => esc_html__( 'Spellcheck Icon', 'acf' ),
568 'dashicons-editor-strikethrough' => esc_html__( 'Strikethrough Icon', 'acf' ),
569 'dashicons-editor-table' => esc_html__( 'Table Icon', 'acf' ),
570 'dashicons-editor-textcolor' => esc_html__( 'Text Color Icon', 'acf' ),
571 'dashicons-editor-ul' => esc_html__( 'Unordered List Icon', 'acf' ),
572 'dashicons-editor-underline' => esc_html__( 'Underline Icon', 'acf' ),
573 'dashicons-editor-unlink' => esc_html__( 'Unlink Icon', 'acf' ),
574 'dashicons-editor-video' => esc_html__( 'Video Icon', 'acf' ),
575 'dashicons-ellipsis' => esc_html__( 'Ellipsis Icon', 'acf' ),
576 'dashicons-email' => esc_html__( 'Email Icon', 'acf' ),
577 'dashicons-email-alt' => esc_html__( 'Email (alt) Icon', 'acf' ),
578 'dashicons-email-alt2' => esc_html__( 'Email (alt2) Icon', 'acf' ),
579 'dashicons-embed-audio' => esc_html__( 'Embed Audio Icon', 'acf' ),
580 'dashicons-embed-generic' => esc_html__( 'Embed Generic Icon', 'acf' ),
581 'dashicons-embed-photo' => esc_html__( 'Embed Photo Icon', 'acf' ),
582 'dashicons-embed-post' => esc_html__( 'Embed Post Icon', 'acf' ),
583 'dashicons-embed-video' => esc_html__( 'Embed Video Icon', 'acf' ),
584 'dashicons-excerpt-view' => esc_html__( 'Excerpt View Icon', 'acf' ),
585 'dashicons-exit' => esc_html__( 'Exit Icon', 'acf' ),
586 'dashicons-external' => esc_html__( 'External Icon', 'acf' ),
587 'dashicons-facebook' => esc_html__( 'Facebook Icon', 'acf' ),
588 'dashicons-facebook-alt' => esc_html__( 'Facebook (alt) Icon', 'acf' ),
589 'dashicons-feedback' => esc_html__( 'Feedback Icon', 'acf' ),
590 'dashicons-filter' => esc_html__( 'Filter Icon', 'acf' ),
591 'dashicons-flag' => esc_html__( 'Flag Icon', 'acf' ),
592 'dashicons-food' => esc_html__( 'Food Icon', 'acf' ),
593 'dashicons-format-aside' => esc_html__( 'Aside Icon', 'acf' ),
594 'dashicons-format-audio' => esc_html__( 'Audio Icon', 'acf' ),
595 'dashicons-format-chat' => esc_html__( 'Chat Icon', 'acf' ),
596 'dashicons-format-gallery' => esc_html__( 'Gallery Icon', 'acf' ),
597 'dashicons-format-image' => esc_html__( 'Image Icon', 'acf' ),
598 'dashicons-format-quote' => esc_html__( 'Quote Icon', 'acf' ),
599 'dashicons-format-status' => esc_html__( 'Status Icon', 'acf' ),
600 'dashicons-format-video' => esc_html__( 'Video Icon', 'acf' ),
601 'dashicons-forms' => esc_html__( 'Forms Icon', 'acf' ),
602 'dashicons-fullscreen-alt' => esc_html__( 'Fullscreen (alt) Icon', 'acf' ),
603 'dashicons-fullscreen-exit-alt' => esc_html__( 'Fullscreen Exit (alt) Icon', 'acf' ),
604 'dashicons-games' => esc_html__( 'Games Icon', 'acf' ),
605 'dashicons-google' => esc_html__( 'Google Icon', 'acf' ),
606 'dashicons-grid-view' => esc_html__( 'Grid View Icon', 'acf' ),
607 'dashicons-groups' => esc_html__( 'Groups Icon', 'acf' ),
608 'dashicons-hammer' => esc_html__( 'Hammer Icon', 'acf' ),
609 'dashicons-heading' => esc_html__( 'Heading Icon', 'acf' ),
610 'dashicons-heart' => esc_html__( 'Heart Icon', 'acf' ),
611 'dashicons-hidden' => esc_html__( 'Hidden Icon', 'acf' ),
612 'dashicons-hourglass' => esc_html__( 'Hourglass Icon', 'acf' ),
613 'dashicons-html' => esc_html__( 'HTML Icon', 'acf' ),
614 'dashicons-id' => esc_html__( 'ID Icon', 'acf' ),
615 'dashicons-id-alt' => esc_html__( 'ID (alt) Icon', 'acf' ),
616 'dashicons-image-crop' => esc_html__( 'Crop Icon', 'acf' ),
617 'dashicons-image-filter' => esc_html__( 'Filter Icon', 'acf' ),
618 'dashicons-image-flip-horizontal' => esc_html__( 'Flip Horizontal Icon', 'acf' ),
619 'dashicons-image-flip-vertical' => esc_html__( 'Flip Vertical Icon', 'acf' ),
620 'dashicons-image-rotate' => esc_html__( 'Rotate Icon', 'acf' ),
621 'dashicons-image-rotate-left' => esc_html__( 'Rotate Left Icon', 'acf' ),
622 'dashicons-image-rotate-right' => esc_html__( 'Rotate Right Icon', 'acf' ),
623 'dashicons-images-alt' => esc_html__( 'Images (alt) Icon', 'acf' ),
624 'dashicons-images-alt2' => esc_html__( 'Images (alt2) Icon', 'acf' ),
625 'dashicons-index-card' => esc_html__( 'Index Card Icon', 'acf' ),
626 'dashicons-info' => esc_html__( 'Info Icon', 'acf' ),
627 'dashicons-info-outline' => esc_html__( 'Info Outline Icon', 'acf' ),
628 'dashicons-insert' => esc_html__( 'Insert Icon', 'acf' ),
629 'dashicons-insert-after' => esc_html__( 'Insert After Icon', 'acf' ),
630 'dashicons-insert-before' => esc_html__( 'Insert Before Icon', 'acf' ),
631 'dashicons-instagram' => esc_html__( 'Instagram Icon', 'acf' ),
632 'dashicons-laptop' => esc_html__( 'Laptop Icon', 'acf' ),
633 'dashicons-layout' => esc_html__( 'Layout Icon', 'acf' ),
634 'dashicons-leftright' => esc_html__( 'Left Right Icon', 'acf' ),
635 'dashicons-lightbulb' => esc_html__( 'Lightbulb Icon', 'acf' ),
636 'dashicons-linkedin' => esc_html__( 'LinkedIn Icon', 'acf' ),
637 'dashicons-list-view' => esc_html__( 'List View Icon', 'acf' ),
638 'dashicons-location' => esc_html__( 'Location Icon', 'acf' ),
639 'dashicons-location-alt' => esc_html__( 'Location (alt) Icon', 'acf' ),
640 'dashicons-lock' => esc_html__( 'Lock Icon', 'acf' ),
641 'dashicons-marker' => esc_html__( 'Marker Icon', 'acf' ),
642 'dashicons-media-archive' => esc_html__( 'Archive Icon', 'acf' ),
643 'dashicons-media-audio' => esc_html__( 'Audio Icon', 'acf' ),
644 'dashicons-media-code' => esc_html__( 'Code Icon', 'acf' ),
645 'dashicons-media-default' => esc_html__( 'Default Icon', 'acf' ),
646 'dashicons-media-document' => esc_html__( 'Document Icon', 'acf' ),
647 'dashicons-media-interactive' => esc_html__( 'Interactive Icon', 'acf' ),
648 'dashicons-media-spreadsheet' => esc_html__( 'Spreadsheet Icon', 'acf' ),
649 'dashicons-media-text' => esc_html__( 'Text Icon', 'acf' ),
650 'dashicons-media-video' => esc_html__( 'Video Icon', 'acf' ),
651 'dashicons-megaphone' => esc_html__( 'Megaphone Icon', 'acf' ),
652 'dashicons-menu' => esc_html__( 'Menu Icon', 'acf' ),
653 'dashicons-menu-alt' => esc_html__( 'Menu (alt) Icon', 'acf' ),
654 'dashicons-menu-alt2' => esc_html__( 'Menu (alt2) Icon', 'acf' ),
655 'dashicons-menu-alt3' => esc_html__( 'Menu (alt3) Icon', 'acf' ),
656 'dashicons-microphone' => esc_html__( 'Microphone Icon', 'acf' ),
657 'dashicons-migrate' => esc_html__( 'Migrate Icon', 'acf' ),
658 'dashicons-minus' => esc_html__( 'Minus Icon', 'acf' ),
659 'dashicons-money' => esc_html__( 'Money Icon', 'acf' ),
660 'dashicons-money-alt' => esc_html__( 'Money (alt) Icon', 'acf' ),
661 'dashicons-move' => esc_html__( 'Move Icon', 'acf' ),
662 'dashicons-nametag' => esc_html__( 'Nametag Icon', 'acf' ),
663 'dashicons-networking' => esc_html__( 'Networking Icon', 'acf' ),
664 'dashicons-no' => esc_html__( 'No Icon', 'acf' ),
665 'dashicons-no-alt' => esc_html__( 'No (alt) Icon', 'acf' ),
666 'dashicons-open-folder' => esc_html__( 'Open Folder Icon', 'acf' ),
667 'dashicons-palmtree' => esc_html__( 'Palm Tree Icon', 'acf' ),
668 'dashicons-paperclip' => esc_html__( 'Paperclip Icon', 'acf' ),
669 'dashicons-pdf' => esc_html__( 'PDF Icon', 'acf' ),
670 'dashicons-performance' => esc_html__( 'Performance Icon', 'acf' ),
671 'dashicons-pets' => esc_html__( 'Pets Icon', 'acf' ),
672 'dashicons-phone' => esc_html__( 'Phone Icon', 'acf' ),
673 'dashicons-pinterest' => esc_html__( 'Pinterest Icon', 'acf' ),
674 'dashicons-playlist-audio' => esc_html__( 'Playlist Audio Icon', 'acf' ),
675 'dashicons-playlist-video' => esc_html__( 'Playlist Video Icon', 'acf' ),
676 'dashicons-plugins-checked' => esc_html__( 'Plugins Checked Icon', 'acf' ),
677 'dashicons-plus' => esc_html__( 'Plus Icon', 'acf' ),
678 'dashicons-plus-alt' => esc_html__( 'Plus (alt) Icon', 'acf' ),
679 'dashicons-plus-alt2' => esc_html__( 'Plus (alt2) Icon', 'acf' ),
680 'dashicons-podio' => esc_html__( 'Podio Icon', 'acf' ),
681 'dashicons-portfolio' => esc_html__( 'Portfolio Icon', 'acf' ),
682 'dashicons-post-status' => esc_html__( 'Post Status Icon', 'acf' ),
683 'dashicons-pressthis' => esc_html__( 'Pressthis Icon', 'acf' ),
684 'dashicons-printer' => esc_html__( 'Printer Icon', 'acf' ),
685 'dashicons-privacy' => esc_html__( 'Privacy Icon', 'acf' ),
686 'dashicons-products' => esc_html__( 'Products Icon', 'acf' ),
687 'dashicons-randomize' => esc_html__( 'Randomize Icon', 'acf' ),
688 'dashicons-reddit' => esc_html__( 'Reddit Icon', 'acf' ),
689 'dashicons-redo' => esc_html__( 'Redo Icon', 'acf' ),
690 'dashicons-remove' => esc_html__( 'Remove Icon', 'acf' ),
691 'dashicons-rest-api' => esc_html__( 'REST API Icon', 'acf' ),
692 'dashicons-rss' => esc_html__( 'RSS Icon', 'acf' ),
693 'dashicons-saved' => esc_html__( 'Saved Icon', 'acf' ),
694 'dashicons-schedule' => esc_html__( 'Schedule Icon', 'acf' ),
695 'dashicons-screenoptions' => esc_html__( 'Screen Options Icon', 'acf' ),
696 'dashicons-search' => esc_html__( 'Search Icon', 'acf' ),
697 'dashicons-share' => esc_html__( 'Share Icon', 'acf' ),
698 'dashicons-share-alt' => esc_html__( 'Share (alt) Icon', 'acf' ),
699 'dashicons-share-alt2' => esc_html__( 'Share (alt2) Icon', 'acf' ),
700 'dashicons-shield' => esc_html__( 'Shield Icon', 'acf' ),
701 'dashicons-shield-alt' => esc_html__( 'Shield (alt) Icon', 'acf' ),
702 'dashicons-shortcode' => esc_html__( 'Shortcode Icon', 'acf' ),
703 'dashicons-slides' => esc_html__( 'Slides Icon', 'acf' ),
704 'dashicons-smartphone' => esc_html__( 'Smartphone Icon', 'acf' ),
705 'dashicons-smiley' => esc_html__( 'Smiley Icon', 'acf' ),
706 'dashicons-sort' => esc_html__( 'Sort Icon', 'acf' ),
707 'dashicons-sos' => esc_html__( 'Sos Icon', 'acf' ),
708 'dashicons-spotify' => esc_html__( 'Spotify Icon', 'acf' ),
709 'dashicons-star-empty' => esc_html__( 'Star Empty Icon', 'acf' ),
710 'dashicons-star-filled' => esc_html__( 'Star Filled Icon', 'acf' ),
711 'dashicons-star-half' => esc_html__( 'Star Half Icon', 'acf' ),
712 'dashicons-sticky' => esc_html__( 'Sticky Icon', 'acf' ),
713 'dashicons-store' => esc_html__( 'Store Icon', 'acf' ),
714 'dashicons-superhero' => esc_html__( 'Superhero Icon', 'acf' ),
715 'dashicons-superhero-alt' => esc_html__( 'Superhero (alt) Icon', 'acf' ),
716 'dashicons-table-col-after' => esc_html__( 'Table Col After Icon', 'acf' ),
717 'dashicons-table-col-before' => esc_html__( 'Table Col Before Icon', 'acf' ),
718 'dashicons-table-col-delete' => esc_html__( 'Table Col Delete Icon', 'acf' ),
719 'dashicons-table-row-after' => esc_html__( 'Table Row After Icon', 'acf' ),
720 'dashicons-table-row-before' => esc_html__( 'Table Row Before Icon', 'acf' ),
721 'dashicons-table-row-delete' => esc_html__( 'Table Row Delete Icon', 'acf' ),
722 'dashicons-tablet' => esc_html__( 'Tablet Icon', 'acf' ),
723 'dashicons-tag' => esc_html__( 'Tag Icon', 'acf' ),
724 'dashicons-tagcloud' => esc_html__( 'Tagcloud Icon', 'acf' ),
725 'dashicons-testimonial' => esc_html__( 'Testimonial Icon', 'acf' ),
726 'dashicons-text' => esc_html__( 'Text Icon', 'acf' ),
727 'dashicons-text-page' => esc_html__( 'Text Page Icon', 'acf' ),
728 'dashicons-thumbs-down' => esc_html__( 'Thumbs Down Icon', 'acf' ),
729 'dashicons-thumbs-up' => esc_html__( 'Thumbs Up Icon', 'acf' ),
730 'dashicons-tickets' => esc_html__( 'Tickets Icon', 'acf' ),
731 'dashicons-tickets-alt' => esc_html__( 'Tickets (alt) Icon', 'acf' ),
732 'dashicons-tide' => esc_html__( 'Tide Icon', 'acf' ),
733 'dashicons-translation' => esc_html__( 'Translation Icon', 'acf' ),
734 'dashicons-trash' => esc_html__( 'Trash Icon', 'acf' ),
735 'dashicons-twitch' => esc_html__( 'Twitch Icon', 'acf' ),
736 'dashicons-twitter' => esc_html__( 'Twitter Icon', 'acf' ),
737 'dashicons-twitter-alt' => esc_html__( 'Twitter (alt) Icon', 'acf' ),
738 'dashicons-undo' => esc_html__( 'Undo Icon', 'acf' ),
739 'dashicons-universal-access' => esc_html__( 'Universal Access Icon', 'acf' ),
740 'dashicons-universal-access-alt' => esc_html__( 'Universal Access (alt) Icon', 'acf' ),
741 'dashicons-unlock' => esc_html__( 'Unlock Icon', 'acf' ),
742 'dashicons-update' => esc_html__( 'Update Icon', 'acf' ),
743 'dashicons-update-alt' => esc_html__( 'Update (alt) Icon', 'acf' ),
744 'dashicons-upload' => esc_html__( 'Upload Icon', 'acf' ),
745 'dashicons-vault' => esc_html__( 'Vault Icon', 'acf' ),
746 'dashicons-video-alt' => esc_html__( 'Video (alt) Icon', 'acf' ),
747 'dashicons-video-alt2' => esc_html__( 'Video (alt2) Icon', 'acf' ),
748 'dashicons-video-alt3' => esc_html__( 'Video (alt3) Icon', 'acf' ),
749 'dashicons-visibility' => esc_html__( 'Visibility Icon', 'acf' ),
750 'dashicons-warning' => esc_html__( 'Warning Icon', 'acf' ),
751 'dashicons-welcome-add-page' => esc_html__( 'Add Page Icon', 'acf' ),
752 'dashicons-welcome-comments' => esc_html__( 'Comments Icon', 'acf' ),
753 'dashicons-welcome-learn-more' => esc_html__( 'Learn More Icon', 'acf' ),
754 'dashicons-welcome-view-site' => esc_html__( 'View Site Icon', 'acf' ),
755 'dashicons-welcome-widgets-menus' => esc_html__( 'Widgets Menus Icon', 'acf' ),
756 'dashicons-welcome-write-blog' => esc_html__( 'Write Blog Icon', 'acf' ),
757 'dashicons-whatsapp' => esc_html__( 'WhatsApp Icon', 'acf' ),
758 'dashicons-wordpress' => esc_html__( 'WordPress Icon', 'acf' ),
759 'dashicons-wordpress-alt' => esc_html__( 'WordPress (alt) Icon', 'acf' ),
760 'dashicons-xing' => esc_html__( 'Xing Icon', 'acf' ),
761 'dashicons-yes' => esc_html__( 'Yes Icon', 'acf' ),
762 'dashicons-yes-alt' => esc_html__( 'Yes (alt) Icon', 'acf' ),
763 'dashicons-youtube' => esc_html__( 'YouTube Icon', 'acf' ),
764 );
765
766 return apply_filters( 'acf/fields/icon_picker/dashicons', $dashicons );
767 }
768
769 /**
770 * Returns the schema used by the REST API.
771 *
772 * @since 6.3
773 *
774 * @param array $field The main field array.
775 * @return array
776 */
777 public function get_rest_schema( array $field ): array {
778 return array(
779 'type' => array( 'object', 'null' ),
780 'required' => ! empty( $field['required'] ),
781 'properties' => array(
782 'type' => array(
783 'description' => esc_html__( 'The type of icon to save.', 'acf' ),
784 'type' => array( 'string' ),
785 'required' => true,
786 'enum' => array_keys( $this->get_tabs() ),
787 ),
788 'value' => array(
789 'description' => esc_html__( 'The value of icon to save.', 'acf' ),
790 'type' => array( 'string', 'int' ),
791 'required' => true,
792 ),
793 ),
794 );
795 }
796
797 /**
798 * Validates a value sent via the REST API.
799 *
800 * @since 6.3
801 *
802 * @param boolean $valid The current validity boolean.
803 * @param array|null $value The value of the field.
804 * @param array $field The main field array.
805 * @return boolean|WP_Error
806 */
807 public function validate_rest_value( $valid, $value, $field ) {
808 if ( is_null( $value ) ) {
809 if ( ! empty( $field['required'] ) ) {
810 return new WP_Error(
811 'rest_property_required',
812 /* translators: %s - field name */
813 sprintf( __( '%s is a required property of acf.', 'acf' ), $field['name'] )
814 );
815 } else {
816 return $valid;
817 }
818 }
819
820 if ( ! empty( $value['type'] ) && 'media_library' === $value['type'] ) {
821 $param = sprintf( '%s[%s][value]', $field['prefix'], $field['name'] );
822 $data = array(
823 'param' => $param,
824 'value' => (int) $value['value'],
825 );
826
827 if ( ! is_int( $value['value'] ) || 'attachment' !== get_post_type( $value['value'] ) ) {
828 /* translators: %s - field/param name */
829 $error = sprintf( __( '%s requires a valid attachment ID when type is set to media_library.', 'acf' ), $param );
830 return new WP_Error( 'rest_invalid_param', $error, $data );
831 }
832 }
833
834 return $valid;
835 }
836 }
837
838 acf_register_field_type( 'acf_field_icon_picker' );
839 endif;
840