如何在Wordpress插件开发中获得激活的插件列表? [英] How do I get activated plugin list in wordpress plugin development?

查看:110
本文介绍了如何在Wordpress插件开发中获得激活的插件列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以在 wordpress Codex 中获取所有已激活的插件列表.

Is there any way to get all activated plugin list in wordpress codex .

我用了

get_option('active_plugins');

这将返回插件文件路径.我要这个名字.因为有时文件名与实际的插件名称不同.

this return the plugin file path. I want the name. Because sometimes file name is different with the actual plugin name.

推荐答案

我得到了答案

$apl=get_option('active_plugins');
$plugins=get_plugins();
$activated_plugins=array();
foreach ($apl as $p){           
    if(isset($plugins[$p])){
         array_push($activated_plugins, $plugins[$p]);
    }           
}
//This is the $activated_plugins information

这篇关于如何在Wordpress插件开发中获得激活的插件列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆