| 1 |
<?php |
| 2 |
/** |
| 3 |
* Migration for the version 1.6.0. |
| 4 |
* |
| 5 |
* @since 1.6.0 |
| 6 |
* |
| 7 |
* @package woo-additional-terms |
| 8 |
*/ |
| 9 |
|
| 10 |
namespace Woo_Additional_Terms\Migration; |
| 11 |
|
| 12 |
/** |
| 13 |
* Migration class. |
| 14 |
*/ |
| 15 |
class Migration160 extends Migration { |
| 16 |
|
| 17 |
/** |
| 18 |
* Constructor. |
| 19 |
* |
| 20 |
* @since 1.6.0 |
| 21 |
* |
| 22 |
* @return void |
| 23 |
*/ |
| 24 |
public function __construct() { |
| 25 |
|
| 26 |
// Parent constructor. |
| 27 |
parent::__construct( '1.6.0' ); |
| 28 |
} |
| 29 |
|
| 30 |
/** |
| 31 |
* Do the migration. |
| 32 |
* |
| 33 |
* @since 1.6.0 |
| 34 |
* |
| 35 |
* @return void |
| 36 |
*/ |
| 37 |
public function migrate_callback() { |
| 38 |
|
| 39 |
// Bailout, if not eligible. |
| 40 |
if ( ! $this->is_eligible() ) { |
| 41 |
return; |
| 42 |
} |
| 43 |
|
| 44 |
woo_additional_terms()->service( 'options' )->update( |
| 45 |
array( |
| 46 |
'status' => '1', |
| 47 |
'required' => 'yes', |
| 48 |
'page' => wc_clean( get_option( '_woo_additional_terms_page_id', '' ) ), |
| 49 |
'notice' => wc_clean( get_option( '_woo_additional_terms_notice', '' ) ), |
| 50 |
'error' => wc_clean( get_option( '_woo_additional_terms_error', '' ) ), |
| 51 |
) |
| 52 |
); |
| 53 |
|
| 54 |
// Mark the migration as complete. |
| 55 |
$this->complete(); |
| 56 |
} |
| 57 |
} |
| 58 |
|