PHP code example of hametuha / wp-enqueue-manager

1. Go to this page and download the library: Download hametuha/wp-enqueue-manager 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/ */

    

hametuha / wp-enqueue-manager example snippets


// Register all js in folder.
// e.g. /assets/js/sample.js will be regsitered as 'my-sample'.
Hametuha\WpEnqueueManager::register_js( __DIR__ . '/assets/, 'my-', '1.0.0' );

// Register all css in folder.
// e.g. /assets/css/sample.css will be regsitered as 'my-sample'.
Hametuha\WpEnqueueManager::register_styles( __DIR__ . '/assets/, 'my-', '1.0.0' );


// Avoide direct load.
defined( 'ABSPATH' ) || die();
// Return JS vars.
return [
	'label' => 'This is my var!',
];

Hametuha\WpEnqueueManager::register_js_var_files( __DIR__ . '/l10n );