Permalink
Browse files

Ensure upgrades are always fired when necessary.

  • Loading branch information...
1 parent 9fb7c09 commit 38e3aad99b7b74595fddbd349f6e027e8e447de6 Michael Sisk committed Jan 22, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 -/php/admin.php
View
@@ -36,6 +36,10 @@ public function __construct() {
register_activation_hook( self::$dir . 'webcomic.php', array( $this, 'activate' ) );
register_deactivation_hook( self::$dir . 'webcomic.php', array( $this, 'deactivate' ) );
+ if ( !self::$config or version_compare( self::$config[ 'version' ], self::$version, '<' ) ) {
+ $this->activate();
+ }
+
if ( self::$config and version_compare( self::$config[ 'version' ], '4x', '>=' ) ) {
add_action( 'admin_init', array( $this, 'admin_init' ) );
add_action( 'admin_head', array( $this, 'admin_head' ) );

0 comments on commit 38e3aad

Please sign in to comment.