innocode-digital/wp-deferred-loading
最新稳定版本:1.4.1
Composer 安装命令:
composer require innocode-digital/wp-deferred-loading
包简介
Defer loading of JavaScript and CSS files.
README 文档
README
Description
WordPress plugin for deferred loading of JavaScript and CSS files.
Install
Clone this repo to wp-content/plugins/:
cd wp-content/plugins/
git clone git@github.com:innocode-digital/wp-deferred-loading.git
Activate Deferred loading from Plugins page
or WP-CLI: wp plugin activate wp-deferred-loading.
Also you could install it as a Must Use Plugin.
Usage
To defer JavaScript files, add to functions.php of theme:
add_filter( 'deferred_loading_scripts', function () {
return [
// List of enqueued scripts.
];
} );
or
add_filter( 'deferred_loading_scripts', function () {
return '*'; // All enqueued scripts.
} );
To defer CSS files, add to functions.php of theme:
add_filter( 'deferred_loading_styles', function () {
return [
// List of enqueued styles.
];
} );
统计信息
- 总下载量: 14.19k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2019-10-22