trendwerk / skip-bundled
跳过WordPress主题中捆绑的脚本。
0.1.0
2016-12-06 09:04 UTC
Requires (Dev)
This package is auto-updated.
Last update: 2024-09-26 20:19:46 UTC
README
跳过解析WordPress主题中捆绑的脚本。这在将(如jQuery)也通过WordPress插件添加到队列中的脚本捆绑到一个文件中时很有用。
安装
composer require trendwerk/skip-bundled
用法
$scripts = new \Trendwerk\SkipBundled\Scripts(); $scripts->init(); $scripts->add($handle);
其中$handle
是使用wp_register_script
在WordPress中注册的脚本的句柄。
示例
jQuery的示例
$scripts = new \Trendwerk\SkipBundled\Scripts(); $scripts->init(); $scripts->add('jquery-core');
注意:jQuery注册为jquery-core
。