Print this page    |   Home > The Vizion Blog > WordPress Tips: Get your own WordPress Plugin Information using the get_plugins() Function
2008Jun13

WordPress Tips: Get your own WordPress Plugin Information using the get_plugins() Function

I searched for this info and couldn’t find anything that helped me, until I thought to myself: The Plugin version is displayed on the plugins.php page of WordPress. I didn’t want to put the Plugin information in two places, making it cumbersome to update. So I tracked down the code and did some testing. I got more than I was looking for and knew I had to share.

I’m now able to pull the Plugin information in using this hook:

$plugins = get_plugins('/mypluginfolder');

This will pull in the plugin that’s located in wp-content/plugins/mypluginfolder/ and display it in an array like this:

array(1) {
["myplugin.php"]=>
array(5) {
["Name"]=>
string(18) "My Plugin"
["Title"]=>
string(95) "My Plugin"
["Description"]=>
string(78) "My Plugin does stuff!"
["Author"]=>
string(100) "Me"
["Version"]=>
string(5) "1.8.2"
}
}

I mainly wanted to pull the plugin Version to show in the plugin. This has now been accomplished and I’m a happy coder.

You can leave a response below.


One Response to “WordPress Tips: Get your own WordPress Plugin Information using the get_plugins() Function”

Marvin Blog » How go Get your own WordPress Plugin Information
Jun 16th, 2008

[...] Here is a wordpress tips that help you Get your own WordPress Plugin Information from vizioninteractive. [...]


Leave a Comment
  1. Please keep your comments polite and on topic. Your email address is required, but will not be shared. Please review our Privacy Policy for more details. All comments will be approved before they show up.
  2. (required)
  3. (valid email required)