Change player columns setting to manual if upgrading from previous version

This commit is contained in:
Brian Miyaji
2016-04-14 18:55:47 +10:00
parent 6ba028f2cf
commit a28c3cd2a3

View File

@@ -88,6 +88,9 @@ class SP_Install {
// Queue upgrades
$current_version = get_option( 'sportspress_version', null );
// Do upgrades
$this->upgrades( $current_version );
// Update version
update_option( 'sportspress_version', SP()->version );
@@ -400,6 +403,20 @@ class SP_Install {
endif;
}
/**
* Make adjustments based on current version of the plugin
*
* @access public
* @return void
*/
public function upgrades( $version = null ) {
if ( null === $version ) return;
if ( version_compare( $version, '2.0', '<' ) ) {
update_option( 'sportspress_player_columns', 'manual' );
}
}
/**
* Get capabilities for SportsPress - these are assigned during installation or reset
*