MaxButtons plugin is conflicting with Hustle

After doing a plugin conflict test, we found that the plugin that it's causing conflicts with Hustle it's WordPress Button Plugin MaxButtons https://wordpress.org/plugins/maxbuttons/ it was also tested and reproduced by the agent on a test install.

Further information provided in the internal ticket.

  • Adam Czajczyk

    Hello Amy

    It looks like it's the option to add the "Add button" is messing that up: the "Hide "addbutton" in post editor toolbar" option on "MaxButtons -> Settings -> Settings -> Settings" page.

    If that option is disabled (which means that the "Add button" should be added to post/page editor) that's breaking Hustle. This happens most probably due to the way some JS code is "injected" right to the page source by the Maxbuttons plugin. We cannot deal with the 3rd-party plugin code - we can't change it and I also don't know it well enough to be able to suggest specific changes but that's something that Maxbuttons developers should be able to fix. I'd strongly suggest that you open some support ticket with them asking them to fix the compatibility.

    There are, however, two workarounds. First one, is to just enable the "Hide "add button" in post editor toolbar" option. I believe, though, that this may not be acceptable solution as it would also hide that button from all posts and pages, not only from Hustle.

    The second workaround would be to use an additional piece of code. I couldn't find any "hooks" in the Maxbutton plugin that would let me just hide/remove the "add button" button from only Hustle pages so we need to use a "trick" and set that option dynamically:

    add_filter('pre_option_maxbuttons_noshowtinymce', 'maxbuttons_hustle_noshow');
    function maxbuttons_hustle_noshow( $maxbuttons_noshowtinymce) {
    	$screen = get_current_screen();
        if ( $screen->parent_base == 'hustle' ) {
    		return true;
    	}
    	return $maxbuttons_noshowtinymce;
    }

    What this code does is it hooks up to native "get_option()" function of WordPress which is used by Maxbuttons to find whether to show or hide "add button" button. With above code we actually change the value of that option dynamically/on-the-fly only for Hustle section of the back-end. In other words, it means that regardless of how you set the Hide "add button" in post editor toolbar option in MaxButtons settings - it will always be set to hide that button on all Hustle-related pages in back-end.

    That seems to do the trick on my end so give it a try please. To apply the code to your site, simply add at the end of the "functions.php" file of your current theme. If you got any caches on site, please clear them too after adding the code and then check please if it worked for you for Hustle.

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.