<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
milbareu / wordpress-webpack-asset-manager example snippets
// Example: Enqueue the 'main' bundle with the namespace 'mytheme'
WPAssets::enqueueBundle('main', 'mytheme');
// Example: Enqueue the 'editor' bundle with the default namespace
WPAssets::enqueueBundle('editor');
use MB\WPAssets\WPAssets;
// Register the theme assets
add_action('wp_enqueue_scripts', function () {
WPAssets::enqueueBundle('main', 'mytheme');
}, 100);
// Register assets for the block editor
add_action('enqueue_block_editor_assets', function () {
WPAssets::enqueueBundle('editor');
}, 100);
WPAssets::enqueueBundle('main', 'mytheme');
$mainCssUrl = WPAssets::getAsset('main.css'); // Get URL of main.css