How do I get activated plugin list in wordpress pl

2019-02-26 00:52发布

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

i used this

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.

1条回答
萌系小妹纸
2楼-- · 2019-02-26 01:09

I got the answer

$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
查看更多
登录 后发表回答