Skip to content
This repository has been archived by the owner on May 4, 2019. It is now read-only.

Commit

Permalink
Improved migration from 0.7 to 0.8 (backup of options)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Köster committed Feb 15, 2017
1 parent 3ae6481 commit daf2286
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions admin/class-rpr-admin-migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,15 @@ public function rpr_do_migration() {
* @since 0.8.0
*/
private function rpr_update_from_4(){



$new_options = get_option( 'rpr_options' );
$old_options = get_option( 'rpr_option' );
// Move options to new scheme:

// create a backup of the old options:
update_option( 'rpr_options_backup', $old_options );

// Move options to new scheme:

// General options
if( $old_options['recipe_slug'] ){
Expand Down Expand Up @@ -302,7 +307,7 @@ private function rpr_update_from_4(){
$new_options['advanced']['display_time'] = $old_options['recipe_time_display_in_recipe'];
$new_options['advanced']['display_categories'] = $old_options['recipe_display_categories_in_recipe'];
$new_options['advanced']['display_tags'] = $old_options['recipe_display_tags_in_recipe'];

// Save the new options
update_option( 'rpr_options', $new_options );
update_option( 'rpr_dbversion', 5);
Expand Down

0 comments on commit daf2286

Please sign in to comment.