1. Go to this page and download the library: Download nyco/wp-assets 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/ */
nyco / wp-assets example snippets
use NYCO\WpAssets as WpAssets;
$WpAssets = new WpAssets();
// The general pattern for all methods is $WpAssets->{{ method }}()
$WpAssets->addScript();
add_filter('script_loader_tag', function($tag, $handle) {
if ($handle === 'main') {
// do something to $tag like add attributes, disable for certain views, etc.
}
return $tag;
});