-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Nice code - not joking when I say it reduced my asset enqeueuing code by >50% and made it far more readable :D
For completeness though, it'd be nice to have a simple method for dequeuing an arbitrary asset. As an example, my theme spits out its own styles for a particular plugin, making the plugin styles useless. It'd be great to be able to dequeue the plugin styles through the class (for literally no other reason than pretty code)
$assets = Assets::forTheme();
$manifest = $assets
->enqueueScript('manifest', ['jquery'])
->useDefer()
$vendor = $assets
->enqueueScript('vendor', [$manifest])
->useDefer();
$app = $assets
->enqueueScript('vendor', [$vendor])
->useDefer();
// ew...
wp_dequeue_script('some-plugin-script');
// wow! :D
$assets->dequeue('some-plugin-script')Metadata
Metadata
Assignees
Labels
No labels