Last active
July 14, 2023 12:52
-
-
Save codename065/5dd191e1f6bf4e4db6c26ab81bfddae2 to your computer and use it in GitHub Desktop.
Disable scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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