Remove jQuery from Theme
v1.0Marc Tönsing · 2021年3月9日 上架
Removes jQuery from your frontend theme if no administrator is logged-in. jQuery will still be loaded and continue to work in you backend and when the …
- 正在使用
- 100+
- 评分
- 5.0 / 5
- 累计下载
- 2,906
- 最近更新
- 2021年3月9日
1 条评价需要 WordPress 5.0+已测试到 5.6.24
贡献者
Removes jQuery from your frontend theme if no administrator is logged-in. jQuery will continue to work in you backend and when the admin toolbar is visible. Plugins which depend on jQuery will not be loaded either.
This plugin does nothing more but this:
function init_without_jquery() {
if (!is_admin() AND !is_admin_bar_showing()) {
wp_deregister_script('jquery');
wp_register_script('jquery', false);
}
}
add_action('init', 'init_without_jquery');