Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
When ACF and The Events Calendar both register/enqueue the same script (select2), there are conflicts. This should resolve the issue.
* Disable Tribe Select2 on non-tribe admin pages
function _theme_disable_tribe_select2() {
$screen = get_current_screen();
if ( 'tribe_events' === $screen->id ) {
$tribe_post_types = array(
if ( in_array( $screen->post_type, $tribe_post_types ) ) {
wp_deregister_script( 'tribe-select2' );
add_action( 'admin_enqueue_scripts', '_theme_disable_tribe_select2', 99 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment