Conflict with Rise Theme by ThriveThemes

Since LifterLMS 2.0.0, we’ve been transitioning to some more performant methods for various functions and interactions on the WordPress admin panel which rely on the Select2 Javascript Library.

We’ve recently determined that the Rise Theme by ThriveThemes also uses this library, but they’re loading an older version than we require and this causes some conflicts where LifterLMS doesn’t work when we’re using the library’s functions.

We’re working on a better solution to this issue for the long term but, currently, if you’re experiencing this conflict you can use the following code snippet to resolve the issue.

You can place this in a theme or child theme’s functions.php file or in a custom plugin.

<?php // Don't copy this line!
/**
* attempts to resolve various select2 conflicts LifterLMS has with other plugins / themes
*
* @since 2016-03-29
*/
// 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 );
} );

<?php // Don't copy this line!
/**
* attempts to resolve various select2 conflicts LifterLMS has with other plugins / themes
*
* @since 2016-03-29
*/
<?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 );

<?php // Don't copy this line!
/**
* attempts to resolve various select2 conflicts LifterLMS has with other plugins / themes
*
* @since 2016-03-29
*/
/**
* 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 );

Last Updated on
Was this article helpful?