biont / wordpress-asset-bundles
Bundle all kinds of assets and enqueue them at once
Installs: 1 049
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:package
Requires
- php: >=7
Requires (Dev)
- inpsyde/monkery-test-case: ^4.0
- phpunit/phpunit: ^6.5
This package is auto-updated.
Last update: 2024-10-29 05:34:18 UTC
README
This is a small library that allows developers to create bundles of various asset types. Scripts, styles and other, custom asset types can be registered as a package. All assets are enqueued together when the AssetBundle is enqueued.
Installation
Fetch this package via composer:
composer require biont/wordpress-asset-bundles
Usage
$bundle => new AssetBundle( 'my_bundle', [ new Script( // Script handle 'my_asset_js', // Script path $asset_dir . 'js/asset.js', // Dependencies [ 'jquery' ] ), new Style( 'my_asset_css', $asset_dir . 'css/asset.css' ), ] ); $bundle->register(); // Call $bundle->enqueue() whenever you need your assets