PluginProbe
Additional Terms Lite for WooCommerce / 1.6.1
Additional Terms Lite for WooCommerce v1.6.1
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.6.1, at src/Migration/Migration160.php

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