PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.6
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.6
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
fluentform / app / Modules / Payments / Migrations / Migration.php

Migration.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 6.2.6, at app/Modules/Payments/Migrations/Migration.php

40 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentForm\App\Modules\Payments\Migrations;
4
5 if (!defined('ABSPATH')) {
6 exit; // Exit if accessed directly.
7 }
8
9 class Migration
10 {
11 public static function run($network_wide = false)
12 {
13 global $wpdb;
14 if ($network_wide) {
15 // Retrieve all site IDs from this network (WordPress >= 4.6 provides easy to use functions for that).
16 if (function_exists('get_sites') && function_exists('get_current_network_id')) {
17 $site_ids = get_sites(array('fields' => 'ids', 'network_id' => get_current_network_id()));
18 } else {
19 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Multisite migration, direct query needed
20 $site_ids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs WHERE site_id = $wpdb->siteid;");
21 }
22 // Install the plugin for all these sites.
23 foreach ($site_ids as $site_id) {
24 switch_to_blog($site_id);
25 self::migrate();
26 restore_current_blog();
27 }
28 } else {
29 self::migrate();
30 }
31 }
32
33 public static function migrate()
34 {
35 OrderItems::migrate();
36 Transactions::migrate();
37 OrderSubscriptions::migrate();
38 }
39 }
40