• I’m writing a plugin which aims to be system agnostic, so it will work on WordPress and other platforms. One of the things it does to accomplish this is maintain its own version number and reconciliation process:

    if( needsPatch(installedVersion, newFeatureVersion)){
        installNewFeature();
    }

    All of this works fine, but what I’m running into is the WordPress plugin header version “tag”:

    /*
    Plugin Name: My Versatile Plugin
    Plugin URI: https://my_home_page.com
    Version: 0.0.8
    */

    I’d REALLY like to avoid updating the version in two places (once as the value of a variable, and once in this comment); so my question is:

    Is it possible to make WordPress look at a variable for its header data, an if not, is there a way to reflect the VALUE of a variable in a comment.

    As an alternative, is there a “Build’ technique that other’s use to inject a value into both places at “Compile” time?

Viewing 1 replies (of 1 total)
  • Thread Starter Flare576

    (@flare576)

    Is there maybe a function that WordPress calls when creating the plugins page that I could addAction() on and inject a version?

Viewing 1 replies (of 1 total)
  • The topic ‘Using a variable in a Plugin's header’ is closed to new replies.