I Want to Get A Plugin Version Number Dynamically

Howdy, I recently cribbed W3TC to implement an “in-update” changelist display (very cool), in my plugin, but there’s an awkward bit of code I’d prefer to avoid.

If you look at the top of this file, you’ll see the following code:

define ( 'BMLT_CURRENT_VERSION', '2.1.16' ); // This needs to be kept in synch with the version above.

Ick. 😛

That needs to be kept up to date, so the function can delta between your plugin, and the current stable version.

I have perused the Codex, and can’t find it, but there has GOT to be an API function for getting the version of a plugin.

Any clues?

6

Here is an answer with some code that will do what you want it to do: Is there a way for a plug-in to get it’s own version number?

Leave a Comment