codepress / admin-columns-issues

Issues for Admin Columns Pro
https://www.admincolumns.com/
11 stars 0 forks source link

JS error when ACP is active in combination Imagify #1232

Closed DGStefan closed 5 years ago

DGStefan commented 5 years ago

Seems to be related to the Search feature in Admin Columns Pro

DGStefan commented 5 years ago

It seems that there's a conflict between the Querybuilder plugin we use and the Jquery move plugin that is available in the Imagify plugin. Since both plugins are third-party plugins and required, we cannot change anything in our code to fix this code.

I wrote a snippet that disables the 'event-move' plugin on Table overviews since this plugin is not required on that page as far as I can see. This is not something that we will implement in our plugin though. This workaround can easily be implemented in a custom theme or plugin file.


add_action( 'in_admin_footer', function () {
    if ( ! class_exists( 'Imagify_Assets' ) || ! class_exists( 'AC\Screen' ) ) {
        return;
    }

    $screen = new AC\Screen();
    $screen->set_screen( get_current_screen() );

    if ( ! $screen->get_list_screen() ) {
        return;
    }

    $assets = Imagify_Assets::get_instance();
    $assets->dequeue_script( 'twentytwenty' );
    $assets->dequeue_script( 'event-move' );
} );