A Cozmoslabs Product
Documentation / Developer Knowledge Base / Userlisting / Codemirror compatibility on User Listing

Codemirror compatibility on User Listing

This function adds Codemirror compatibility on User Listing.

wp_print_scripts is located in wp-includes/functions/wp-scripts.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * Codemirror compatibility on User Listing. Tag: codemirror, compatibility
 */
 
/**
 * Dequeue
 *
 * Hooked to the wp_print_scripts action, with a late priority (100),
 * so that it is after the script was enqueued.
 */
add_action( 'wp_print_scripts', 'wppbc_dequeue_conflicting_scripts', 100 );
function wppbc_dequeue_conflicting_scripts() {
	$post_type = '';
	if (isset($_GET['post_type'])){
		$post_type = $_GET['post_type'];
	} elseif( isset($_GET['post']) && isset($_GET['action']) && $_GET['action'] == 'edit' ) {
		$post_id = $_GET['post'];
		$post_type = get_post_type( $post_id );
	}
	$admin_page = '';
	if ( is_admin() && isset($_GET['page'])){
		$admin_page = $_GET['page'];
	}
 
	if( $post_type == 'wppb-ul-cpt' || $admin_page == 'user-email-customizer' || $admin_page == 'admin-email-customizer'){
		global $wp_scripts;
		//var_dump($wp_scripts);
		foreach($wp_scripts->queue as $script){
			if ( strpos($script, 'codemirror' ) && ( $script != 'codemirror' && $script != 'codemirror-mode-overlay-js' && $script != 'codemirror-mode-xml-js' && $script != 'codemirror-fullscreen-js') ){
				//wp_dequeue_script( 'soliloquy-lite-codemirror');
				wp_dequeue_script( $script );
			}
		}
	}
}

Profile Builder Pro

Create beautiful front-end registration and profile forms with custom fields. Setup member directories, custom redirects, cutomize user emails & more using the all in one user management plugin.

Get Profile Builder

The Ultimate Membership Bundle

Combine the power of Profile Builder with Paid Member Subscriptions to set up user registration, memberships, and recurring revenue.

Get 25% off with the bundle

Help & Support

We’re here to help you every step of the way.

Open a Support Ticket