Skip to content

Instantly share code, notes, and snippets.

@codename065
Last active July 14, 2023 12:52
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 codename065/5dd191e1f6bf4e4db6c26ab81bfddae2 to your computer and use it in GitHub Desktop.
Save codename065/5dd191e1f6bf4e4db6c26ab81bfddae2 to your computer and use it in GitHub Desktop.
Disable scripts
<?php
add_filter("wpdm_disable_scripts", function ($disabled_scripts) {
// $disabled_scripts = ['wpdm-bootstrap-js', 'wpdm-bootstrap-css', 'wpdm-font-awesome', 'wpdm-front'];
// by default $disabled_scripts = [], means all scripts are enabled,
// if you want to disable 'wpdm-bootstrap-css' push it to $disabled_scripts, like $disabled_scripts[] = 'wpdm-bootstrap-css';
// example to disable scripts on page id 123
if(get_the_ID() === 123) {
$disabled_scripts[] = 'wpdm-bootstrap-css';
$disabled_scripts[] = 'wpdm-bootstrap-js';
}
return $disabled_scripts;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment