get list of activate plugin in wordpress and remov

2020-03-30 07:57发布

Is it possible to get activate plugin list in wordpress and remove it from admin menu bar ?. i want to remove all activate plugin links from adminu bar .

标签: php wordpress
1条回答
一夜七次
2楼-- · 2020-03-30 08:13

Findout the page and replace your_plugin_page .

<?php
function remove_menus(){

  remove_menu_page( 'your_plugin_page.php' );  //probably where the plugin settings are available
}
add_action( 'admin_menu', 'remove_menus' );
?>

This will list out all activated plugins:-

  $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]);
        }           
    }

now you need to get all the pages .Not a perfect solution , but I hope it will be helpful.

查看更多
登录 后发表回答