• Resolved shreefbeh

    (@shreefbeh)


    Hello we have style conflict in the WPMUDEV dashboard plugins ( snapshot ) when we deactivate your plugin it works good, when we contacted them, they replied to us and asked to contact you and suggested this solution:

    I had a closer look and checked and after investigating the issue, I can see, how the admin_body_class() method is implemented in the plugin’s code causing the issue.

    In the admin_body_class() method, the plugin adds the class order-tip-reports-settings under certain conditions. However, only return the modified $classes if those conditions are met. If the conditions are not met, the method doesn’t return anything, which effectively removes all the previously set body classes and causes the style break issue.

    To fix the issue, you can just add one line of code to the file: /wp-content/plugins/order-tip-woo/admin/controllers/config.class.php

    The line will be the below one and add it to that file on line 66:

        // Always return the classes
        return $classes;

    Current function:

    function admin_body_class( $classes ) {
    
        if(
            isset( $_GET['page'] ) && $_GET['page'] == 'wc-settings' &&
            isset( $_GET['tab'] ) && $_GET['tab'] == 'order_tip' &&
            isset( $_GET['section'] ) && $_GET['section'] == 'reports'
        ) {
            return $classes . ' order-tip-reports-settings';
        }
    
    }

    After adjusting it will be:

    function admin_body_class( $classes ) {
        if (
            isset( $_GET['page'] ) && $_GET['page'] == 'wc-settings' &&
            isset( $_GET['tab'] ) && $_GET['tab'] == 'order_tip' &&
            isset( $_GET['section'] ) && $_GET['section'] == 'reports'
        ) {
            $classes .= ' order-tip-reports-settings';
        }
        
        // Always return the classes
        return $classes;
    }
    

    Make the changes and it should fix the issue. Do let us know if you need help with adjusting the code.

    Additionally, we encourage you to report this issue and suggest the adjustment to the plugin’s development team via their WordPress support forum as the changes may lost in the next plugin update. https://wordpress.org/support/plugin/order-tip-woo/

    Implementing this change should help improve the stability and reliability of the plugin across various WordPress setups preventing unexpected behavior and conflicts with other plugins or themes.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.