下面是WordPress的介绍教程专栏介绍隐藏已安装的WordPress插件的方法,希望能帮助到有需要的朋友!
如果不想让其他登录的用户看到一个已经安装好的插件,这种方法会在不影响插件正常工作的情况下,轻松隐藏一个WordPress插件,但不会出现在插件列表中。
将以下代码添加到当前主题functions.php文件中:
函数hide_plugin_trickspanda() {
global $ wp _ list _ table
$ hidearr = array(# 39;plugin -directory/plugin -file . PHP # 39;);
$ my plugins = $ WP _ list _ table -gt;物品;
foreach($ my plugins as $ key = gt;$val) {
if (in_array($key,$hidearr)) {
unset($ WP _ list _ table -gt;items[$ key]);
}
}
}
add _ action(# 39;pre _ current _ active _ plugins # 39, #39;hide _ plugin _ trickspanda # 39);登录后复制
