Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/fluentform/boot/app.php
Keine Baseline-Datei – Diff nur gegen leer.
1
-
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
+
use FluentForm\App\Helpers\Helper;
9
+
10
+
return function ($file) {
11
+
add_action('plugins_loaded', function () {
12
+
$isNotCompatible = defined('FLUENTFORMPRO') && version_compare(FLUENTFORMPRO_VERSION, FLUENTFORM_MINIMUM_PRO_VERSION, '<');
13
+
if ($isNotCompatible) {
14
+
add_action('admin_init', function () {
15
+
$message = '<div style="padding: 15px 10px;" ><b>' . __('Heads UP: ',
16
+
'fluentform') . '</b>' . __('Fluent Forms Pro Plugin needs to be updated to the latest version.',
17
+
'fluentform') . '<a href="' . admin_url('plugins.php?s=fluentformpro&plugin_status=all&force-check=1') . '">' . __(' Please update Fluent Forms Pro to latest version.',
18
+
'fluentform') . '</a></div>';
19
+
$actions = [
20
+
'fluentform/global_menu',
21
+
'fluentform/after_form_menu',
22
+
];
23
+
foreach ($actions as $action) {
24
+
add_action($action, function () use ($message) {
25
+
printf('<div class="fluentform-admin-notice notice notice-success">%1$s</div>', esc_html($message));
26
+
});
27
+
}
28
+
});
29
+
}
30
+
});
31
+
32
+
$app = new Application($file);
33
+
34
+
register_activation_hook($file, function ($network_wide) use ($app) {
35
+
($app->make(ActivationHandler::class))->handle($network_wide);
36
+
});
37
+
38
+
add_action('wp_insert_site', function ($blog) use ($app) {
39
+
if (is_plugin_active_for_network('fluentform/fluentform.php')) {
40
+
switch_to_blog($blog->blog_id);
41
+
($app->make(ActivationHandler::class))->handle(false);
42
+
restore_current_blog();
43
+
}
44
+
});
45
+
46
+
register_deactivation_hook($file, function () use ($app) {
47
+
($app->make(DeactivationHandler::class))->handle();
48
+
});
49
+
50
+
add_action('plugins_loaded', function () use ($app) {
51
+
do_action_deprecated(
52
+
'fluentform_loaded',
53
+
[
54
+
$app
55
+
],
56
+
FLUENTFORM_FRAMEWORK_UPGRADE,
57
+
'fluentform/loaded',
58
+
'Use fluentform/loaded instead of fluentform_loaded.'
59
+
);
60
+
61
+
do_action_deprecated(
62
+
'fluentform-loaded',
63
+
[
64
+
$app
65
+
],
66
+
FLUENTFORM_FRAMEWORK_UPGRADE,
67
+
'fluentform/loaded',
68
+
'Use fluentform/loaded instead of fluentform-loaded.'
69
+
);
70
+
do_action('fluentform/loaded', $app);
71
+
72
+
});
73
+
74
+
fluentformLoadFile('Services/FluentConversational/plugin.php');
75
+
fluentformLoadFile('Services/Libraries/action-scheduler/action-scheduler.php');
76
+
77
+
(new FluentConversational)->boot();
78
+
(new FormsMigrator())->boot();
79
+
80
+
/* Plugin Meta Links */
81
+
82
+
add_filter('plugin_row_meta', 'fluentform_plugin_row_meta', 10, 2);
83
+
84
+
function fluentform_plugin_row_meta($links, $file)
85
+
{
86
+
if ('fluentform/fluentform.php' == $file) {
87
+
$row_meta = [
88
+
'docs' => '<a rel="noopener" href="https://fluentforms.com/docs" style="color: #197efb;font-weight: 600;" aria-label="' . esc_attr__('View FluentForms Documentation', 'fluentform') . '" target="_blank">' . esc_html__('Docs', 'fluentform') . '</a>',
89
+
'support' => '<a rel="noopener" href="https://wpmanageninja.com/support-tickets/#/" style="color: #197efb;font-weight: 600;" aria-label="' . esc_attr__('Get Support', 'fluentform') . '" target="_blank">' . esc_html__('Support', 'fluentform') . '</a>',
90
+
'developer_docs' => '<a rel="noopener" href="https://developers.fluentforms.com" style="color: #197efb;font-weight: 600;" aria-label="' . esc_attr__('Developer Docs', 'fluentform') . '" target="_blank">' . esc_html__('Developer Docs', 'fluentform') . '</a>',
91
+
];
92
+
if (!defined('FLUENTFORMPRO')) {
93
+
$row_meta['pro'] = '<a rel="noopener" href="https://fluentforms.com" style="color: #7742e6;font-weight: bold;" aria-label="' . esc_attr__('Upgrade to Pro', 'fluentform') . '" target="_blank">' . esc_html__('Upgrade to Pro', 'fluentform') . '</a>';
94
+
}
95
+
return array_merge($links, $row_meta);
96
+
}
97
+
return (array)$links;
98
+
}
99
+
};
100
+