• The plugin loads Select2 version 4.0.3, but sets its version number as 3.5.4 when registering the script. This causes a conflict with Advanced Custom Fields Pro plugin.

    ACF Pro checks for Select2 scripts registered by other plugins and loads styles for Select2 V3 if it detects that version. This causes V3 styles to be loaded while Select2 is initialized using V4 and the styles look broken in admin.

    As a temporary workaround I created this script to fix the conflict, but it would be nice to have this fixed in the plugin itself:

    add_action('acf/input/admin_enqueue_scripts', 'modify_ess_select2_version', 9);
    function modify_ess_select2_version() {
        global $wp_scripts;
    
        // Modify ESS Select2 version to fix style conflicts with ACF Pro
        if (
            !empty($wp_scripts->registered['select2']) && 
            strpos($wp_scripts->registered['select2']->src, 'easy-social-sharing') !== false && 
            strpos($wp_scripts->registered['select2']->ver, '3.') == 0) {
            $wp_scripts->registered['select2']->ver = '4.0.3';
        }
    }
    
  • The topic ‘ESS v1.3.6 causes Select2 style conflict with ACF Pro plugin.’ is closed to new replies.