Skip Navigation

Codemirror errors affecting Toolset back-end pages when using Affiliate Toolkit plugin

Won't fix

Symptoms

When the Affliate Toolkit plugin is active certain Toolset back-end pages (such as adding/editing forms or templates) suffer codemirror errors which affects their functionality.

Workaround

Such conflicts are normally avoided, but the plugin uses custom handles for codemirror so that the usual fixes are ineffective.

The problem can be resolved by adding a code snippet (at Toolset > Settings > Custom Code) with the following:

if ( defined('ATKP_PLUGIN_DIR') ){
	add_action( 'admin_enqueue_scripts', 'ts_dequeue_atkp_scripts', 11, 1 );
}

function ts_dequeue_atkp_scripts( $hook ){
	
	if ( 'post.php' == $hook || 'post-new.php' == $hook ) {
		
		$screen = get_current_screen();
		
		if ( isset($screen->post_type) && in_array($screen->post_type, array('cred-form','cred_user-form','view-template','wpa-helper')) ){
			
			wp_dequeue_script( 'atkp-codemirror-script' );
			wp_dequeue_script( 'atkp-codemirror-xml' );
			wp_dequeue_script( 'atkp-codemirror-html' );
			wp_dequeue_script( 'atkp-codemirror-css' );

		}
	}
}

2 thought on Codemirror errors affecting Toolset back-end pages when using Affiliate Toolkit plugin

Leave
a Reply

Your email address will not be published. Required fields are marked *

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