Skip to content

Instantly share code, notes, and snippets.

@pagegwood
Created February 20, 2020 19:07
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pagegwood/123cbb2cb40e5e3b212067c212a818c4 to your computer and use it in GitHub Desktop.
Save pagegwood/123cbb2cb40e5e3b212067c212a818c4 to your computer and use it in GitHub Desktop.
Remove (dequeue) all CSS and Javascript files loaded by the free version of The Events Calendar WordPress plugin by Modern Tribe (created using version 5.0.2 of the plugin)
<?php
// include this in functions.php
add_action( 'wp_enqueue_scripts', function() {
//this is based on using the "skeleton styles" option
$styles = [
'tribe-events-bootstrap-datepicker-css',
'tribe-events-calendar-style',
'tribe-events-custom-jquery-styles',
'tribe-events-calendar-style',
'tribe-events-calendar-pro-style',
'tribe-events-full-calendar-style-css',
'tribe-common-skeleton-style-css',
'tribe-tooltip',
'tribe-accessibility-css'
];
$scripts = [
"tribe-common",
"tribe-admin-url-fragment-scroll",
"tribe-buttonset",
"tribe-dependency",
"tribe-pue-notices",
"tribe-validation",
"tribe-timepicker",
"tribe-jquery-timepicker",
"tribe-dropdowns",
"tribe-attrchange",
"tribe-bumpdown",
"tribe-datatables",
"tribe-migrate-legacy-settings",
"tribe-admin-help-page",
"tribe-tooltip-js",
"mt-a11y-dialog",
"tribe-dialog-js",
"tribe-moment",
"tribe-tooltipster",
"tribe-events-settings",
"tribe-events-php-date-formatter",
"tribe-events-jquery-resize",
"tribe-events-chosen-jquery",
"tribe-events-bootstrap-datepicker",
"tribe-events-ecp-plugins",
"tribe-events-editor",
"tribe-events-dynamic",
"jquery-placeholder",
"tribe-events-calendar-script",
"tribe-events-bar",
"the-events-calendar",
"tribe-events-ajax-day",
"tribe-events-list",
"tribe-query-string",
"tribe-clipboard",
"datatables",
"tribe-select2",
"tribe-utils-camelcase",
"tribe-app-shop-js"
];
wp_deregister_script($scripts);
wp_deregister_style($styles);
}, 99);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment