| 1 |
<?php |
| 2 |
|
| 3 |
use FluentSupport\Framework\Foundation\Application; |
| 4 |
use FluentSupport\App\Hooks\Handlers\ActivationHandler; |
| 5 |
use FluentSupport\App\Hooks\Handlers\DeactivationHandler; |
| 6 |
|
| 7 |
return function ($file) { |
| 8 |
|
| 9 |
register_activation_hook($file, function () { |
| 10 |
(new ActivationHandler)->handle(); |
| 11 |
}); |
| 12 |
|
| 13 |
register_deactivation_hook($file, function () { |
| 14 |
(new DeactivationHandler)->handle(); |
| 15 |
}); |
| 16 |
|
| 17 |
add_action('plugins_loaded', function () use ($file) { |
| 18 |
$application = new Application($file); |
| 19 |
do_action('fluent_support_loaded', $application); |
| 20 |
do_action('fluent_support_addons_loaded', $application); |
| 21 |
|
| 22 |
add_action('init', function () { |
| 23 |
load_plugin_textdomain('fluent-support', false, 'fluent-support/language/'); |
| 24 |
}); |
| 25 |
|
| 26 |
add_action('fluent_support/admin_app_loaded', function () { |
| 27 |
if (!wp_next_scheduled('fluent_support_hourly_tasks')) { |
| 28 |
wp_schedule_event(time(), 'hourly', 'fluent_support_hourly_tasks'); |
| 29 |
} |
| 30 |
|
| 31 |
if (!wp_next_scheduled('fluent_support_daily_tasks')) { |
| 32 |
wp_schedule_event(time(), 'daily', 'fluent_support_daily_tasks'); |
| 33 |
} |
| 34 |
|
| 35 |
if (!wp_next_scheduled('fluent_support_weekly_tasks')) { |
| 36 |
wp_schedule_event(time(), 'weekly', 'fluent_support_weekly_tasks'); |
| 37 |
} |
| 38 |
}); |
| 39 |
|
| 40 |
}); |
| 41 |
}; |
| 42 |
|