Hello,
Thanks for the feedback!
ACF Extended enqueues the builtin CodeMirror library from the WP core (see core documentation) on Post Types admin pages for the ACFE Code Editor field. This logic is inherited from the native ACF behavior. Here, the Post Type admin page is elementor_snippet
.
It looks like since a recent patch, Elementor isn’t compatible with that library, which is probably an oversight since it’s a core WP feature.
I would recommend to send a ticket to Elementor and let them know that when a user enqueue the builtin WordPress Code Editor library (Codemirror) in the admin, it breaks their “Custom Code” module.
Here is a code you can attach to your ticket. It can be used in the functions.php
file in order to reproduce the issue consistently (blank WP install + Elementor, without ACF/ACFE, just this code):
add_action('admin_enqueue_scripts', 'my_enqueue_script');
function my_enqueue_script(){
wp_enqueue_script('code-editor');
}
While waiting for the official Elementor patch, here is a code you can paste in your functions.php
file in order to fix the issue:
add_action('admin_enqueue_scripts', 'my_fix_elementor_custom_code_library', 25);
function my_fix_elementor_custom_code_library(){
global $typenow;
// dequeue code-editor on elementor snippet post type
if($typenow === 'elementor_snippet'){
wp_dequeue_script('code-editor');
}
}
Hope it helps!
Have a nice day!
Regards.