/**
* Remove all the dependencies of a registered script
*/
add_action(
'wp_enqueue_scripts',
function () {
global $wp_scripts;
$registered_script_slug = "<registered_script_slug>";
if (false === $wp_scripts->queue || !isset($wp_scripts->registered[$registered_script_slug]->deps)) {
return;
}
$wp_scripts->registered[$registered_script_slug]->deps = array();
},
101
);
Code language: PHP (php)
Leave a Reply