Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get activated plugin list in wordpress plugin development? [closed]

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.

like image 509
Sarwar Hasan Avatar asked Feb 14 '23 10:02

Sarwar Hasan


1 Answers

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
like image 73
Sarwar Hasan Avatar answered Feb 17 '23 09:02

Sarwar Hasan