Permalink
Browse files

Fix version number not persisting to back-end database. Add version n…

…umber to settings display.
  • Loading branch information...
1 parent f80fc37 commit e17259c5d2fcb4bfcd562ae2fbdefc67e888b459 @vicchi committed Apr 14, 2012
Showing with 8 additions and 5 deletions.
  1. +8 −5 wp-quadratum.php
View
@@ -47,7 +47,8 @@ class WPQuadratum extends WP_PluginBase {
static $instance;
const OPTIONS = 'wp_quadratum_settings';
- const WPQUADRATUM_VERSION = '10';
+ const VERSION = '10';
+ const DISPLAY_VERSION = 'v1.0';
function __construct () {
self::$instance = $this;
@@ -95,7 +96,7 @@ function add_settings () {
$settings = apply_filters ('wp_quadratum_default_settings',
array (
"installed" => "on",
- "version" => WPQUADRATUM_VERSION,
+ "version" => self::VERSION,
"client_id" => "",
"client_secret" => "",
"oauth_token" => ""
@@ -202,7 +203,7 @@ function admin_upgrade () {
$options = $this->get_option ();
if (is_array ($options) &&
!empty ($options['version']) &&
- $options['version'] == WPQUADTRATUM_VERSION) {
+ $options['version'] == self::VERSION) {
return;
}
@@ -221,7 +222,7 @@ function admin_upgrade () {
switch ($current_plugin_version) {
case '00':
case '10':
- $options['version'] = WPQUADRATUM_VERSION;
+ $options['version'] = self::VERSION;
$upgrade_settings = true;
default:
@@ -364,7 +365,9 @@ function admin_display_settings () {
$wrapped_content[] = $this->admin_postbox ('wp-quadratum-nokia-settings',
$nokia_title, implode ('', $nokia_settings));
- $this->admin_wrap (__('WP Quadratum Settings And Options'), implode ('', $wrapped_content));
+ $this->admin_wrap (
+ sprintf (__('WP Quadratum %s - Settings And Options'), self::DISPLAY_VERSION),
+ implode ('', $wrapped_content));
}
function admin_option ($field) {

0 comments on commit e17259c

Please sign in to comment.