1. Go to this page and download the library: Download wpackio/enqueue library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
wpackio / enqueue example snippets
// Require the composer autoload for getting conflict-free access to enqueue
'plugin', __FILE__ );
// Assuming this is the main plugin file.
// Require the composer autoload for getting conflict-free access to enqueue
__construct() {
// It is important that we init the Enqueue class right at the plugin/theme load time
$this->enqueue = new \WPackio\Enqueue( 'wpackplugin', 'dist', '1.0.0', 'plugin', __FILE__ );
// Enqueue a few of our entry points
add_action( 'wp_enqueue_scripts', [ $this, 'plugin_enqueue' ] );
}
public function plugin_enqueue() {
$this->enqueue->enqueue( 'app', 'main', [] );
$this->enqueue->enqueue( 'app', 'mobile', [] );
$this->enqueue->enqueue( 'foo', 'main', [] );
}
}
// Init
new MyPluginInit();