Last active
August 29, 2016 17:48
-
-
Save thomasplevy/d84a7ceb65c7d9f56b677d7ee824534c to your computer and use it in GitHub Desktop.
attempts to resolve various select2 conflicts LifterLMS has with other plugins / themes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // don't include this line if pasting into an existing php file! | |
// late fire version of above... | |
/** | |
* Dequeue the 3.5.x version of Select2 JS library enqueued by ACF Pro | |
* This is only necessary on LifterLMS Quiz & Course Pages where LifterLMS | |
* requires version 4.x or higher to correctly function | |
*/ | |
function maybe_dequeue_select2() { | |
$screen = get_current_screen(); | |
if ( 'llms_quiz' === $screen->post_type || 'course' === $screen->post_type ) { | |
wp_dequeue_script( 'select2' ); | |
} | |
} | |
add_action( 'admin_init', function() { | |
add_action( 'admin_enqueue_scripts', 'maybe_dequeue_select2', 777 ); | |
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // don't include this line if pasting into an existing php file! | |
/** | |
* Dequeue the 3.5.x version of Select2 JS library enqueued by ACF Pro | |
* This is only necessary on LifterLMS Quiz & Course Pages where LifterLMS | |
* requires version 4.x or higher to correctly function | |
*/ | |
function maybe_dequeue_select2() { | |
$screen = get_current_screen(); | |
if ( 'llms_quiz' === $screen->post_type || 'course' === $screen->post_type ) { | |
wp_dequeue_script( 'select2' ); | |
} | |
} | |
add_action( 'admin_enqueue_scripts', 'maybe_dequeue_select2', 777 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // don't include this line if pasting into an existing php file! | |
/** | |
* Dequeue the 3.5.x version of Select2 JS library enqueued by the Rise Theme | |
* This is only necessary on LifterLMS Quiz & Course Pages where LifterLMS | |
* requires version 4.x or higher to correctly function | |
*/ | |
function maybe_dequeue_thrive_select2() { | |
$screen = get_current_screen(); | |
if ( 'llms_quiz' === $screen->post_type || 'course' === $screen->post_type ) { | |
wp_dequeue_script( 'thrive-select2' ); | |
} | |
} | |
add_action( 'admin_enqueue_scripts', 'maybe_dequeue_thrive_select2', 777 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment