PluginProbe
Fluent Support – Helpdesk & Customer Support Ticket System / 2.4.5
Fluent Support – Helpdesk & Customer Support Ticket System v2.4.5
2.4.5 2.4.0 2.3.2 2.3.1 2.3.0 2.2.1 2.2.0 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.4.0 1.4.1 1.4.2 1.4.5 1.4.6 1.4.7 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 All 69 releases
fluent-support / app / Hooks / actions.php

actions.php in Fluent Support – Helpdesk & Customer Support Ticket System 2.4.5, at app/Hooks/actions.php

88 lines 3.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 defined('ABSPATH') or die;
4
5 /**
6 * @var $app FluentSupport\Framework\Foundation\Application
7 */
8
9 (new \FluentSupport\App\Hooks\Handlers\AuthHandler)->init();
10
11 $app->addCustomAction('handle_exception', 'ExceptionHandler@handle');
12
13 $app->addAction('admin_menu', 'Menu@add');
14 $app->addAction('admin_enqueue_scripts', 'Menu@maybeEnqueueAssets');
15 $app->addAction('admin_bar_menu', 'AdminBarHandler@init');
16 $app->addAction('wp_dashboard_setup', 'AdminBarHandler@initAdminWidget');
17
18 $app->addShortcode('fluent_support_portal', 'ShortcodeHandler@fluentSupportPortal');
19
20 add_action('init', function () {
21 (new \FluentSupport\App\Services\Integrations\IntegrationInit())->init();
22 });
23
24 (new \FluentSupport\App\Hooks\Handlers\ActivityLogger())->init();
25
26 (new \FluentSupport\App\Hooks\Handlers\AIActivityLogger())->init();
27
28 (new \FluentSupport\App\Hooks\Handlers\InternalNotificationHandler())->init();
29
30 $app->addAction('fluent_support/ticket_created', 'EmailNotificationHandler@ticketCreated', 10, 2);
31 $app->addAction('fluent_support/response_added_by_agent', 'EmailNotificationHandler@agentReplied', 10, 3);
32 $app->addAction('fluent_support/response_added_by_customer', 'EmailNotificationHandler@customerReplied', 10, 3);
33 $app->addAction('fluent_support/ticket_closed_by_agent', 'EmailNotificationHandler@closedByAgent', 10, 2);
34 $app->addAction('fluent_support/agent_assigned_to_ticket', 'EmailNotificationHandler@onAgentAssign', 10, 3);
35 $app->addAction('fluent_support/ticket_created_behalf_of_customer', 'EmailNotificationHandler@ticketCreatedByAgent', 10, 3);
36 $app->addAction('fluent_support/agent_initiated_ticket_response', 'EmailNotificationHandler@ticketCreatedByAgentOnBehalf', 10, 3);
37
38 $app->addAction('fluent_support/async_agent_assigned_to_ticket', 'AsyncActionHandler@resolveAgentAssigned', 10, 4);
39
40 $app->addAction('fluent_support_hourly_tasks', 'CleanupHandler@initHourlyTasks');
41 $app->addAction('fluent_support_daily_tasks', 'CleanupHandler@initDailyTasks');
42 $app->addAction('fluent_support_weekly_tasks', 'CleanupHandler@maybeMaintanceTask');
43
44 $app->addAction('fluent_support/deleting_ticket', 'CleanupHandler@deleteTicketAttachments');
45 $app->addAction('fluent_support/ticket_closed', 'CleanupHandler@maybeDeleteAttachmentsOnClose');
46
47 if(isset($_GET['fs_view'])) {
48 $app->addAction('init', 'ExternalPages@route');
49 }
50
51 if (isset($_GET['fst_file'])) {
52 add_action('init', function () {
53 (new \FluentSupport\App\Hooks\Handlers\ExternalPages())->view_attachment();
54 });
55 }
56
57 if ( defined( 'WP_CLI' ) && WP_CLI ) {
58 \WP_CLI::add_command( 'fluent_support', '\FluentSupport\App\Hooks\CLI\FluentCli' );
59 }
60
61
62 (new \FluentSupport\App\Hooks\Handlers\PermissionFilterManager)->init();
63
64 (new \FluentSupport\App\Hooks\Handlers\PrivacyHandler())->init();
65
66 $app->addAction('profile_update', '\FluentSupport\App\Services\ProfileInfoService@onWPProfileUpdate', 10, 3);
67
68 // Registration is the only point that auto-links a customer row to a WP user.
69 // An email change alone never claims a row.
70 $app->addAction('user_register', '\FluentSupport\App\Services\ProfileInfoService@onWPUserRegister', 10, 1);
71 $app->addAction('wp_ajax_fs_export_agent_report', 'FluentSupport\App\Hooks\Handlers\DataExporter@exportReport');
72
73 // Disable LiteSpeed ESI on Fluent Support requests.
74 if(defined('LSCWP_V')){
75 add_action('litespeed_init', function (){
76 if(isset($_SERVER['REQUEST_URI']) && strpos(esc_url_raw(wp_unslash($_SERVER['REQUEST_URI'])), 'fluent-support') !== false){
77 defined( 'LITESPEED_ESI_OFF' ) || define( 'LITESPEED_ESI_OFF', true );
78 }
79 });
80 }
81
82 $app->addAction('init', 'BlockEditorHandler@init');
83
84 // Boot MCP unconditionally so FluentHub can list us on WP < 6.9. The
85 // ability/server hooks only fire when the Abilities API or MCP adapter exists.
86 \FluentSupport\App\Modules\MCP\MCPInit::boot();
87
88