Open

Symptoms

RaidBoxes hosting installs a plugin that is causing a JavaScript conflict with WPML.

This is what happens:

  • WPML loads first, placing its “onload” event handler.
  • The RaidBoxes plugin loads next, overwriting these event handlers.

Because of this, some buttons in the WPML user interface aren’t working.

Workaround

You can try using jQuery instead.

Edit the raidboxes-admin-menu.php file found in the ../rb-plugins/raidboxes-admin-menu/ folder and look for the raidboxes_cache_purge_action_js function. Edit this function so that it looks like the following code:

raidboxes workaround
function raidboxes_cache_purge_action_js() { ?>
    <script type="text/javascript">
        jQuery(document).ready(function(event) {
            if (document.getElementById("wpadminbar")) {
                jQuery(window).load(function() {
                    <?php echo 'var ajaxurl = "' . admin_url('admin-ajax.php') . '";'; echo "n"; ?>
                    jQuery("li#wp-admin-bar-raidboxes-purge-cache .ab-item").on( "click", function() {
                        var data = {
                            'action': 'raidboxes_purge_cache',
                        };
                        jQuery.post(ajaxurl, data, function(response) {
                            jQuery('#wpbody-content').prepend('<div id="raidboxes-purge-cache-notification" class="notice notice-success"><p>'+response+'</p></div>');
                            jQuery('#raidboxes-purge-cache-notification').delay(2000).fadeOut(3000);
                        });
                    });
                });
            }
        });
    </script> <?php
}

Leave a Reply

Please leave here comments about this page only.
For technical support and feature suggestions, head to our forum. We are waiting there!

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>