Plugin Directory

Changeset 715812


Ignore:
Timestamp:
05/21/2013 12:28:39 AM (13 years ago)
Author:
bholtsclaw
Message:

new get version function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gplus-comments/trunk/gplus-comments.php

    r715779 r715812  
    3333}
    3434
    35 /**
    36  * Returns current plugin version.
    37  */
    3835function gplus_comments_get_version() {
    39   $plugin_data = get_plugin_data( __FILE__, false, false );
    40   $plugin_version = $plugin_data['Version'];
    41   return $plugin_version;
     36  $version = 0;
     37  $plugin_file = file_get_contents(__FILE__);
     38  preg_match('#^\s*Version\:\s*(.*)$#im', $plugin_file, $matches);
     39  if (!empty($matches[1]))
     40  {
     41    $version = $matches[1];
     42  }
     43  return $version;
    4244}
    4345
    44 define('GPLUS_COMMENTS_VERSION', '1.4.11');
     46define('GPLUS_COMMENTS_VERSION', gplus_comments_get_version());
    4547defined('GPLUS_COMMENTS_DEFAULT_TAB_ORDER') or define('GPLUS_COMMENTS_DEFAULT_TAB_ORDER', 'gplus,facebook,wordpress');
    4648defined('GPLUS_COMMENTS_DEBUG') or define('GPLUS_COMMENTS_DEBUG', false);
     
    4951defined('GPLUS_COMMENTS_LIB') or define('GPLUS_COMMENTS_LIB', GPLUS_COMMENTS_DIR . "/lib");
    5052defined('GPLUS_COMMENTS_TEMPLATES') or define('GPLUS_COMMENTS_TEMPLATES', GPLUS_COMMENTS_DIR . "/templates");
    51 
    52 //require __DIR__ . '/lib/init.php';
    5353
    5454require GPLUS_COMMENTS_LIB . '/hooks.php';
Note: See TracChangeset for help on using the changeset viewer.