PluginProbe
Additional Terms Lite for WooCommerce / 1.7.3
Additional Terms Lite for WooCommerce v1.7.3
1.7.3 1.7.2.1 trunk 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.2.2 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.6.0 1.6.1 1.6.2 1.6.3 All 35 releases
woo-additional-terms / src / Migration / Migration160.php

Migration160.php in Additional Terms Lite for WooCommerce 1.7.3, at src/Migration/Migration160.php

58 lines 1005 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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