PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 5.0.2
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v5.0.2
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 3.6.66 All 195 releases
fluentform / boot / app.php

app.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 5.0.2, at boot/app.php

73 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use FluentForm\Framework\Foundation\Application;
4 use FluentForm\App\Hooks\Handlers\ActivationHandler;
5 use FluentForm\App\Hooks\Handlers\DeactivationHandler;
6 use FluentForm\App\Services\Migrator\Bootstrap as FormsMigrator;
7 use FluentForm\App\Services\FluentConversational\Classes\Form as FluentConversational;
8
9 return function ($file) {
10 add_action('plugins_loaded', function () {
11 $isNotCompatible = defined('FLUENTFORMPRO') && version_compare(FLUENTFORMPRO_VERSION, '5.0.0', '<');
12 if ($isNotCompatible) {
13 $message = '<div><h3>Fluent Forms Pro is not working. Update required!</h3><p>Current version of the pro plugin is not compatible with the latest version of Core Plugin. <a href="' . admin_url('plugins.php?s=fluentformpro&plugin_status=all&force-check=1') . '">' . __('Please update Fluent Forms Pro to latest version', 'fluentform') . '</a>.</p></div>';
14 $actions = [
15 'fluentform/global_menu',
16 'fluentform/after_form_menu',
17 'admin_notices'
18 ];
19 foreach ($actions as $action) {
20 add_action($action, function () use ($message) {
21 printf('<div class="fluentform-admin-notice notice notice-error">%1$s</div>', $message);
22 });
23 }
24 }
25 });
26
27 $app = new Application($file);
28
29 register_activation_hook($file, function ($network_wide) use ($app) {
30 ($app->make(ActivationHandler::class))->handle($network_wide);
31 });
32
33 add_action('wp_insert_site', function ($blog) use ($app) {
34 if (is_plugin_active_for_network('fluentform/fluentform.php')) {
35 switch_to_blog($blog->blog_id);
36 ($app->make(ActivationHandler::class))->handle(false);
37 restore_current_blog();
38 }
39 });
40
41 register_deactivation_hook($file, function () use ($app) {
42 ($app->make(DeactivationHandler::class))->handle();
43 });
44
45 add_action('plugins_loaded', function () use ($app) {
46 do_action_deprecated(
47 'fluentform_loaded',
48 [
49 $app
50 ],
51 FLUENTFORM_FRAMEWORK_UPGRADE,
52 'fluentform/loaded',
53 'Use fluentform/loaded instead of fluentform_loaded.'
54 );
55
56 do_action_deprecated(
57 'fluentform-loaded',
58 [
59 $app
60 ],
61 FLUENTFORM_FRAMEWORK_UPGRADE,
62 'fluentform/loaded',
63 'Use fluentform/loaded instead of fluentform-loaded.'
64 );
65
66 do_action('fluentform/loaded', $app);
67 });
68
69 fluentformLoadFile('Services/FluentConversational/plugin.php');
70 (new FluentConversational)->boot();
71 (new FormsMigrator())->boot();
72 };
73