Skip to content

Instantly share code, notes, and snippets.

@rezzz-dev
Created May 4, 2016 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rezzz-dev/56509d8812021c3a559cd480a266fb24 to your computer and use it in GitHub Desktop.
Save rezzz-dev/56509d8812021c3a559cd480a266fb24 to your computer and use it in GitHub Desktop.
Remove the conflict of select2 versions between ACF and LifterLMS
<?php
add_action( 'admin_enqueue_scripts', 'custom_admin_scripts_styles' );
function custom_admin_scripts_styles() {
global $post_type;
if ( 'course' == $post_type ) {
global $post_type;
wp_dequeue_script( 'select2' );
wp_dequeue_style( 'select2' );
wp_enqueue_script( 'llms-select2', plugins_url( '/assets/select2/js/select2' . LLMS_Admin_Assets::$min . '.js', LLMS_PLUGIN_FILE ), array( 'jquery' ), '', true );
wp_enqueue_style( 'llms-select2-styles', plugins_url( '/assets/select2/css/select2' . LLMS_Admin_Assets::$min . '.css', LLMS_PLUGIN_FILE ) );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment