Provides a simple way of displaying up-to-date information about specific WordPress Plugin Directory hosted plugins in your blog posts and pages.
Screenshots
Adding a plugin to a post. Remember to use the slug and not the name, as using the name isn't 100% reliable.
FAQ
Is this plugin for me?
This plugin will be of use to you if:
- You are a plugin author and you want an easy way to include up to date information about any of your plugins in your blog posts or pages.
- You are the author of a blog that highlights plugins of interest and you want to ensure that information in your posts remains up to date.
Which attributes of a plugin can I display?
The available shortcodes can be seen from the post writing screen. Just click the [show]
link in the ‘Plugin Info’ box.
Shortcodes which display a formatted hyperlink can have their default link text overridden via the text
attribute on the shortcode. For example: [plugin homepage text='Home Page']
will display a link to the plugin homepage with the link text ‘Home Page’.
Can I display plugin info outside of my blog posts?
Yes! You can use the plugin_info()
function anywhere in your template. The function takes two parameters, the slug of your plugin and the attribute you’d like to display. The following example will display the last updated date for my User Switching plugin:
plugin_info( 'user-switching', 'updated' );`
You can also get the info rather than printing it out using the get_plugin_info()
function:
$updated = get_plugin_info( 'user-switching', 'updated' );`
Be aware that plugin information isn’t cached between page requests using this method, so be sure to implement some caching of your own.
The geek stuff
The plugin information is collected from wordpress.org each time you save your post or page. It is updated hourly using WordPress’ cron system and uses the Plugin API in WordPress core. The plugin data is cached as an associative array in a custom field called plugin-info
, and the plugin slug you enter is saved as a custom field called plugin
. This means you can also access the plugin data using get_post_meta()
, but I’ll let you figure that out for yourself.
ChangeLog