Created
May 1, 2019 18:50
-
-
Save facelordgists/5d60a41118faaf97f9136a83cf21608b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_all_plugin_data(){ | |
$all_plugins = get_plugins(); | |
$list_of_all_plugins = array(); | |
foreach ($all_plugins as $path => $data) { | |
$parts = explode('/', $path); | |
$slug = $parts[0]; | |
$list_of_all_plugins[$slug] = array( | |
'Slug' => $slug, | |
'path' => $path, | |
'Name' => $data['Name'], | |
'Version' => $data['Version'], | |
'Description' => $data['Description'], | |
'Author' => $data['Author'], | |
'AuthorURI' => $data['AuthorURI'], | |
'Status' => (is_plugin_active($path) ? 'active' : 'inactive'), | |
); | |
} | |
return $list_of_all_plugins; | |
} | |
/* Sample item | |
[wordpress-seo] => Array( | |
[Slug] => wordpress-seo | |
[path] => wordpress-seo/wp-seo.php | |
[Name] => Yoast SEO | |
[Version] => 9.6 | |
[Description] => The first true all-in-one SEO solution for WordPress, including on-page content analysis, XML sitemaps and much more. | |
[Author] => Team Yoast | |
[AuthorURI] => https://yoa.st/1uk | |
[Status] => active | |
) | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment