WordPress Tips: Get your own WordPress Plugin Information using the get_plugins() Function
By Scott Kingsley Clark
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.
Published Jun, 13th 2008 at 9:06 am in The Vizion Search Engine Optimization Blog, Web Development. Follow responses to this entry via the RSS 2.0 feed.




June 16th, 2008 at 1:28 am
[…] Here is a wordpress tips that help you Get your own WordPress Plugin Information from vizioninteractive. […]