Select2 и Acf WP отсутствуют option, как проявить?
Хочу добавить возможность поисковика для селекта плагина ACF WordPress. После инициализации поисковая строка добавляется, но option отсутсвуют. При нажатии на селект выдает ошибку в консоль
load-scripts.php?c=1…p-hooks&ver=6.7.2:2 jQuery.Deferred exception: Cannot read properties of undefined (reading 'slice') TypeError: Cannot read properties of undefined (reading 'slice')
at e.removePlaceholder (.../wp-content/plugins/advanced-custom-fields/assets/inc/select2/4/select2.full.min.js?ver=4.0.13:1:43521)
at r.removePlaceholder (.../wp-content/plugins/advanced-custom-fields/assets/inc/select2/4/select2.full.min.js?ver=4.0.13:1:3306)
at e.append (.../wp-content/plugins/advanced-custom-fields/assets/inc/select2/4/select2.full.min.js?ver=4.0.13:1:43327)
at r.append (.../wp-content/plugins/advanced-custom-fields/assets/inc/select2/4/select2.full.min.js?ver=4.0.13:1:3306)
at a. (.../wp-content/plugins/advanced-custom-fields/assets/inc/select2/4/select2.full.min.js?ver=4.0.13:1:8890)
at e.invoke (.../wp-content/plugins/advanced-custom-fields/assets/inc/select2/4/select2.full.min.js?ver=4.0.13:1:3881)
at e.trigger (.../wp-content/plugins/advanced-custom-fields/assets/inc/select2/4/select2.full.min.js?ver=4.0.13:1:3700)
at a.trigger (.../wp-content/plugins/advanced-custom-fields/assets/inc/select2/4/select2.full.min.js?ver=4.0.13:1:63872)
at .../wp-content/plugins/advanced-custom-fields/assets/inc/select2/4/select2.full.min.js?ver=4.0.13:1:62177
at Object. (.../wp-content/plugins/advanced-custom-fields/assets/inc/select2/4/select2.full.min.js?ver=4.0.13:1:36926) undefined
Код инициализации function.php
add_action('acf/input/admin_footer', function() { ?>
<script type="text/javascript">
(function($) {
acf.add_action('ready append', function($el) {
$('#acf-field_67d7d8a3a32d1').select2({
minimumResultsForSearch: 0 // Всегда показывать поле поиска
});
});
})(jQuery);
</script>