Tagged: 

This topic contains 0 replies, has 1 voice, and was last updated by  alordiel 2 weeks, 4 days ago.

  • Author
    Posts
  • #9563

    alordiel
    Participant

    Hello,
    I just got a “conflict” between Piklist admin js file and the banner builder from Thrive Ultimatum plugin. The problem appeared on the admin page when trying to edit some of the Thrive visual elements (in my case a banner). Thrive has its own builder for that and it is not using anything from WordPress, so that is why the error appears. And here is what I got in the console:

    ReferenceError: piklist is not definedadmin.js:252:11
    post_submit_meta_box https://******.com/wp-content/plugins/piklist/parts/js/admin.js?ver=1.0.6:252
    init https://****.com/wp-content/plugins/piklist/parts/js/admin.js?ver=1.0.6:23
    <anonymous> https://****.com/wp-content/plugins/piklist/parts/js/admin.js?ver=1.0.6:13
    Backbone 4
    i
    fireWith
    ready
    J

    As this page is something that will never use the Piklist functionality I just disabled Piklist for it. I did this by creating a small MU plugin and placed it in wp-content/mu-plugins folder. Here is the code:

    <?php
    /*
    Plugin Name: Plugin-loading-restrictions
    Description: Restricts the loading (activation) of selected plugins based on url of the opened page
    Version: 0.0.1
    Author: Alexander Vasilev
    Author URI: timelinedev.com
    */
    
    $is_admin    = strpos($_SERVER['REQUEST_URI'], '/wp-admin/');
    $is_thrieve  = strpos($_SERVER['REQUEST_URI'], 'tve=true');
    
    if (false !== $is_admin && $is_thrieve !== false ) {
    
    	add_filter('option_active_plugins', function ($plugins) {
    			$index = array_search('piklist/piklist.php', $plugins);
    			unset($plugins[$index]);
    			return $plugins;
    	});
    
    }

    This basically solved the problem.
    Hope this will help in case of someone get similar issue.

    Regards,
    Alex

You must be logged in to reply to this topic.