• Hi forum,

    We are creating a private members area for our site, raised with Impreza template. With any other template, the visualization works fine! but when activating UpSolution Core plugin (required by Impreza) all Ultimate Members CSS fail… We have tried deactivating our plugins one by one, but the conflict appears when UpSolution Core is activated. None of the Ultimate Member pages structures are correct and elements like tabs are not even shown.

    In the website error log you can find this notice: “[04-Jun-2026 16:30:08 UTC] PHP Notice: Function WP_Styles::add was called incorrectly. The style with the handle “um_styles” was enqueued with dependencies that are not registered: select2.” And the Impreza support has told us to ask you for connecting later the scripts in the class-enqueue.php file (path to the file: ultimate-member\includes\common\class-enqueue.php line).

    I have been looking for similar topics in this forum and have found https://ww.wp.xz.cn/support/topic/select2-css-deregistering/ but, after applying, the code it suggests seems not to work on my site.

    I have even tried to change the line 216 of the previously mentioned file to:

        $dequeue_select2 = apply_filters( 'um_dequeue_select2_scripts', true );

    without any success 🙁

    Any ideas to solve it? Could you please help?

    1000 thanks in advance!

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • missveronica

    (@missveronicatv)

    @micmicwp

    And the Impreza support has told us to ask you for connecting later the scripts in the class-enqueue.php file (path to the file: ultimate-member\includes\common\class-enqueue.php line).

    This solution requires UM developer support.

    There is a “Site Loading Performance” section for “Impreza”
    where you can try to deactivate some of these options (maybe more):

    Dynamically load theme JS components
    Move jQuery scripts to the footer
    Optimize JS and CSS size

    https://help.us-themes.com/impreza/loading-speed/

    missveronica

    (@missveronicatv)

    @micmicwp

    You can try this code snippet if it will bypass the “Impreza” page optimisations with all the page performance options enabled.

    add_filter( 'script_loader_tag', 'defer_ultimate_member_scripts', 10, 3 );
    function defer_ultimate_member_scripts( $tag, $handle, $src ) {
        if ( in_array( $handle, array( 'um_scripts', 'um_profile', 'um_members', 'um_minified' ))) {
            return '<script src="' . esc_url( $src ) . '" defer></script>' . "\n";
        }
        return $tag;
    }

    You install the code snippet by adding it to your active theme’s functions.php file or use the “Code Snippets” Plugin

    https://ww.wp.xz.cn/plugins/code-snippets/

    Thread Starter micmicwp

    (@micmicwp)

    Thank you very much @missveronicatv for your help… though none of these solutions have worked for us 🙁

    I do not know what to do at this point; maybe look for a different plugin for our members area 🙁

    Best regards

    missveronica

    (@missveronicatv)

    @micmicwp

    class-enqueue.php file (path to the file: ultimate-member\includes\common\class-enqueue.php line).

    Line number is missing in your first post.
    Do you have the line number?

    Thread Starter micmicwp

    (@micmicwp)

    Sorry the misspelling! I think it is line number 216:

        $dequeue_select2 = apply_filters( 'um_dequeue_select2_scripts', false );

    But if have switched it to true… without success. I am not an expert but thought (or hoped) it could work 🙁

        $dequeue_select2 = apply_filters( 'um_dequeue_select2_scripts', true );
        if ( class_exists( 'WooCommerce' ) || $dequeue_select2 ) {
            wp_dequeue_style( 'select2' );
            wp_deregister_style( 'select2' );
    
            wp_dequeue_script( 'select2' );
            wp_deregister_script( 'select2' );
        }

    One million thanks, @missveronicatv !!!!

    • This reply was modified 1 day, 7 hours ago by micmicwp.
    • This reply was modified 1 day, 7 hours ago by micmicwp.
    missveronica

    (@missveronicatv)

    @micmicwp

    Try to add um_select2_locale to the code snippet.

    add_filter( 'script_loader_tag', 'defer_ultimate_member_scripts', 10, 3 );
    function defer_ultimate_member_scripts( $tag, $handle, $src ) {
        if ( in_array( $handle, array( 'um_select2_locale', 'um_scripts', 'um_profile', 'um_members', 'um_minified' ))) {
            return '<script src="' . esc_url( $src ) . '" defer></script>' . "\n";
        }
        return $tag;
    }
    Thread Starter micmicwp

    (@micmicwp)

    Dear @missveronicatv ,

    Thank you so so much for your interest!!!! I have tried to insert your code as a new snippet, but I am getting an error when attempting to activate it…

    :O

    • This reply was modified 1 day, 7 hours ago by micmicwp.
    missveronica

    (@missveronicatv)

    @micmicwp

    This new code snippet replaces the old code snippet.

    Thread Starter micmicwp

    (@micmicwp)

    Nothing!!! It does not work :'( https://fiatifta.org/user/nacho/

    Thanks a lot anyway, @missveronicatv

    Thread Starter micmicwp

    (@micmicwp)

    Dear @missveronicatv !!!

    Yesterday night Impreza support contacted me again, telling that unfortunately, it appeared to be a bug!!! they’ll fix it in one of the future updates.

    As a temporary solution, they have provided me with the following code (as a snippet, or to add in the functions.php file of my child theme):

    add_action( 'wp_enqueue_scripts', function () {
        if ( function_exists( 'is_checkout' ) AND is_checkout() ) {
            return;
        }
        if ( ! wp_style_is( 'select2', 'registered' ) AND function_exists( 'WC' ) ) {
            wp_register_style(
                'select2',
                WC()->plugin_url() . '/assets/css/select2.css',
                array(),
                defined( 'WC_VERSION' ) ? WC_VERSION : null
            );
        }
        wp_enqueue_style( 'select2' );
    }, 502 );

    And, yes!!!! this does work for my website ^^

    Thank you so much for your great support, @missveronicatv

    @micmicwp

    Thanks for your feedback.

Viewing 11 replies - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.