fluentcart-developer 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +59 -59
  2. package/dist/cards/fluentcart/tools.d.ts.map +1 -1
  3. package/dist/cards/fluentcart/tools.js +2301 -2161
  4. package/dist/cards/fluentcart/tools.js.map +1 -1
  5. package/dist/skills/fluentcart-developer/.claude-plugin/plugin.json +12 -12
  6. package/dist/skills/fluentcart-developer/.mcp.json +11 -11
  7. package/dist/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/fluent-cart/checkout.php +32 -32
  8. package/dist/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/functions.php +40 -40
  9. package/dist/skills/fluentcart-developer/examples/sample-fee-surcharge-plugin/fluentcart-fee-surcharge.php +38 -38
  10. package/dist/skills/fluentcart-developer/references/action-hooks-cart-checkout.md +1355 -1355
  11. package/dist/skills/fluentcart-developer/references/action-hooks-customers-users.md +266 -266
  12. package/dist/skills/fluentcart-developer/references/action-hooks-licenses.md +855 -855
  13. package/dist/skills/fluentcart-developer/references/action-hooks-orders.md +631 -631
  14. package/dist/skills/fluentcart-developer/references/action-hooks-payments-integrations.md +963 -963
  15. package/dist/skills/fluentcart-developer/references/action-hooks-products-coupons.md +585 -585
  16. package/dist/skills/fluentcart-developer/references/action-hooks-subscriptions.md +661 -661
  17. package/dist/skills/fluentcart-developer/references/database-models-query-builder.md +194 -194
  18. package/dist/skills/fluentcart-developer/references/database-models-reference.md +604 -604
  19. package/dist/skills/fluentcart-developer/references/engineering-notes.md +154 -154
  20. package/dist/skills/fluentcart-developer/references/fee-system-guide.md +449 -449
  21. package/dist/skills/fluentcart-developer/references/filter-hooks-cart-checkout.md +1202 -1202
  22. package/dist/skills/fluentcart-developer/references/filter-hooks-integrations-advanced.md +1598 -1598
  23. package/dist/skills/fluentcart-developer/references/filter-hooks-products-pricing.md +628 -628
  24. package/dist/skills/fluentcart-developer/references/filter-hooks-settings-configuration.md +1177 -1177
  25. package/dist/skills/fluentcart-developer/references/fluentcart-developer-guide.md +154 -154
  26. package/dist/skills/fluentcart-developer/references/ghost-product-selling.md +458 -458
  27. package/dist/skills/fluentcart-developer/references/modules-and-extensions-reference.md +224 -224
  28. package/dist/skills/fluentcart-developer/references/payment-gateway-integration.md +761 -761
  29. package/dist/skills/fluentcart-developer/references/rest-api-customer-profile.md +190 -190
  30. package/dist/skills/fluentcart-developer/references/rest-api-customers.md +1121 -1121
  31. package/dist/skills/fluentcart-developer/references/rest-api-dashboard-utilities.md +219 -219
  32. package/dist/skills/fluentcart-developer/references/rest-api-email-notifications.md +619 -619
  33. package/dist/skills/fluentcart-developer/references/rest-api-files.md +290 -290
  34. package/dist/skills/fluentcart-developer/references/rest-api-integrations.md +324 -324
  35. package/dist/skills/fluentcart-developer/references/rest-api-labels-attributes.md +321 -321
  36. package/dist/skills/fluentcart-developer/references/rest-api-order-bumps.md +200 -200
  37. package/dist/skills/fluentcart-developer/references/rest-api-overview.md +131 -131
  38. package/dist/skills/fluentcart-developer/references/rest-api-public-shop.md +172 -172
  39. package/dist/skills/fluentcart-developer/references/rest-api-reference.md +552 -552
  40. package/dist/skills/fluentcart-developer/references/rest-api-reports.md +377 -377
  41. package/dist/skills/fluentcart-developer/references/rest-api-roles-permissions.md +147 -147
  42. package/dist/skills/fluentcart-developer/references/rest-api-settings.md +528 -528
  43. package/dist/skills/fluentcart-developer/references/rest-api-shipping.md +799 -799
  44. package/dist/skills/fluentcart-developer/references/rest-api-tax.md +356 -356
  45. package/dist/skills/fluentcart-developer/references/subscription-customization.md +197 -197
  46. package/dist/skills/fluentcart-developer/scripts/cli.js +1 -1
  47. package/dist/version.d.ts +1 -1
  48. package/dist/version.js +1 -1
  49. package/package.json +65 -65
@@ -1,1177 +1,1177 @@
1
- # Filter Hooks: Settings & Configuration
2
-
3
- All filters related to admin settings, store configuration, module management, currency formatting, admin UI, permissions, translations, email notifications, and block editor.
4
-
5
- ---
6
-
7
- ## Store Settings
8
-
9
- ### `store_settings/values`
10
- `fluent_cart/store_settings/values` — Filter default store settings values
11
-
12
- * **When it runs:** This filter is applied when retrieving the default store settings, before merging with saved values. Use it to add or modify defaults for all store configuration options.
13
- * **Source:** `api/StoreSettings.php` (line 89)
14
-
15
- #### Parameters:
16
- * `$defaultSettings` *(array)* — The default store settings (`currency`, `order_mode`, `checkout_button_text`, etc.)
17
- * `$data` *(array)* — Additional context data (empty array)
18
- * **Returns:** *(array)* — The modified default settings array
19
-
20
- #### Usage Example:
21
- ```php
22
- // Filter default store settings values before merging with saved options
23
- add_filter('fluent_cart/store_settings/values', function ($defaultSettings, $data) {
24
- // Change default currency to EUR and set order mode to live
25
- $defaultSettings['currency'] = 'EUR';
26
- $defaultSettings['order_mode'] = 'live';
27
- return $defaultSettings;
28
- }, 10, 2);
29
- ```
30
-
31
- ---
32
-
33
- ### `store_settings/fields`
34
- `fluent_cart/store_settings/fields` — Filter store settings form field definitions
35
-
36
- * **When it runs:** This filter is applied when rendering the store settings form in the admin interface. Use it to add, remove, or modify settings tabs and fields.
37
- * **Source:** `api/StoreSettings.php` (line 1141)
38
-
39
- #### Parameters:
40
- * `$fields` *(array)* — Nested array of settings tabs and field definitions (`setting_tabs -> schema`)
41
- * `$data` *(array)* — Additional context data (empty array)
42
- * **Returns:** *(array)* — The modified fields array
43
-
44
- #### Usage Example:
45
- ```php
46
- // Filter store settings form field definitions in admin interface
47
- add_filter('fluent_cart/store_settings/fields', function ($fields, $data) {
48
- // Add a custom settings section tab and field
49
- $fields['setting_tabs']['schema']['custom_tab'] = [
50
- 'title' => 'Custom Settings',
51
- 'fields' => [
52
- [
53
- 'key' => 'custom_field',
54
- 'label' => 'Custom Field',
55
- 'type' => 'text',
56
- ]
57
- ]
58
- ];
59
- return $fields;
60
- }, 10, 2);
61
- ```
62
-
63
- ---
64
-
65
- ### `store_settings/rules`
66
- `fluent_cart/store_settings/rules` — Filter validation rules for store settings
67
-
68
- * **When it runs:** This filter is applied when validating store settings form submissions. Use it to add or modify validation rules for settings fields.
69
- * **Source:** `app/Http/Requests/FluentMetaRequest.php` (line 34)
70
-
71
- #### Parameters:
72
- * `$rules` *(array)* — Validation rules keyed by field name (`'store_name' => 'required|...'`)
73
- * **Returns:** *(array)* — The modified validation rules array
74
-
75
- #### Usage Example:
76
- ```php
77
- // Filter validation rules for store settings form submissions
78
- add_filter('fluent_cart/store_settings/rules', function ($rules) {
79
- // Add validation rules for custom settings field
80
- $rules['custom_field'] = 'required|sanitizeText|maxLength:100';
81
- return $rules;
82
- });
83
- ```
84
-
85
- ---
86
-
87
- ### `store_settings/sanitizer`
88
- `fluent_cart/store_settings/sanitizer` — Filter sanitization rules for store settings
89
-
90
- * **When it runs:** This filter is applied when sanitizing store settings input before saving. Each key maps to a sanitize callback function or callable.
91
- * **Source:** `app/Http/Requests/FluentMetaRequest.php` (line 136)
92
-
93
- #### Parameters:
94
- * `$sanitizer` *(array)* — Sanitization callbacks keyed by field name
95
- * **Returns:** *(array)* — The modified sanitizer array
96
-
97
- #### Usage Example:
98
- ```php
99
- // Filter sanitization rules for store settings before saving
100
- add_filter('fluent_cart/store_settings/sanitizer', function ($sanitizer) {
101
- // Add sanitizer callback for custom settings field
102
- $sanitizer['custom_field'] = 'sanitize_text_field';
103
- return $sanitizer;
104
- });
105
- ```
106
-
107
- ---
108
-
109
- ### `confirmation_setting_fields`
110
- `fluent_cart/confirmation_setting_fields` — Filter confirmation page settings fields
111
-
112
- * **When it runs:** This filter is applied when rendering the confirmation (receipt) page settings in the admin. Use it to add additional settings fields for the order confirmation page.
113
- * **Source:** `api/Confirmation.php` (line 76)
114
-
115
- #### Parameters:
116
- * `$fields` *(array)* — Field definitions for the confirmation page settings
117
- * `$data` *(array)* — Additional context data (empty array)
118
- * **Returns:** *(array)* — The modified fields array
119
-
120
- #### Usage Example:
121
- ```php
122
- // Filter confirmation page settings fields in admin
123
- add_filter('fluent_cart/confirmation_setting_fields', function ($fields, $data) {
124
- // Add a custom confirmation page setting checkbox
125
- $fields['show_social_share'] = [
126
- 'label' => 'Show social share buttons',
127
- 'type' => 'checkbox',
128
- 'value' => 'no',
129
- ];
130
- return $fields;
131
- }, 10, 2);
132
- ```
133
-
134
- ---
135
-
136
- ## Module Settings
137
-
138
- ### `module_setting/fields`
139
- `fluent_cart/module_setting/fields` — Filter module settings form fields
140
-
141
- * **When it runs:** This filter is applied when retrieving module settings field definitions. Modules register their settings fields through this filter.
142
- * **Source:** `api/ModuleSettings.php` (line 21)
143
-
144
- #### Parameters:
145
- * `$fields` *(array)* — Array of module settings field definitions (empty by default)
146
- * `$data` *(array)* — Additional context data (empty array)
147
- * **Returns:** *(array)* — The modified fields array
148
-
149
- #### Usage Example:
150
- ```php
151
- // Filter module settings form field definitions
152
- add_filter('fluent_cart/module_setting/fields', function ($fields, $data) {
153
- // Register custom module settings fields
154
- $fields['custom_module'] = [
155
- 'title' => 'Custom Module',
156
- 'fields' => [
157
- [
158
- 'key' => 'api_key',
159
- 'label' => 'API Key',
160
- 'type' => 'text',
161
- ]
162
- ]
163
- ];
164
- return $fields;
165
- }, 10, 2);
166
- ```
167
-
168
- ---
169
-
170
- ### `module_setting/default_values`
171
- `fluent_cart/module_setting/default_values` — Filter module settings default values
172
-
173
- * **When it runs:** This filter is applied when retrieving all module settings. It provides default values that are merged with saved settings, ensuring newly registered modules have their defaults applied.
174
- * **Source:** `api/ModuleSettings.php` (line 42)
175
-
176
- #### Parameters:
177
- * `$defaults` *(array)* — Default values for module settings (empty by default)
178
- * `$data` *(array)* — Additional context data (empty array)
179
- * **Returns:** *(array)* — The modified defaults array keyed by module name
180
-
181
- #### Usage Example:
182
- ```php
183
- // Filter module settings default values
184
- add_filter('fluent_cart/module_setting/default_values', function ($defaults, $data) {
185
- // Set default values array for custom module
186
- $defaults['custom_module'] = [
187
- 'active' => 'no',
188
- 'api_key' => '',
189
- 'mode' => 'sandbox',
190
- ];
191
- return $defaults;
192
- }, 10, 2);
193
- ```
194
-
195
- ---
196
-
197
- ### `module_settings/plugin_addons`
198
- `fluent_cart/module_settings/plugin_addons` — Filter plugin add-on modules list
199
-
200
- * **When it runs:** This filter is applied when listing available plugin add-ons in the module settings page. Use it to register third-party add-on modules that can be installed from the admin.
201
- * **Source:** `app/Http/Controllers/ModuleSettingsController.php` (line 199)
202
-
203
- #### Parameters:
204
- * `$addons` *(array)* — Array of add-on module definitions (`title`, `description`, `logo`, `plugin_slug`, etc.)
205
- * **Returns:** *(array)* — The modified add-ons array
206
-
207
- #### Usage Example:
208
- ```php
209
- // Filter plugin add-on modules list in module settings page
210
- add_filter('fluent_cart/module_settings/plugin_addons', function ($addons) {
211
- // Register a custom add-on module to the admin list
212
- $addons[] = [
213
- 'title' => 'My Custom Add-on',
214
- 'description' => 'Extends FluentCart with custom features.',
215
- 'logo' => plugin_dir_url(__FILE__) . 'logo.svg',
216
- 'plugin_slug' => 'my-custom-addon',
217
- 'plugin_file' => 'my-custom-addon/my-custom-addon.php',
218
- 'source_type' => 'cdn',
219
- 'source_link' => 'https://example.com/my-addon.zip',
220
- 'upcoming' => false,
221
- ];
222
- return $addons;
223
- });
224
- ```
225
-
226
- ---
227
-
228
- ## Currency & Formatting
229
-
230
- ### `global_currency_setting`
231
- `fluent_cart/global_currency_setting` — Filter global currency settings
232
-
233
- * **When it runs:** This filter is applied when retrieving the global currency configuration. It runs after all currency settings have been resolved from stored values and defaults.
234
- * **Source:** `api/CurrencySettings.php` (line 52)
235
-
236
- #### Parameters:
237
- * `$settings` *(array)* — Resolved currency settings (`currency`, `currency_sign`, `currency_position`, `decimal_separator`, etc.)
238
- * `$data` *(array)* — Additional context data (empty array)
239
- * **Returns:** *(array)* — The modified currency settings
240
-
241
- #### Usage Example:
242
- ```php
243
- // Filter global currency settings array
244
- add_filter('fluent_cart/global_currency_setting', function ($settings, $data) {
245
- // Override currency, symbol, and symbol position
246
- $settings['currency'] = 'EUR';
247
- $settings['currency_sign'] = '€';
248
- $settings['currency_position'] = 'right';
249
- return $settings;
250
- }, 10, 2);
251
- ```
252
-
253
- ---
254
-
255
- ### `available_currencies`
256
- `fluent-cart/available_currencies` — Filter available currencies for the store
257
-
258
- * **When it runs:** This filter is applied when retrieving the list of available currencies for the currency selector in store settings. Note the hyphenated hook prefix (`fluent-cart/` instead of `fluent_cart/`).
259
- * **Source:** `app/Helpers/Helper.php` (line 467)
260
-
261
- #### Parameters:
262
- * `$currencies` *(array)* — Array of currency definitions keyed by currency code (`BDT`, `USD`, `GBP`, etc.)
263
- * `$data` *(array)* — Additional context data (empty array)
264
- * **Returns:** *(array)* — The modified currencies array
265
-
266
- #### Usage Example:
267
- ```php
268
- // Filter available currencies for the store currency selector
269
- add_filter('fluent-cart/available_currencies', function ($currencies, $data) {
270
- // Add Bitcoin (BTC) to the list of available currencies
271
- $currencies['BTC'] = [
272
- 'label' => 'Bitcoin',
273
- 'value' => 'BTC',
274
- 'symbol' => '₿',
275
- ];
276
- return $currencies;
277
- }, 10, 2);
278
- ```
279
-
280
- ---
281
-
282
- ### `accepted_currencies`
283
- `fluent_cart/accepted_currencies` — Filter the full list of accepted currencies
284
-
285
- * **When it runs:** This filter is applied when retrieving the complete list of currencies supported by payment gateways (based on Stripe's currency list). Used for currency validation and display throughout the plugin.
286
- * **Source:** `app/Helpers/CurrenciesHelper.php` (line 20)
287
-
288
- #### Parameters:
289
- * `$currencies` *(array)* — Associative array of currency code to localized name (`'USD' => 'United States Dollar'`)
290
- * **Returns:** *(array)* — The modified currencies array
291
-
292
- #### Usage Example:
293
- ```php
294
- // Filter full list of accepted currencies supported by payment gateways
295
- add_filter('fluent_cart/accepted_currencies', function ($currencies) {
296
- // Remove XRP from accepted currencies list
297
- unset($currencies['XRP']);
298
- // Add custom currency to accepted list
299
- $currencies['CUSTOM'] = 'My Custom Currency';
300
- return $currencies;
301
- });
302
- ```
303
-
304
- ---
305
-
306
- ### `global_currency_symbols`
307
- `fluent_cart/global_currency_symbols` — Filter currency symbols map
308
-
309
- * **When it runs:** This filter is applied when retrieving the mapping of currency codes to their display symbols. Used for formatting prices throughout the plugin.
310
- * **Source:** `app/Helpers/CurrenciesHelper.php` (line 195)
311
-
312
- #### Parameters:
313
- * `$symbols` *(array)* — Associative array of currency code to HTML symbol entity (`'USD' => '$'`)
314
- * **Returns:** *(array)* — The modified currency symbols array
315
-
316
- #### Usage Example:
317
- ```php
318
- // Filter currency symbols map
319
- add_filter('fluent_cart/global_currency_symbols', function ($symbols) {
320
- // Override Bangladeshi Taka currency symbol string
321
- $symbols['BDT'] = 'Tk';
322
- return $symbols;
323
- });
324
- ```
325
-
326
- ---
327
-
328
- ### `zero_decimal_currencies`
329
- `fluent_cart/zero_decimal_currencies` — Filter zero-decimal currencies list
330
-
331
- * **When it runs:** This filter is applied when retrieving currencies that do not use decimal subunits (e.g., Japanese Yen). These currencies store amounts without dividing by 100.
332
- * **Source:** `app/Helpers/CurrenciesHelper.php` (line 383)
333
-
334
- #### Parameters:
335
- * `$currencies` *(array)* — Associative array of zero-decimal currency code to localized name (`'JPY' => 'Japanese Yen'`)
336
- * **Returns:** *(array)* — The modified zero-decimal currencies array
337
-
338
- #### Usage Example:
339
- ```php
340
- // Filter zero-decimal currencies list
341
- add_filter('fluent_cart/zero_decimal_currencies', function ($currencies) {
342
- // Add Icelandic Krona to zero-decimal currencies array
343
- $currencies['ISK'] = 'Icelandic Krona';
344
- return $currencies;
345
- });
346
- ```
347
-
348
- ---
349
-
350
- ### `hide_unnecessary_decimals`
351
- `fluent_cart/hide_unnecessary_decimals` — Filter whether to hide `.00` decimals in formatted prices
352
-
353
- * **When it runs:** This filter is applied during price formatting. When true, prices like `$10.00` will display as `$10` instead.
354
- * **Source:** `app/Helpers/Helper.php` (line 343)
355
-
356
- #### Parameters:
357
- * `$hide` *(bool)* — Whether to hide unnecessary decimals (default: `false`)
358
- * `$context` *(array)* — Context data (`['amount' => 10.00, 'decimal' => 2]`)
359
- * **Returns:** *(bool)* — Whether to hide unnecessary trailing zeros
360
-
361
- #### Usage Example:
362
- ```php
363
- // Filter whether to hide unnecessary trailing .00 decimals in price display
364
- add_filter('fluent_cart/hide_unnecessary_decimals', function ($hide, $context) {
365
- // Always hide trailing .00 from displayed prices
366
- return true;
367
- }, 10, 2);
368
- ```
369
-
370
- ---
371
-
372
- ## Admin UI & Menu
373
-
374
- ### `admin_menu_title`
375
- `fluent_cart/admin_menu_title` — Filter admin menu title
376
-
377
- * **When it runs:** This filter is applied when registering the WordPress admin menu, allowing you to change the menu label shown in the sidebar.
378
- * **Source:** `app/Hooks/Handlers/MenuHandler.php` (line 164)
379
-
380
- #### Parameters:
381
- * `$menuTitle` *(string)* — The default menu title (`'FluentCart'`)
382
- * `$data` *(array)* — Additional context data (empty array)
383
- * **Returns:** *(string)* — The modified menu title
384
-
385
- #### Usage Example:
386
- ```php
387
- // Filter WordPress admin menu title string
388
- add_filter('fluent_cart/admin_menu_title', function ($menuTitle, $data) {
389
- // Change admin sidebar menu label to My Store
390
- return 'My Store';
391
- }, 10, 2);
392
- ```
393
-
394
- ---
395
-
396
- ### `admin_menu_position`
397
- `fluent_cart/admin_menu_position` — Filter admin menu position
398
-
399
- * **When it runs:** This filter is applied when registering the admin menu, controlling its position in the WordPress sidebar.
400
- * **Source:** `app/Hooks/Handlers/MenuHandler.php` (line 173)
401
-
402
- #### Parameters:
403
- * `$position` *(int)* — The menu position (default: `3`)
404
- * **Returns:** *(int)* — The modified menu position
405
-
406
- #### Usage Example:
407
- ```php
408
- // Filter WordPress admin menu position integer
409
- add_filter('fluent_cart/admin_menu_position', function ($position) {
410
- // Move FluentCart menu position lower in the sidebar
411
- return 25;
412
- });
413
- ```
414
-
415
- ---
416
-
417
- ### `admin_filter_options`
418
- `fluent_cart/admin_filter_options` — Filter admin filter options for list pages
419
-
420
- * **When it runs:** This filter is applied when loading admin filter options for orders, customers, products, licenses, and tax list pages.
421
- * **Source:** `app/Hooks/Handlers/MenuHandler.php` (line 380)
422
-
423
- #### Parameters:
424
- * `$filterOptions` *(array)* — Filter configurations for each list page (`order_filter_options`, `customer_filter_options`, etc.)
425
- * `$data` *(array)* — Additional context data (empty array)
426
- * **Returns:** *(array)* — The modified filter options array
427
-
428
- #### Usage Example:
429
- ```php
430
- // Filter admin list page filter options for orders, customers, etc.
431
- add_filter('fluent_cart/admin_filter_options', function ($filterOptions, $data) {
432
- // Add a custom status filter option to the orders list
433
- $filterOptions['order_filter_options']['custom_status'] = [
434
- 'label' => 'Custom Status',
435
- 'type' => 'select',
436
- 'options' => ['pending', 'approved'],
437
- ];
438
- return $filterOptions;
439
- }, 10, 2);
440
- ```
441
-
442
- ---
443
-
444
- ### `admin_app_data`
445
- `fluent_cart/admin_app_data` — Filter admin Vue app localized data
446
-
447
- * **When it runs:** This filter is applied when loading the admin SPA, providing the full configuration object passed to the Vue application via `wp_localize_script`.
448
- * **Source:** `app/Hooks/Handlers/MenuHandler.php` (line 398)
449
-
450
- #### Parameters:
451
- * `$adminLocalizeData` *(array)* — The complete admin app data (`app_config`, `admin_url`, `rest`, `me`, `shop`, `trans`, etc.)
452
- * **Returns:** *(array)* — The modified admin app data
453
-
454
- #### Usage Example:
455
- ```php
456
- // Filter localized configuration data passed to Vue admin SPA
457
- add_filter('fluent_cart/admin_app_data', function ($adminLocalizeData) {
458
- // Inject custom settings data into the Vue admin app payload
459
- $adminLocalizeData['custom_setting'] = 'custom_value';
460
- $adminLocalizeData['my_plugin_config'] = [
461
- 'enabled' => true,
462
- 'api_url' => 'https://api.example.com',
463
- ];
464
- return $adminLocalizeData;
465
- });
466
- ```
467
-
468
- ---
469
-
470
- ### `admin_notices`
471
- `fluent_cart/admin_notices` — Filter admin notices
472
-
473
- * **When it runs:** This filter is applied when loading the admin interface, allowing plugins to inject notices that display in the FluentCart admin panel.
474
- * **Source:** `app/Hooks/Handlers/MenuHandler.php` (line 449)
475
-
476
- #### Parameters:
477
- * `$notices` *(array)* — Array of notice objects (default: `[]`)
478
- * **Returns:** *(array)* — The modified notices array
479
-
480
- #### Usage Example:
481
- ```php
482
- // Filter admin notices array displayed in FluentCart panel
483
- add_filter('fluent_cart/admin_notices', function ($notices) {
484
- // Inject a custom warning notice into admin panel
485
- $notices[] = [
486
- 'type' => 'warning',
487
- 'message' => 'Please configure your payment gateway before going live.',
488
- ];
489
- return $notices;
490
- });
491
- ```
492
-
493
- ---
494
-
495
- ### `admin_base_url`
496
- `fluent_cart/admin_base_url` — Filter admin base URL
497
-
498
- * **When it runs:** This filter is applied when constructing admin navigation URLs throughout the plugin, including product menus and global navigation items.
499
- * **Source:** `app/Helpers/AdminHelper.php` (line 22)
500
-
501
- #### Parameters:
502
- * `$baseUrl` *(string)* — The default admin base URL (`admin_url('admin.php?page=fluent-cart#/')`)
503
- * `$data` *(array)* — Additional context data (empty array)
504
- * **Returns:** *(string)* — The modified base URL
505
-
506
- #### Usage Example:
507
- ```php
508
- // Filter admin base URL used for navigation links
509
- add_filter('fluent_cart/admin_base_url', function ($baseUrl, $data) {
510
- // Use custom admin base URL
511
- return admin_url('admin.php?page=my-custom-cart#/');
512
- }, 10, 2);
513
- ```
514
-
515
- ---
516
-
517
- ### `product_admin_items`
518
- `fluent_cart/product_admin_items` — Filter admin product action menu items
519
-
520
- * **When it runs:** This filter is applied when rendering the product action menu in the admin product detail view. Use it to add custom navigation tabs to individual product pages.
521
- * **Source:** `app/Helpers/AdminHelper.php` (line 24)
522
-
523
- #### Parameters:
524
- * `$menuItems` *(array)* — Array of menu item definitions (`product_edit`, `product_upgrade_paths`, `product_integrations`, etc.)
525
- * `$context` *(array)* — Context data (`['product_id' => 123, 'base_url' => '...']`)
526
- * **Returns:** *(array)* — The modified menu items array
527
-
528
- #### Usage Example:
529
- ```php
530
- // Filter admin product action menu items in product detail view
531
- add_filter('fluent_cart/product_admin_items', function ($menuItems, $context) {
532
- // Extract product ID and base URL from context array
533
- $productId = $context['product_id'];
534
- $baseUrl = $context['base_url'];
535
-
536
- // Add a custom Analytics tab to individual product menu
537
- $menuItems['product_analytics'] = [
538
- 'label' => 'Analytics',
539
- 'link' => $baseUrl . 'products/' . $productId . '/analytics',
540
- ];
541
- return $menuItems;
542
- }, 10, 2);
543
- ```
544
-
545
- ---
546
-
547
- ### `global_admin_menu_items`
548
- `fluent_cart/global_admin_menu_items` — Filter global admin navigation menu
549
-
550
- * **When it runs:** This filter is applied when rendering the global admin navigation bar at the top of the FluentCart admin pages. Use it to add or modify top-level navigation items.
551
- * **Source:** `app/Helpers/AdminHelper.php` (line 80)
552
-
553
- #### Parameters:
554
- * `$menuItems` *(array)* — Array of navigation items (`dashboard`, `orders`, `customers`, `products`, etc.)
555
- * **Returns:** *(array)* — The modified menu items array
556
-
557
- #### Usage Example:
558
- ```php
559
- // Filter global admin navigation menu items
560
- add_filter('fluent_cart/global_admin_menu_items', function ($menuItems) {
561
- // Add a custom top-level navigation item for Custom Reports
562
- $menuItems['custom_reports'] = [
563
- 'label' => 'Custom Reports',
564
- 'link' => admin_url('admin.php?page=fluent-cart#/custom-reports'),
565
- 'permission' => ['reports/view'],
566
- ];
567
- return $menuItems;
568
- });
569
- ```
570
-
571
- ---
572
-
573
- ### `dummy_product_info`
574
- `fluent_cart/dummy_product_info` — Filter dummy product for onboarding
575
-
576
- * **When it runs:** This filter is applied when loading the admin app data. It provides dummy product information used during the onboarding flow when the store has no products yet.
577
- * **Source:** `app/Hooks/Handlers/MenuHandler.php` (line 435)
578
-
579
- #### Parameters:
580
- * `$dummyProduct` *(array)* — Dummy product info (default: `[]`)
581
- * **Returns:** *(array)* — The modified dummy product info
582
-
583
- #### Usage Example:
584
- ```php
585
- // Filter dummy product info used during onboarding flow
586
- add_filter('fluent_cart/dummy_product_info', function ($dummyProduct) {
587
- // Return custom dummy product data structure
588
- return [
589
- 'title' => 'Sample Digital Product',
590
- 'price' => 2999, // in cents
591
- 'type' => 'digital',
592
- ];
593
- });
594
- ```
595
-
596
- ---
597
-
598
- ### `storage_driver_settings_routes`
599
- `fluent_cart/storage/storage_driver_settings_routes` — Filter storage driver admin routes
600
-
601
- * **When it runs:** This filter is applied when loading the admin app, allowing storage driver plugins to register their settings routes in the admin SPA navigation.
602
- * **Source:** `app/Hooks/Handlers/MenuHandler.php` (line 367)
603
-
604
- #### Parameters:
605
- * `$routes` *(array)* — Array of storage driver route definitions (default: `[]`)
606
- * `$data` *(array)* — Additional context data (empty array)
607
- * **Returns:** *(array)* — The modified routes array
608
-
609
- #### Usage Example:
610
- ```php
611
- // Filter storage driver admin settings routes in SPA
612
- add_filter('fluent_cart/storage/storage_driver_settings_routes', function ($routes, $data) {
613
- // Register custom S3 storage driver settings route
614
- $routes[] = [
615
- 'key' => 's3_storage',
616
- 'title' => 'S3 Storage',
617
- 'route' => 'settings/storage/s3',
618
- ];
619
- return $routes;
620
- }, 10, 2);
621
- ```
622
-
623
- ---
624
-
625
- ## Permissions & Auth
626
-
627
- ### `permission/all_roles`
628
- `fluent_cart/permission/all_roles` — Filter permission roles
629
-
630
- * **When it runs:** This filter is applied when retrieving all available permission roles. FluentCart ships with four roles (`super_admin`, `manager`, `worker`, `accountant`), each with predefined permission sets.
631
- * **Source:** `app/Services/Permission/PermissionManager.php` (line 92)
632
-
633
- #### Parameters:
634
- * `$allRoles` *(array)* — Array of role definitions (`super_admin`, `manager`, `worker`, `accountant`)
635
- * `$data` *(array)* — Additional context data (empty array)
636
- * **Returns:** *(array)* — The modified roles array
637
-
638
- #### Usage Example:
639
- ```php
640
- // Filter permission roles definition array
641
- add_filter('fluent_cart/permission/all_roles', function ($allRoles, $data) {
642
- // Add a custom Support Agent role with specific permissions
643
- $allRoles['support_agent'] = [
644
- 'title' => 'Support Agent',
645
- 'descriptions' => 'View orders and customers, manage order statuses',
646
- 'permissions' => [
647
- 'orders/view',
648
- 'orders/manage_statuses',
649
- 'customers/view',
650
- ],
651
- ];
652
- return $allRoles;
653
- }, 10, 2);
654
- ```
655
-
656
- ---
657
-
658
- ## Translations
659
-
660
- ### `admin_translations`
661
- `fluent_cart/admin_translations` — Filter admin panel translations
662
-
663
- * **When it runs:** This filter is applied when loading translation strings for the admin Vue SPA. The translations are passed to the frontend as a localized JavaScript object.
664
- * **Source:** `app/Services/Translations/TransStrings.php` (line 9)
665
-
666
- #### Parameters:
667
- * `$translations` *(array)* — Key-value pairs of translation strings loaded from `admin-translation.php`
668
- * `$data` *(array)* — Additional context data (empty array)
669
- * **Returns:** *(array)* — The modified translations array
670
-
671
- #### Usage Example:
672
- ```php
673
- // Filter translation strings for Vue admin SPA
674
- add_filter('fluent_cart/admin_translations', function ($translations, $data) {
675
- // Override custom admin label translation
676
- $translations['custom_label'] = __('My Custom Label', 'my-plugin');
677
- return $translations;
678
- }, 10, 2);
679
- ```
680
-
681
- ---
682
-
683
- ### `blocks_translations`
684
- `fluent_cart/blocks_translations` — Filter block editor translations
685
-
686
- * **When it runs:** This filter is applied when loading translation strings for the FluentCart block editor interface.
687
- * **Source:** `app/Services/Translations/TransStrings.php` (line 15)
688
-
689
- #### Parameters:
690
- * `$translations` *(array)* — Key-value pairs of translation strings loaded from `block-editor-translation.php`
691
- * `$data` *(array)* — Additional context data (empty array)
692
- * **Returns:** *(array)* — The modified translations array
693
-
694
- #### Usage Example:
695
- ```php
696
- // Filter translation strings for email block editor
697
- add_filter('fluent_cart/blocks_translations', function ($translations, $data) {
698
- // Override Save translation label
699
- $translations['Save'] = __('Save Changes', 'my-plugin');
700
- return $translations;
701
- }, 10, 2);
702
- ```
703
-
704
- ---
705
-
706
- ### `customer_profile_translations`
707
- `fluent_cart/customer_profile_translations` — Filter customer profile translations
708
-
709
- * **When it runs:** This filter is applied when loading translation strings for the customer profile (My Account) frontend page.
710
- * **Source:** `app/Services/Translations/TransStrings.php` (line 87)
711
-
712
- #### Parameters:
713
- * `$translations` *(array)* — Key-value pairs of translation strings loaded from `customer-profile-translation.php`
714
- * `$data` *(array)* — Additional context data (empty array)
715
- * **Returns:** *(array)* — The modified translations array
716
-
717
- #### Usage Example:
718
- ```php
719
- // Filter customer profile (My Account) frontend translation strings
720
- add_filter('fluent_cart/customer_profile_translations', function ($translations, $data) {
721
- // Customize My Orders heading translation
722
- $translations['My Orders'] = __('Purchase History', 'my-plugin');
723
- return $translations;
724
- }, 10, 2);
725
- ```
726
-
727
- ---
728
-
729
- ### `checkout_translations`
730
- `fluent_cart/checkout_translations` — Filter checkout page translations
731
-
732
- * **When it runs:** This filter is applied when loading translation strings for the checkout page frontend.
733
- * **Source:** `app/Services/Translations/TransStrings.php` (line 101)
734
-
735
- #### Parameters:
736
- * `$translations` *(array)* — Key-value pairs of translation strings loaded from `checkout-translation.php`
737
- * `$data` *(array)* — Additional context data (empty array)
738
- * **Returns:** *(array)* — The modified translations array
739
-
740
- #### Usage Example:
741
- ```php
742
- // Filter checkout page frontend translation strings
743
- add_filter('fluent_cart/checkout_translations', function ($translations, $data) {
744
- // Customize Place Order button label
745
- $translations['Place Order'] = __('Complete Purchase', 'my-plugin');
746
- return $translations;
747
- }, 10, 2);
748
- ```
749
-
750
- ---
751
-
752
- ### `payments_translations`
753
- `fluent_cart/payments_translations` — Filter payment translations
754
-
755
- * **When it runs:** This filter is applied when loading translation strings for payment-related UI elements on the frontend.
756
- * **Source:** `app/Services/Translations/TransStrings.php` (line 107)
757
-
758
- #### Parameters:
759
- * `$translations` *(array)* — Key-value pairs of translation strings loaded from `payments-translation.php`
760
- * `$data` *(array)* — Additional context data (empty array)
761
- * **Returns:** *(array)* — The modified translations array
762
-
763
- #### Usage Example:
764
- ```php
765
- // Filter payment frontend translation strings
766
- add_filter('fluent_cart/payments_translations', function ($translations, $data) {
767
- // Customize Credit Card gateway option label
768
- $translations['Credit Card'] = __('Debit/Credit Card', 'my-plugin');
769
- return $translations;
770
- }, 10, 2);
771
- ```
772
-
773
- ---
774
-
775
- ### `pro/admin_translations` (Pro)
776
- `fluent_cart_pro/admin_translations` — Filter Pro admin translations
777
-
778
- * **When it runs:** This filter is applied when loading translation strings specific to FluentCart Pro features in the admin panel.
779
- * **Source:** `fluent-cart-pro/app/Services/Translations/Translations.php` (line 24)
780
-
781
- #### Parameters:
782
- * `$translations` *(array)* — Key-value pairs of Pro-specific translation strings
783
- * `$data` *(array)* — Additional context data (empty array)
784
- * **Returns:** *(array)* — The modified translations array
785
-
786
- #### Usage Example:
787
- ```php
788
- // Filter Pro admin translation strings
789
- add_filter('fluent_cart_pro/admin_translations', function ($translations, $data) {
790
- // Override Pro License Management menu label
791
- $translations['License Management'] = __('License Keys', 'my-plugin');
792
- return $translations;
793
- }, 10, 2);
794
- ```
795
-
796
- ---
797
-
798
- ## Email & Notifications
799
-
800
- ### `email_notifications`
801
- `fluent_cart/email_notifications` — Filter email notification settings
802
-
803
- * **When it runs:** This filter is applied when retrieving the list of available email notifications. Each notification includes its configuration such as recipients, subject template, and default body. Runs before merging with saved notification configs.
804
- * **Source:** `app/Services/Email/EmailNotifications.php` (line 24)
805
-
806
- #### Parameters:
807
- * `$settings` *(array)* — Associative array of notification definitions keyed by notification name
808
- * **Returns:** *(array)* — The modified notification settings array
809
-
810
- #### Usage Example:
811
- ```php
812
- // Filter email notification settings array
813
- add_filter('fluent_cart/email_notifications', function ($settings) {
814
- // Register a custom email notification definition
815
- $settings['custom_notification'] = [
816
- 'title' => 'Custom Alert',
817
- 'group_label' => 'Custom Actions',
818
- 'settings' => [
819
- 'subject' => 'Custom Alert for Order #{order.id}',
820
- 'email_body' => '',
821
- 'is_default_body' => 'yes',
822
- 'to' => '{{settings.admin_email}}',
823
- 'status' => 'active',
824
- ],
825
- ];
826
- return $settings;
827
- });
828
- ```
829
-
830
- ---
831
-
832
- ### `keep_email_body_draft`
833
- `fluent_cart/keep_email_body_draft` — Filter whether to prevent email body reset
834
-
835
- * **When it runs:** This filter is applied when a notification is switched back to its default body. By default, the custom email body is cleared. Return true to preserve the custom body as a draft.
836
- * **Source:** `app/Services/Email/EmailNotifications.php` (line 520)
837
-
838
- #### Parameters:
839
- * `$keepDraft` *(bool)* — Whether to keep the custom body as draft (default: `false`)
840
- * `$context` *(array)* — The notification context (`['notification_name' => 'order_completed']`)
841
- * **Returns:** *(bool)* — Whether to preserve the custom email body
842
-
843
- #### Usage Example:
844
- ```php
845
- // Filter whether to prevent custom email body reset when reverting to default
846
- add_filter('fluent_cart/keep_email_body_draft', function ($keepDraft, $context) {
847
- // Always preserve custom email bodies as drafts
848
- return true;
849
- }, 10, 2);
850
- ```
851
-
852
- ---
853
-
854
- ### `theme_pref`
855
- `fluent_cart/theme_pref` — Filter email template theme preferences
856
-
857
- * **When it runs:** This filter is applied when the block parser resolves the email theme preferences, including the color palette and font sizes used in email templates.
858
- * **Source:** `app/Services/Email/FluentBlockParser.php` (line 1997)
859
-
860
- #### Parameters:
861
- * `$pref` *(array)* — Theme preference settings (`colors`, `font_sizes`)
862
- * **Returns:** *(array)* — The modified theme preferences
863
-
864
- #### Usage Example:
865
- ```php
866
- // Filter email template theme preferences for block parser
867
- add_filter('fluent_cart/theme_pref', function ($pref) {
868
- // Add brand custom color option to email palette
869
- $pref['colors'][] = [
870
- 'name' => 'Brand Primary',
871
- 'slug' => 'brand-primary',
872
- 'color' => '#FF6600',
873
- ];
874
- return $pref;
875
- });
876
- ```
877
-
878
- ---
879
-
880
- ### `condition_presets`
881
- `fluent_cart/condition_presets` — Filter email condition presets
882
-
883
- * **When it runs:** This filter is applied when retrieving available condition presets for email template conditional blocks. Presets define reusable conditions like "has note" or "has downloads" that control block visibility.
884
- * **Source:** `app/Services/Email/ConditionPresets.php` (line 124)
885
-
886
- #### Parameters:
887
- * `$presets` *(array)* — Array of condition preset definitions (`has_order_note`, `has_downloads`, etc.)
888
- * **Returns:** *(array)* — The modified presets array
889
-
890
- #### Usage Example:
891
- ```php
892
- // Filter email condition presets list
893
- add_filter('fluent_cart/condition_presets', function ($presets) {
894
- // Add a custom High Value Order condition preset
895
- $presets[] = [
896
- 'id' => 'is_high_value',
897
- 'label' => 'High Value Order',
898
- 'hint' => 'Show when order total exceeds $100.',
899
- 'shortcode' => '{{order.total_amount}}',
900
- 'condition' => 'greater_than',
901
- 'compareValue' => '10000', // in cents
902
- ];
903
- return $presets;
904
- });
905
- ```
906
-
907
- ---
908
-
909
- ### `evaluate_condition_preset`
910
- `fluent_cart/evaluate_condition_preset` — Filter evaluate condition preset
911
-
912
- * **When it runs:** This filter is applied when evaluating a condition preset that has no shortcode and no callback defined. It serves as a fallback for custom condition evaluation logic.
913
- * **Source:** `app/Services/Email/Blocks/BaseBlock.php` (line 196)
914
-
915
- #### Parameters:
916
- * `$result` *(bool)* — The evaluation result (default: `false`)
917
- * `$context` *(array)* — Full context for evaluation (`preset`, `resolved`, `data`, `block_attrs`)
918
- * **Returns:** *(bool)* — Whether the condition is met
919
-
920
- #### Usage Example:
921
- ```php
922
- // Filter evaluation of custom condition presets without built-in shortcodes
923
- add_filter('fluent_cart/evaluate_condition_preset', function ($result, $context) {
924
- // Extract preset array and order model
925
- $preset = $context['preset'];
926
- if ($preset && $preset['id'] === 'my_custom_condition') {
927
- $order = $context['data']['order'] ?? null;
928
- return $order && $order->total_amount > 10000;
929
- }
930
- return $result;
931
- }, 10, 2);
932
- ```
933
-
934
- ---
935
-
936
- ### `confirmation_shortcodes`
937
- `fluent_cart/confirmation_shortcodes` — Filter confirmation page shortcodes
938
-
939
- * **When it runs:** This filter is applied when retrieving available shortcodes for the order confirmation (receipt) page template editor.
940
- * **Source:** `app/Helpers/EditorShortCodeHelper.php` (line 201)
941
-
942
- #### Parameters:
943
- * `$groups` *(array)* — Array of shortcode groups (`customer`, `order`, `general`, `settings`)
944
- * `$data` *(array)* — Additional context data (empty array)
945
- * **Returns:** *(array)* — The modified shortcode groups array
946
-
947
- #### Usage Example:
948
- ```php
949
- // Filter available shortcodes for order confirmation (receipt) page template editor
950
- add_filter('fluent_cart/confirmation_shortcodes', function ($groups, $data) {
951
- // Add a custom shortcode group for tracking URLs
952
- $groups[] = [
953
- 'title' => 'Custom Data',
954
- 'key' => 'custom',
955
- 'shortcodes' => [
956
- '{{custom.tracking_url}}' => 'Tracking URL',
957
- ],
958
- ];
959
- return $groups;
960
- }, 10, 2);
961
- ```
962
-
963
- ---
964
-
965
- ### `editor_shortcodes`
966
- `fluent_cart/editor_shortcodes` — Filter email editor shortcodes
967
-
968
- * **When it runs:** This filter is applied when retrieving available shortcodes for the email notification template editor. Includes order, general, customer, transaction, settings, and license shortcode groups.
969
- * **Source:** `app/Helpers/EditorShortCodeHelper.php` (line 277)
970
-
971
- #### Parameters:
972
- * `$shortCodes` *(array)* — Associative array of shortcode groups (`order`, `general`, `customer`, `transaction`, `settings`, `license`)
973
- * **Returns:** *(array)* — The modified shortcodes array
974
-
975
- #### Usage Example:
976
- ```php
977
- // Filter available shortcodes for email notification template editor
978
- add_filter('fluent_cart/editor_shortcodes', function ($shortCodes) {
979
- // Add custom shortcode group for loyalty points and referral codes
980
- $shortCodes['custom'] = [
981
- 'title' => 'Custom Fields',
982
- 'key' => 'custom',
983
- 'shortcodes' => [
984
- '{{custom.loyalty_points}}' => 'Loyalty Points',
985
- '{{custom.referral_code}}' => 'Referral Code',
986
- ],
987
- ];
988
- return $shortCodes;
989
- });
990
- ```
991
-
992
- ---
993
-
994
- ### `disable_email_celebration_messages`
995
- `fluent_cart/disable_email_celebration_messages` — Filter whether to disable celebration messages in admin emails
996
-
997
- * **When it runs:** This filter is applied when generating admin notification emails. By default, FluentCart adds a random celebration message (e.g., "Woo-Hoo! Another Sale!") to admin order emails.
998
- * **Source:** `app/Services/TemplateService.php` (line 114)
999
-
1000
- #### Parameters:
1001
- * `$disable` *(bool)* — Whether to disable celebration messages (default: `false`)
1002
- * `$context` *(array)* — The notification type context (`['type' => 'order']`)
1003
- * **Returns:** *(bool)* — Whether to disable the celebration messages
1004
-
1005
- #### Usage Example:
1006
- ```php
1007
- // Filter whether to disable random celebration messages in admin notification emails
1008
- add_filter('fluent_cart/disable_email_celebration_messages', function ($disable, $context) {
1009
- // Disable celebration header messages for all admin emails
1010
- return true;
1011
- }, 10, 2);
1012
- ```
1013
-
1014
- ---
1015
-
1016
- ## Block Editor
1017
-
1018
- ### `block_editor_require_nonce`
1019
- `fluent_cart/block_editor_require_nonce` — Filter whether the block editor requires nonce verification
1020
-
1021
- * **When it runs:** This filter is applied when loading the FluentCart block editor (email template editor). It controls whether nonce verification is enforced for editor access.
1022
- * **Source:** `app/Hooks/Handlers/FluentCartBlockEditorHandler.php` (line 54)
1023
-
1024
- #### Parameters:
1025
- * `$requireNonce` *(bool)* — Whether to require nonce (default: `true`)
1026
- * `$blockType` *(string)* — The block editor type being loaded
1027
- * `$request` *(array)* — The current request data
1028
- * **Returns:** *(bool)* — Whether to enforce nonce verification
1029
-
1030
- #### Usage Example:
1031
- ```php
1032
- // Filter whether block editor requires nonce verification
1033
- add_filter('fluent_cart/block_editor_require_nonce', function ($requireNonce, $blockType, $request) {
1034
- // Disable nonce for specific preview block types if needed
1035
- if ($blockType === 'preview') {
1036
- return false;
1037
- }
1038
- return $requireNonce;
1039
- }, 10, 3);
1040
- ```
1041
-
1042
- ---
1043
-
1044
- ### `disable_pro_email_templates`
1045
- `fluent_cart/disable_pro_email_templates` — Filter whether to disable Pro email templates
1046
-
1047
- * **When it runs:** This filter is applied when loading starter templates in the email block editor. When true, templates with `/pro` or `/modern` in their IDs are excluded from the template picker.
1048
- * **Source:** `app/Hooks/Handlers/FluentCartBlockEditorHandler.php` (line 230)
1049
-
1050
- #### Parameters:
1051
- * `$disable` *(bool)* — Whether to disable Pro templates (default: `true`)
1052
- * **Returns:** *(bool)* — Whether to filter out Pro email templates
1053
-
1054
- #### Usage Example:
1055
- ```php
1056
- // Filter whether to disable Pro email starter templates
1057
- add_filter('fluent_cart/disable_pro_email_templates', function ($disable) {
1058
- // Enable Pro email templates when Pro plugin is active
1059
- if (defined('FLUENT_CART_PRO')) {
1060
- return false;
1061
- }
1062
- return $disable;
1063
- });
1064
- ```
1065
-
1066
- ---
1067
-
1068
- ### `skip_no_conflict` (editor)
1069
- `fluent_cart_editor/skip_no_conflict` — Filter whether to skip script unloading in the block editor
1070
-
1071
- * **When it runs:** This filter is applied when the email block editor loads. FluentCart aggressively unloads third-party scripts to prevent conflicts. Return true to skip this behavior and allow all scripts.
1072
- * **Source:** `app/Hooks/Handlers/FluentCartBlockEditorHandler.php` (line 638)
1073
-
1074
- #### Parameters:
1075
- * `$skip` *(bool)* — Whether to skip no-conflict mode (default: `false`)
1076
- * **Returns:** *(bool)* — Whether to skip unloading third-party scripts
1077
-
1078
- #### Usage Example:
1079
- ```php
1080
- // Filter whether to skip third-party script unloading in block editor
1081
- add_filter('fluent_cart_editor/skip_no_conflict', function ($skip) {
1082
- // Allow third-party scripts in the block editor
1083
- return true;
1084
- });
1085
- ```
1086
-
1087
- ---
1088
-
1089
- ### `asset_listed_slugs` (editor)
1090
- `fluent_cart_editor/asset_listed_slugs` — Filter approved script slugs in block editor
1091
-
1092
- * **When it runs:** This filter is applied when unloading third-party scripts from the email block editor. Only scripts matching these slug patterns (regex) will be kept.
1093
- * **Source:** `app/Hooks/Handlers/FluentCartBlockEditorHandler.php` (line 650)
1094
-
1095
- #### Parameters:
1096
- * `$approvedSlugs` *(array)* — Array of regex slug patterns to keep (`['\/gutenberg\/']`)
1097
- * **Returns:** *(array)* — The modified approved slugs array
1098
-
1099
- #### Usage Example:
1100
- ```php
1101
- // Filter approved script slug regex patterns in block editor
1102
- add_filter('fluent_cart_editor/asset_listed_slugs', function ($approvedSlugs) {
1103
- // Allow scripts from a specific custom plugin
1104
- $approvedSlugs[] = '\/my-custom-plugin\/';
1105
- return $approvedSlugs;
1106
- });
1107
- ```
1108
-
1109
- ---
1110
-
1111
- ### `skip_no_conflict` (styles)
1112
- `fluent_cart/skip_no_conflict` — Filter whether to skip style unloading in the block editor
1113
-
1114
- * **When it runs:** This filter is applied when unloading third-party stylesheets from the email block editor. Return true to allow all styles to load without filtering.
1115
- * **Source:** `app/Hooks/Handlers/FluentCartBlockEditorHandler.php` (line 707)
1116
-
1117
- #### Parameters:
1118
- * `$skip` *(bool)* — Whether to skip no-conflict mode for styles (default: `false`)
1119
- * `$type` *(string)* — The asset type (`'styles'`)
1120
- * **Returns:** *(bool)* — Whether to skip unloading third-party styles
1121
-
1122
- #### Usage Example:
1123
- ```php
1124
- // Filter whether to skip third-party stylesheet unloading in block editor
1125
- add_filter('fluent_cart/skip_no_conflict', function ($skip, $type) {
1126
- // Skip stylesheet unloading for styles asset type
1127
- if ($type === 'styles') {
1128
- return true;
1129
- }
1130
- return $skip;
1131
- }, 10, 2);
1132
- ```
1133
-
1134
- ---
1135
-
1136
- ### `asset_listed_slugs` (styles)
1137
- `fluent_cart/asset_listed_slugs` — Filter approved style slugs in block editor
1138
-
1139
- * **When it runs:** This filter is applied when filtering third-party stylesheets from the email block editor. Only styles matching these slug patterns (regex) will be kept.
1140
- * **Source:** `app/Hooks/Handlers/FluentCartBlockEditorHandler.php` (line 720)
1141
-
1142
- #### Parameters:
1143
- * `$approvedSlugs` *(array)* — Array of regex slug patterns to keep (`['\/gutenberg\/']`)
1144
- * **Returns:** *(array)* — The modified approved slugs array
1145
-
1146
- #### Usage Example:
1147
- ```php
1148
- // Filter approved stylesheet slug regex patterns in block editor
1149
- add_filter('fluent_cart/asset_listed_slugs', function ($approvedSlugs) {
1150
- // Allow custom plugin stylesheets in block editor
1151
- $approvedSlugs[] = '\/my-custom-plugin\/';
1152
- return $approvedSlugs;
1153
- });
1154
- ```
1155
-
1156
- ---
1157
-
1158
- ### `block_editor_unregister_all_patterns`
1159
- `fluent_cart/block_editor_unregister_all_patterns` — Filter whether to unregister default block patterns
1160
-
1161
- * **When it runs:** This filter is applied when loading the email block editor. By default, all WordPress core block patterns are removed since they are designed for web pages, not emails.
1162
- * **Source:** `app/Hooks/Handlers/FluentCartBlockEditorHandler.php` (line 740)
1163
-
1164
- #### Parameters:
1165
- * `$shouldUnregister` *(bool)* — Whether to unregister patterns (default: `true`)
1166
- * `$context` *(string)* — The editor context
1167
- * `$data` *(array)* — Additional context data (empty array)
1168
- * **Returns:** *(bool)* — Whether to unregister default block patterns
1169
-
1170
- #### Usage Example:
1171
- ```php
1172
- // Filter whether to unregister default block patterns in the email editor
1173
- add_filter('fluent_cart/block_editor_unregister_all_patterns', function ($shouldUnregister, $context, $data) {
1174
- // Retain default WordPress block patterns in the editor
1175
- return false;
1176
- }, 10, 3);
1177
- ```
1
+ # Filter Hooks: Settings & Configuration
2
+
3
+ All filters related to admin settings, store configuration, module management, currency formatting, admin UI, permissions, translations, email notifications, and block editor.
4
+
5
+ ---
6
+
7
+ ## Store Settings
8
+
9
+ ### `store_settings/values`
10
+ `fluent_cart/store_settings/values` — Filter default store settings values
11
+
12
+ * **When it runs:** This filter is applied when retrieving the default store settings, before merging with saved values. Use it to add or modify defaults for all store configuration options.
13
+ * **Source:** `api/StoreSettings.php` (line 89)
14
+
15
+ #### Parameters:
16
+ * `$defaultSettings` *(array)* — The default store settings (`currency`, `order_mode`, `checkout_button_text`, etc.)
17
+ * `$data` *(array)* — Additional context data (empty array)
18
+ * **Returns:** *(array)* — The modified default settings array
19
+
20
+ #### Usage Example:
21
+ ```php
22
+ // Filter default store settings values before merging with saved options
23
+ add_filter('fluent_cart/store_settings/values', function ($defaultSettings, $data) {
24
+ // Change default currency to EUR and set order mode to live
25
+ $defaultSettings['currency'] = 'EUR';
26
+ $defaultSettings['order_mode'] = 'live';
27
+ return $defaultSettings;
28
+ }, 10, 2);
29
+ ```
30
+
31
+ ---
32
+
33
+ ### `store_settings/fields`
34
+ `fluent_cart/store_settings/fields` — Filter store settings form field definitions
35
+
36
+ * **When it runs:** This filter is applied when rendering the store settings form in the admin interface. Use it to add, remove, or modify settings tabs and fields.
37
+ * **Source:** `api/StoreSettings.php` (line 1141)
38
+
39
+ #### Parameters:
40
+ * `$fields` *(array)* — Nested array of settings tabs and field definitions (`setting_tabs -> schema`)
41
+ * `$data` *(array)* — Additional context data (empty array)
42
+ * **Returns:** *(array)* — The modified fields array
43
+
44
+ #### Usage Example:
45
+ ```php
46
+ // Filter store settings form field definitions in admin interface
47
+ add_filter('fluent_cart/store_settings/fields', function ($fields, $data) {
48
+ // Add a custom settings section tab and field
49
+ $fields['setting_tabs']['schema']['custom_tab'] = [
50
+ 'title' => 'Custom Settings',
51
+ 'fields' => [
52
+ [
53
+ 'key' => 'custom_field',
54
+ 'label' => 'Custom Field',
55
+ 'type' => 'text',
56
+ ]
57
+ ]
58
+ ];
59
+ return $fields;
60
+ }, 10, 2);
61
+ ```
62
+
63
+ ---
64
+
65
+ ### `store_settings/rules`
66
+ `fluent_cart/store_settings/rules` — Filter validation rules for store settings
67
+
68
+ * **When it runs:** This filter is applied when validating store settings form submissions. Use it to add or modify validation rules for settings fields.
69
+ * **Source:** `app/Http/Requests/FluentMetaRequest.php` (line 34)
70
+
71
+ #### Parameters:
72
+ * `$rules` *(array)* — Validation rules keyed by field name (`'store_name' => 'required|...'`)
73
+ * **Returns:** *(array)* — The modified validation rules array
74
+
75
+ #### Usage Example:
76
+ ```php
77
+ // Filter validation rules for store settings form submissions
78
+ add_filter('fluent_cart/store_settings/rules', function ($rules) {
79
+ // Add validation rules for custom settings field
80
+ $rules['custom_field'] = 'required|sanitizeText|maxLength:100';
81
+ return $rules;
82
+ });
83
+ ```
84
+
85
+ ---
86
+
87
+ ### `store_settings/sanitizer`
88
+ `fluent_cart/store_settings/sanitizer` — Filter sanitization rules for store settings
89
+
90
+ * **When it runs:** This filter is applied when sanitizing store settings input before saving. Each key maps to a sanitize callback function or callable.
91
+ * **Source:** `app/Http/Requests/FluentMetaRequest.php` (line 136)
92
+
93
+ #### Parameters:
94
+ * `$sanitizer` *(array)* — Sanitization callbacks keyed by field name
95
+ * **Returns:** *(array)* — The modified sanitizer array
96
+
97
+ #### Usage Example:
98
+ ```php
99
+ // Filter sanitization rules for store settings before saving
100
+ add_filter('fluent_cart/store_settings/sanitizer', function ($sanitizer) {
101
+ // Add sanitizer callback for custom settings field
102
+ $sanitizer['custom_field'] = 'sanitize_text_field';
103
+ return $sanitizer;
104
+ });
105
+ ```
106
+
107
+ ---
108
+
109
+ ### `confirmation_setting_fields`
110
+ `fluent_cart/confirmation_setting_fields` — Filter confirmation page settings fields
111
+
112
+ * **When it runs:** This filter is applied when rendering the confirmation (receipt) page settings in the admin. Use it to add additional settings fields for the order confirmation page.
113
+ * **Source:** `api/Confirmation.php` (line 76)
114
+
115
+ #### Parameters:
116
+ * `$fields` *(array)* — Field definitions for the confirmation page settings
117
+ * `$data` *(array)* — Additional context data (empty array)
118
+ * **Returns:** *(array)* — The modified fields array
119
+
120
+ #### Usage Example:
121
+ ```php
122
+ // Filter confirmation page settings fields in admin
123
+ add_filter('fluent_cart/confirmation_setting_fields', function ($fields, $data) {
124
+ // Add a custom confirmation page setting checkbox
125
+ $fields['show_social_share'] = [
126
+ 'label' => 'Show social share buttons',
127
+ 'type' => 'checkbox',
128
+ 'value' => 'no',
129
+ ];
130
+ return $fields;
131
+ }, 10, 2);
132
+ ```
133
+
134
+ ---
135
+
136
+ ## Module Settings
137
+
138
+ ### `module_setting/fields`
139
+ `fluent_cart/module_setting/fields` — Filter module settings form fields
140
+
141
+ * **When it runs:** This filter is applied when retrieving module settings field definitions. Modules register their settings fields through this filter.
142
+ * **Source:** `api/ModuleSettings.php` (line 21)
143
+
144
+ #### Parameters:
145
+ * `$fields` *(array)* — Array of module settings field definitions (empty by default)
146
+ * `$data` *(array)* — Additional context data (empty array)
147
+ * **Returns:** *(array)* — The modified fields array
148
+
149
+ #### Usage Example:
150
+ ```php
151
+ // Filter module settings form field definitions
152
+ add_filter('fluent_cart/module_setting/fields', function ($fields, $data) {
153
+ // Register custom module settings fields
154
+ $fields['custom_module'] = [
155
+ 'title' => 'Custom Module',
156
+ 'fields' => [
157
+ [
158
+ 'key' => 'api_key',
159
+ 'label' => 'API Key',
160
+ 'type' => 'text',
161
+ ]
162
+ ]
163
+ ];
164
+ return $fields;
165
+ }, 10, 2);
166
+ ```
167
+
168
+ ---
169
+
170
+ ### `module_setting/default_values`
171
+ `fluent_cart/module_setting/default_values` — Filter module settings default values
172
+
173
+ * **When it runs:** This filter is applied when retrieving all module settings. It provides default values that are merged with saved settings, ensuring newly registered modules have their defaults applied.
174
+ * **Source:** `api/ModuleSettings.php` (line 42)
175
+
176
+ #### Parameters:
177
+ * `$defaults` *(array)* — Default values for module settings (empty by default)
178
+ * `$data` *(array)* — Additional context data (empty array)
179
+ * **Returns:** *(array)* — The modified defaults array keyed by module name
180
+
181
+ #### Usage Example:
182
+ ```php
183
+ // Filter module settings default values
184
+ add_filter('fluent_cart/module_setting/default_values', function ($defaults, $data) {
185
+ // Set default values array for custom module
186
+ $defaults['custom_module'] = [
187
+ 'active' => 'no',
188
+ 'api_key' => '',
189
+ 'mode' => 'sandbox',
190
+ ];
191
+ return $defaults;
192
+ }, 10, 2);
193
+ ```
194
+
195
+ ---
196
+
197
+ ### `module_settings/plugin_addons`
198
+ `fluent_cart/module_settings/plugin_addons` — Filter plugin add-on modules list
199
+
200
+ * **When it runs:** This filter is applied when listing available plugin add-ons in the module settings page. Use it to register third-party add-on modules that can be installed from the admin.
201
+ * **Source:** `app/Http/Controllers/ModuleSettingsController.php` (line 199)
202
+
203
+ #### Parameters:
204
+ * `$addons` *(array)* — Array of add-on module definitions (`title`, `description`, `logo`, `plugin_slug`, etc.)
205
+ * **Returns:** *(array)* — The modified add-ons array
206
+
207
+ #### Usage Example:
208
+ ```php
209
+ // Filter plugin add-on modules list in module settings page
210
+ add_filter('fluent_cart/module_settings/plugin_addons', function ($addons) {
211
+ // Register a custom add-on module to the admin list
212
+ $addons[] = [
213
+ 'title' => 'My Custom Add-on',
214
+ 'description' => 'Extends FluentCart with custom features.',
215
+ 'logo' => plugin_dir_url(__FILE__) . 'logo.svg',
216
+ 'plugin_slug' => 'my-custom-addon',
217
+ 'plugin_file' => 'my-custom-addon/my-custom-addon.php',
218
+ 'source_type' => 'cdn',
219
+ 'source_link' => 'https://example.com/my-addon.zip',
220
+ 'upcoming' => false,
221
+ ];
222
+ return $addons;
223
+ });
224
+ ```
225
+
226
+ ---
227
+
228
+ ## Currency & Formatting
229
+
230
+ ### `global_currency_setting`
231
+ `fluent_cart/global_currency_setting` — Filter global currency settings
232
+
233
+ * **When it runs:** This filter is applied when retrieving the global currency configuration. It runs after all currency settings have been resolved from stored values and defaults.
234
+ * **Source:** `api/CurrencySettings.php` (line 52)
235
+
236
+ #### Parameters:
237
+ * `$settings` *(array)* — Resolved currency settings (`currency`, `currency_sign`, `currency_position`, `decimal_separator`, etc.)
238
+ * `$data` *(array)* — Additional context data (empty array)
239
+ * **Returns:** *(array)* — The modified currency settings
240
+
241
+ #### Usage Example:
242
+ ```php
243
+ // Filter global currency settings array
244
+ add_filter('fluent_cart/global_currency_setting', function ($settings, $data) {
245
+ // Override currency, symbol, and symbol position
246
+ $settings['currency'] = 'EUR';
247
+ $settings['currency_sign'] = '€';
248
+ $settings['currency_position'] = 'right';
249
+ return $settings;
250
+ }, 10, 2);
251
+ ```
252
+
253
+ ---
254
+
255
+ ### `available_currencies`
256
+ `fluent-cart/available_currencies` — Filter available currencies for the store
257
+
258
+ * **When it runs:** This filter is applied when retrieving the list of available currencies for the currency selector in store settings. Note the hyphenated hook prefix (`fluent-cart/` instead of `fluent_cart/`).
259
+ * **Source:** `app/Helpers/Helper.php` (line 467)
260
+
261
+ #### Parameters:
262
+ * `$currencies` *(array)* — Array of currency definitions keyed by currency code (`BDT`, `USD`, `GBP`, etc.)
263
+ * `$data` *(array)* — Additional context data (empty array)
264
+ * **Returns:** *(array)* — The modified currencies array
265
+
266
+ #### Usage Example:
267
+ ```php
268
+ // Filter available currencies for the store currency selector
269
+ add_filter('fluent-cart/available_currencies', function ($currencies, $data) {
270
+ // Add Bitcoin (BTC) to the list of available currencies
271
+ $currencies['BTC'] = [
272
+ 'label' => 'Bitcoin',
273
+ 'value' => 'BTC',
274
+ 'symbol' => '₿',
275
+ ];
276
+ return $currencies;
277
+ }, 10, 2);
278
+ ```
279
+
280
+ ---
281
+
282
+ ### `accepted_currencies`
283
+ `fluent_cart/accepted_currencies` — Filter the full list of accepted currencies
284
+
285
+ * **When it runs:** This filter is applied when retrieving the complete list of currencies supported by payment gateways (based on Stripe's currency list). Used for currency validation and display throughout the plugin.
286
+ * **Source:** `app/Helpers/CurrenciesHelper.php` (line 20)
287
+
288
+ #### Parameters:
289
+ * `$currencies` *(array)* — Associative array of currency code to localized name (`'USD' => 'United States Dollar'`)
290
+ * **Returns:** *(array)* — The modified currencies array
291
+
292
+ #### Usage Example:
293
+ ```php
294
+ // Filter full list of accepted currencies supported by payment gateways
295
+ add_filter('fluent_cart/accepted_currencies', function ($currencies) {
296
+ // Remove XRP from accepted currencies list
297
+ unset($currencies['XRP']);
298
+ // Add custom currency to accepted list
299
+ $currencies['CUSTOM'] = 'My Custom Currency';
300
+ return $currencies;
301
+ });
302
+ ```
303
+
304
+ ---
305
+
306
+ ### `global_currency_symbols`
307
+ `fluent_cart/global_currency_symbols` — Filter currency symbols map
308
+
309
+ * **When it runs:** This filter is applied when retrieving the mapping of currency codes to their display symbols. Used for formatting prices throughout the plugin.
310
+ * **Source:** `app/Helpers/CurrenciesHelper.php` (line 195)
311
+
312
+ #### Parameters:
313
+ * `$symbols` *(array)* — Associative array of currency code to HTML symbol entity (`'USD' => '$'`)
314
+ * **Returns:** *(array)* — The modified currency symbols array
315
+
316
+ #### Usage Example:
317
+ ```php
318
+ // Filter currency symbols map
319
+ add_filter('fluent_cart/global_currency_symbols', function ($symbols) {
320
+ // Override Bangladeshi Taka currency symbol string
321
+ $symbols['BDT'] = 'Tk';
322
+ return $symbols;
323
+ });
324
+ ```
325
+
326
+ ---
327
+
328
+ ### `zero_decimal_currencies`
329
+ `fluent_cart/zero_decimal_currencies` — Filter zero-decimal currencies list
330
+
331
+ * **When it runs:** This filter is applied when retrieving currencies that do not use decimal subunits (e.g., Japanese Yen). These currencies store amounts without dividing by 100.
332
+ * **Source:** `app/Helpers/CurrenciesHelper.php` (line 383)
333
+
334
+ #### Parameters:
335
+ * `$currencies` *(array)* — Associative array of zero-decimal currency code to localized name (`'JPY' => 'Japanese Yen'`)
336
+ * **Returns:** *(array)* — The modified zero-decimal currencies array
337
+
338
+ #### Usage Example:
339
+ ```php
340
+ // Filter zero-decimal currencies list
341
+ add_filter('fluent_cart/zero_decimal_currencies', function ($currencies) {
342
+ // Add Icelandic Krona to zero-decimal currencies array
343
+ $currencies['ISK'] = 'Icelandic Krona';
344
+ return $currencies;
345
+ });
346
+ ```
347
+
348
+ ---
349
+
350
+ ### `hide_unnecessary_decimals`
351
+ `fluent_cart/hide_unnecessary_decimals` — Filter whether to hide `.00` decimals in formatted prices
352
+
353
+ * **When it runs:** This filter is applied during price formatting. When true, prices like `$10.00` will display as `$10` instead.
354
+ * **Source:** `app/Helpers/Helper.php` (line 343)
355
+
356
+ #### Parameters:
357
+ * `$hide` *(bool)* — Whether to hide unnecessary decimals (default: `false`)
358
+ * `$context` *(array)* — Context data (`['amount' => 10.00, 'decimal' => 2]`)
359
+ * **Returns:** *(bool)* — Whether to hide unnecessary trailing zeros
360
+
361
+ #### Usage Example:
362
+ ```php
363
+ // Filter whether to hide unnecessary trailing .00 decimals in price display
364
+ add_filter('fluent_cart/hide_unnecessary_decimals', function ($hide, $context) {
365
+ // Always hide trailing .00 from displayed prices
366
+ return true;
367
+ }, 10, 2);
368
+ ```
369
+
370
+ ---
371
+
372
+ ## Admin UI & Menu
373
+
374
+ ### `admin_menu_title`
375
+ `fluent_cart/admin_menu_title` — Filter admin menu title
376
+
377
+ * **When it runs:** This filter is applied when registering the WordPress admin menu, allowing you to change the menu label shown in the sidebar.
378
+ * **Source:** `app/Hooks/Handlers/MenuHandler.php` (line 164)
379
+
380
+ #### Parameters:
381
+ * `$menuTitle` *(string)* — The default menu title (`'FluentCart'`)
382
+ * `$data` *(array)* — Additional context data (empty array)
383
+ * **Returns:** *(string)* — The modified menu title
384
+
385
+ #### Usage Example:
386
+ ```php
387
+ // Filter WordPress admin menu title string
388
+ add_filter('fluent_cart/admin_menu_title', function ($menuTitle, $data) {
389
+ // Change admin sidebar menu label to My Store
390
+ return 'My Store';
391
+ }, 10, 2);
392
+ ```
393
+
394
+ ---
395
+
396
+ ### `admin_menu_position`
397
+ `fluent_cart/admin_menu_position` — Filter admin menu position
398
+
399
+ * **When it runs:** This filter is applied when registering the admin menu, controlling its position in the WordPress sidebar.
400
+ * **Source:** `app/Hooks/Handlers/MenuHandler.php` (line 173)
401
+
402
+ #### Parameters:
403
+ * `$position` *(int)* — The menu position (default: `3`)
404
+ * **Returns:** *(int)* — The modified menu position
405
+
406
+ #### Usage Example:
407
+ ```php
408
+ // Filter WordPress admin menu position integer
409
+ add_filter('fluent_cart/admin_menu_position', function ($position) {
410
+ // Move FluentCart menu position lower in the sidebar
411
+ return 25;
412
+ });
413
+ ```
414
+
415
+ ---
416
+
417
+ ### `admin_filter_options`
418
+ `fluent_cart/admin_filter_options` — Filter admin filter options for list pages
419
+
420
+ * **When it runs:** This filter is applied when loading admin filter options for orders, customers, products, licenses, and tax list pages.
421
+ * **Source:** `app/Hooks/Handlers/MenuHandler.php` (line 380)
422
+
423
+ #### Parameters:
424
+ * `$filterOptions` *(array)* — Filter configurations for each list page (`order_filter_options`, `customer_filter_options`, etc.)
425
+ * `$data` *(array)* — Additional context data (empty array)
426
+ * **Returns:** *(array)* — The modified filter options array
427
+
428
+ #### Usage Example:
429
+ ```php
430
+ // Filter admin list page filter options for orders, customers, etc.
431
+ add_filter('fluent_cart/admin_filter_options', function ($filterOptions, $data) {
432
+ // Add a custom status filter option to the orders list
433
+ $filterOptions['order_filter_options']['custom_status'] = [
434
+ 'label' => 'Custom Status',
435
+ 'type' => 'select',
436
+ 'options' => ['pending', 'approved'],
437
+ ];
438
+ return $filterOptions;
439
+ }, 10, 2);
440
+ ```
441
+
442
+ ---
443
+
444
+ ### `admin_app_data`
445
+ `fluent_cart/admin_app_data` — Filter admin Vue app localized data
446
+
447
+ * **When it runs:** This filter is applied when loading the admin SPA, providing the full configuration object passed to the Vue application via `wp_localize_script`.
448
+ * **Source:** `app/Hooks/Handlers/MenuHandler.php` (line 398)
449
+
450
+ #### Parameters:
451
+ * `$adminLocalizeData` *(array)* — The complete admin app data (`app_config`, `admin_url`, `rest`, `me`, `shop`, `trans`, etc.)
452
+ * **Returns:** *(array)* — The modified admin app data
453
+
454
+ #### Usage Example:
455
+ ```php
456
+ // Filter localized configuration data passed to Vue admin SPA
457
+ add_filter('fluent_cart/admin_app_data', function ($adminLocalizeData) {
458
+ // Inject custom settings data into the Vue admin app payload
459
+ $adminLocalizeData['custom_setting'] = 'custom_value';
460
+ $adminLocalizeData['my_plugin_config'] = [
461
+ 'enabled' => true,
462
+ 'api_url' => 'https://api.example.com',
463
+ ];
464
+ return $adminLocalizeData;
465
+ });
466
+ ```
467
+
468
+ ---
469
+
470
+ ### `admin_notices`
471
+ `fluent_cart/admin_notices` — Filter admin notices
472
+
473
+ * **When it runs:** This filter is applied when loading the admin interface, allowing plugins to inject notices that display in the FluentCart admin panel.
474
+ * **Source:** `app/Hooks/Handlers/MenuHandler.php` (line 449)
475
+
476
+ #### Parameters:
477
+ * `$notices` *(array)* — Array of notice objects (default: `[]`)
478
+ * **Returns:** *(array)* — The modified notices array
479
+
480
+ #### Usage Example:
481
+ ```php
482
+ // Filter admin notices array displayed in FluentCart panel
483
+ add_filter('fluent_cart/admin_notices', function ($notices) {
484
+ // Inject a custom warning notice into admin panel
485
+ $notices[] = [
486
+ 'type' => 'warning',
487
+ 'message' => 'Please configure your payment gateway before going live.',
488
+ ];
489
+ return $notices;
490
+ });
491
+ ```
492
+
493
+ ---
494
+
495
+ ### `admin_base_url`
496
+ `fluent_cart/admin_base_url` — Filter admin base URL
497
+
498
+ * **When it runs:** This filter is applied when constructing admin navigation URLs throughout the plugin, including product menus and global navigation items.
499
+ * **Source:** `app/Helpers/AdminHelper.php` (line 22)
500
+
501
+ #### Parameters:
502
+ * `$baseUrl` *(string)* — The default admin base URL (`admin_url('admin.php?page=fluent-cart#/')`)
503
+ * `$data` *(array)* — Additional context data (empty array)
504
+ * **Returns:** *(string)* — The modified base URL
505
+
506
+ #### Usage Example:
507
+ ```php
508
+ // Filter admin base URL used for navigation links
509
+ add_filter('fluent_cart/admin_base_url', function ($baseUrl, $data) {
510
+ // Use custom admin base URL
511
+ return admin_url('admin.php?page=my-custom-cart#/');
512
+ }, 10, 2);
513
+ ```
514
+
515
+ ---
516
+
517
+ ### `product_admin_items`
518
+ `fluent_cart/product_admin_items` — Filter admin product action menu items
519
+
520
+ * **When it runs:** This filter is applied when rendering the product action menu in the admin product detail view. Use it to add custom navigation tabs to individual product pages.
521
+ * **Source:** `app/Helpers/AdminHelper.php` (line 24)
522
+
523
+ #### Parameters:
524
+ * `$menuItems` *(array)* — Array of menu item definitions (`product_edit`, `product_upgrade_paths`, `product_integrations`, etc.)
525
+ * `$context` *(array)* — Context data (`['product_id' => 123, 'base_url' => '...']`)
526
+ * **Returns:** *(array)* — The modified menu items array
527
+
528
+ #### Usage Example:
529
+ ```php
530
+ // Filter admin product action menu items in product detail view
531
+ add_filter('fluent_cart/product_admin_items', function ($menuItems, $context) {
532
+ // Extract product ID and base URL from context array
533
+ $productId = $context['product_id'];
534
+ $baseUrl = $context['base_url'];
535
+
536
+ // Add a custom Analytics tab to individual product menu
537
+ $menuItems['product_analytics'] = [
538
+ 'label' => 'Analytics',
539
+ 'link' => $baseUrl . 'products/' . $productId . '/analytics',
540
+ ];
541
+ return $menuItems;
542
+ }, 10, 2);
543
+ ```
544
+
545
+ ---
546
+
547
+ ### `global_admin_menu_items`
548
+ `fluent_cart/global_admin_menu_items` — Filter global admin navigation menu
549
+
550
+ * **When it runs:** This filter is applied when rendering the global admin navigation bar at the top of the FluentCart admin pages. Use it to add or modify top-level navigation items.
551
+ * **Source:** `app/Helpers/AdminHelper.php` (line 80)
552
+
553
+ #### Parameters:
554
+ * `$menuItems` *(array)* — Array of navigation items (`dashboard`, `orders`, `customers`, `products`, etc.)
555
+ * **Returns:** *(array)* — The modified menu items array
556
+
557
+ #### Usage Example:
558
+ ```php
559
+ // Filter global admin navigation menu items
560
+ add_filter('fluent_cart/global_admin_menu_items', function ($menuItems) {
561
+ // Add a custom top-level navigation item for Custom Reports
562
+ $menuItems['custom_reports'] = [
563
+ 'label' => 'Custom Reports',
564
+ 'link' => admin_url('admin.php?page=fluent-cart#/custom-reports'),
565
+ 'permission' => ['reports/view'],
566
+ ];
567
+ return $menuItems;
568
+ });
569
+ ```
570
+
571
+ ---
572
+
573
+ ### `dummy_product_info`
574
+ `fluent_cart/dummy_product_info` — Filter dummy product for onboarding
575
+
576
+ * **When it runs:** This filter is applied when loading the admin app data. It provides dummy product information used during the onboarding flow when the store has no products yet.
577
+ * **Source:** `app/Hooks/Handlers/MenuHandler.php` (line 435)
578
+
579
+ #### Parameters:
580
+ * `$dummyProduct` *(array)* — Dummy product info (default: `[]`)
581
+ * **Returns:** *(array)* — The modified dummy product info
582
+
583
+ #### Usage Example:
584
+ ```php
585
+ // Filter dummy product info used during onboarding flow
586
+ add_filter('fluent_cart/dummy_product_info', function ($dummyProduct) {
587
+ // Return custom dummy product data structure
588
+ return [
589
+ 'title' => 'Sample Digital Product',
590
+ 'price' => 2999, // in cents
591
+ 'type' => 'digital',
592
+ ];
593
+ });
594
+ ```
595
+
596
+ ---
597
+
598
+ ### `storage_driver_settings_routes`
599
+ `fluent_cart/storage/storage_driver_settings_routes` — Filter storage driver admin routes
600
+
601
+ * **When it runs:** This filter is applied when loading the admin app, allowing storage driver plugins to register their settings routes in the admin SPA navigation.
602
+ * **Source:** `app/Hooks/Handlers/MenuHandler.php` (line 367)
603
+
604
+ #### Parameters:
605
+ * `$routes` *(array)* — Array of storage driver route definitions (default: `[]`)
606
+ * `$data` *(array)* — Additional context data (empty array)
607
+ * **Returns:** *(array)* — The modified routes array
608
+
609
+ #### Usage Example:
610
+ ```php
611
+ // Filter storage driver admin settings routes in SPA
612
+ add_filter('fluent_cart/storage/storage_driver_settings_routes', function ($routes, $data) {
613
+ // Register custom S3 storage driver settings route
614
+ $routes[] = [
615
+ 'key' => 's3_storage',
616
+ 'title' => 'S3 Storage',
617
+ 'route' => 'settings/storage/s3',
618
+ ];
619
+ return $routes;
620
+ }, 10, 2);
621
+ ```
622
+
623
+ ---
624
+
625
+ ## Permissions & Auth
626
+
627
+ ### `permission/all_roles`
628
+ `fluent_cart/permission/all_roles` — Filter permission roles
629
+
630
+ * **When it runs:** This filter is applied when retrieving all available permission roles. FluentCart ships with four roles (`super_admin`, `manager`, `worker`, `accountant`), each with predefined permission sets.
631
+ * **Source:** `app/Services/Permission/PermissionManager.php` (line 92)
632
+
633
+ #### Parameters:
634
+ * `$allRoles` *(array)* — Array of role definitions (`super_admin`, `manager`, `worker`, `accountant`)
635
+ * `$data` *(array)* — Additional context data (empty array)
636
+ * **Returns:** *(array)* — The modified roles array
637
+
638
+ #### Usage Example:
639
+ ```php
640
+ // Filter permission roles definition array
641
+ add_filter('fluent_cart/permission/all_roles', function ($allRoles, $data) {
642
+ // Add a custom Support Agent role with specific permissions
643
+ $allRoles['support_agent'] = [
644
+ 'title' => 'Support Agent',
645
+ 'descriptions' => 'View orders and customers, manage order statuses',
646
+ 'permissions' => [
647
+ 'orders/view',
648
+ 'orders/manage_statuses',
649
+ 'customers/view',
650
+ ],
651
+ ];
652
+ return $allRoles;
653
+ }, 10, 2);
654
+ ```
655
+
656
+ ---
657
+
658
+ ## Translations
659
+
660
+ ### `admin_translations`
661
+ `fluent_cart/admin_translations` — Filter admin panel translations
662
+
663
+ * **When it runs:** This filter is applied when loading translation strings for the admin Vue SPA. The translations are passed to the frontend as a localized JavaScript object.
664
+ * **Source:** `app/Services/Translations/TransStrings.php` (line 9)
665
+
666
+ #### Parameters:
667
+ * `$translations` *(array)* — Key-value pairs of translation strings loaded from `admin-translation.php`
668
+ * `$data` *(array)* — Additional context data (empty array)
669
+ * **Returns:** *(array)* — The modified translations array
670
+
671
+ #### Usage Example:
672
+ ```php
673
+ // Filter translation strings for Vue admin SPA
674
+ add_filter('fluent_cart/admin_translations', function ($translations, $data) {
675
+ // Override custom admin label translation
676
+ $translations['custom_label'] = __('My Custom Label', 'my-plugin');
677
+ return $translations;
678
+ }, 10, 2);
679
+ ```
680
+
681
+ ---
682
+
683
+ ### `blocks_translations`
684
+ `fluent_cart/blocks_translations` — Filter block editor translations
685
+
686
+ * **When it runs:** This filter is applied when loading translation strings for the FluentCart block editor interface.
687
+ * **Source:** `app/Services/Translations/TransStrings.php` (line 15)
688
+
689
+ #### Parameters:
690
+ * `$translations` *(array)* — Key-value pairs of translation strings loaded from `block-editor-translation.php`
691
+ * `$data` *(array)* — Additional context data (empty array)
692
+ * **Returns:** *(array)* — The modified translations array
693
+
694
+ #### Usage Example:
695
+ ```php
696
+ // Filter translation strings for email block editor
697
+ add_filter('fluent_cart/blocks_translations', function ($translations, $data) {
698
+ // Override Save translation label
699
+ $translations['Save'] = __('Save Changes', 'my-plugin');
700
+ return $translations;
701
+ }, 10, 2);
702
+ ```
703
+
704
+ ---
705
+
706
+ ### `customer_profile_translations`
707
+ `fluent_cart/customer_profile_translations` — Filter customer profile translations
708
+
709
+ * **When it runs:** This filter is applied when loading translation strings for the customer profile (My Account) frontend page.
710
+ * **Source:** `app/Services/Translations/TransStrings.php` (line 87)
711
+
712
+ #### Parameters:
713
+ * `$translations` *(array)* — Key-value pairs of translation strings loaded from `customer-profile-translation.php`
714
+ * `$data` *(array)* — Additional context data (empty array)
715
+ * **Returns:** *(array)* — The modified translations array
716
+
717
+ #### Usage Example:
718
+ ```php
719
+ // Filter customer profile (My Account) frontend translation strings
720
+ add_filter('fluent_cart/customer_profile_translations', function ($translations, $data) {
721
+ // Customize My Orders heading translation
722
+ $translations['My Orders'] = __('Purchase History', 'my-plugin');
723
+ return $translations;
724
+ }, 10, 2);
725
+ ```
726
+
727
+ ---
728
+
729
+ ### `checkout_translations`
730
+ `fluent_cart/checkout_translations` — Filter checkout page translations
731
+
732
+ * **When it runs:** This filter is applied when loading translation strings for the checkout page frontend.
733
+ * **Source:** `app/Services/Translations/TransStrings.php` (line 101)
734
+
735
+ #### Parameters:
736
+ * `$translations` *(array)* — Key-value pairs of translation strings loaded from `checkout-translation.php`
737
+ * `$data` *(array)* — Additional context data (empty array)
738
+ * **Returns:** *(array)* — The modified translations array
739
+
740
+ #### Usage Example:
741
+ ```php
742
+ // Filter checkout page frontend translation strings
743
+ add_filter('fluent_cart/checkout_translations', function ($translations, $data) {
744
+ // Customize Place Order button label
745
+ $translations['Place Order'] = __('Complete Purchase', 'my-plugin');
746
+ return $translations;
747
+ }, 10, 2);
748
+ ```
749
+
750
+ ---
751
+
752
+ ### `payments_translations`
753
+ `fluent_cart/payments_translations` — Filter payment translations
754
+
755
+ * **When it runs:** This filter is applied when loading translation strings for payment-related UI elements on the frontend.
756
+ * **Source:** `app/Services/Translations/TransStrings.php` (line 107)
757
+
758
+ #### Parameters:
759
+ * `$translations` *(array)* — Key-value pairs of translation strings loaded from `payments-translation.php`
760
+ * `$data` *(array)* — Additional context data (empty array)
761
+ * **Returns:** *(array)* — The modified translations array
762
+
763
+ #### Usage Example:
764
+ ```php
765
+ // Filter payment frontend translation strings
766
+ add_filter('fluent_cart/payments_translations', function ($translations, $data) {
767
+ // Customize Credit Card gateway option label
768
+ $translations['Credit Card'] = __('Debit/Credit Card', 'my-plugin');
769
+ return $translations;
770
+ }, 10, 2);
771
+ ```
772
+
773
+ ---
774
+
775
+ ### `pro/admin_translations` (Pro)
776
+ `fluent_cart_pro/admin_translations` — Filter Pro admin translations
777
+
778
+ * **When it runs:** This filter is applied when loading translation strings specific to FluentCart Pro features in the admin panel.
779
+ * **Source:** `fluent-cart-pro/app/Services/Translations/Translations.php` (line 24)
780
+
781
+ #### Parameters:
782
+ * `$translations` *(array)* — Key-value pairs of Pro-specific translation strings
783
+ * `$data` *(array)* — Additional context data (empty array)
784
+ * **Returns:** *(array)* — The modified translations array
785
+
786
+ #### Usage Example:
787
+ ```php
788
+ // Filter Pro admin translation strings
789
+ add_filter('fluent_cart_pro/admin_translations', function ($translations, $data) {
790
+ // Override Pro License Management menu label
791
+ $translations['License Management'] = __('License Keys', 'my-plugin');
792
+ return $translations;
793
+ }, 10, 2);
794
+ ```
795
+
796
+ ---
797
+
798
+ ## Email & Notifications
799
+
800
+ ### `email_notifications`
801
+ `fluent_cart/email_notifications` — Filter email notification settings
802
+
803
+ * **When it runs:** This filter is applied when retrieving the list of available email notifications. Each notification includes its configuration such as recipients, subject template, and default body. Runs before merging with saved notification configs.
804
+ * **Source:** `app/Services/Email/EmailNotifications.php` (line 24)
805
+
806
+ #### Parameters:
807
+ * `$settings` *(array)* — Associative array of notification definitions keyed by notification name
808
+ * **Returns:** *(array)* — The modified notification settings array
809
+
810
+ #### Usage Example:
811
+ ```php
812
+ // Filter email notification settings array
813
+ add_filter('fluent_cart/email_notifications', function ($settings) {
814
+ // Register a custom email notification definition
815
+ $settings['custom_notification'] = [
816
+ 'title' => 'Custom Alert',
817
+ 'group_label' => 'Custom Actions',
818
+ 'settings' => [
819
+ 'subject' => 'Custom Alert for Order #{order.id}',
820
+ 'email_body' => '',
821
+ 'is_default_body' => 'yes',
822
+ 'to' => '{{settings.admin_email}}',
823
+ 'status' => 'active',
824
+ ],
825
+ ];
826
+ return $settings;
827
+ });
828
+ ```
829
+
830
+ ---
831
+
832
+ ### `keep_email_body_draft`
833
+ `fluent_cart/keep_email_body_draft` — Filter whether to prevent email body reset
834
+
835
+ * **When it runs:** This filter is applied when a notification is switched back to its default body. By default, the custom email body is cleared. Return true to preserve the custom body as a draft.
836
+ * **Source:** `app/Services/Email/EmailNotifications.php` (line 520)
837
+
838
+ #### Parameters:
839
+ * `$keepDraft` *(bool)* — Whether to keep the custom body as draft (default: `false`)
840
+ * `$context` *(array)* — The notification context (`['notification_name' => 'order_completed']`)
841
+ * **Returns:** *(bool)* — Whether to preserve the custom email body
842
+
843
+ #### Usage Example:
844
+ ```php
845
+ // Filter whether to prevent custom email body reset when reverting to default
846
+ add_filter('fluent_cart/keep_email_body_draft', function ($keepDraft, $context) {
847
+ // Always preserve custom email bodies as drafts
848
+ return true;
849
+ }, 10, 2);
850
+ ```
851
+
852
+ ---
853
+
854
+ ### `theme_pref`
855
+ `fluent_cart/theme_pref` — Filter email template theme preferences
856
+
857
+ * **When it runs:** This filter is applied when the block parser resolves the email theme preferences, including the color palette and font sizes used in email templates.
858
+ * **Source:** `app/Services/Email/FluentBlockParser.php` (line 1997)
859
+
860
+ #### Parameters:
861
+ * `$pref` *(array)* — Theme preference settings (`colors`, `font_sizes`)
862
+ * **Returns:** *(array)* — The modified theme preferences
863
+
864
+ #### Usage Example:
865
+ ```php
866
+ // Filter email template theme preferences for block parser
867
+ add_filter('fluent_cart/theme_pref', function ($pref) {
868
+ // Add brand custom color option to email palette
869
+ $pref['colors'][] = [
870
+ 'name' => 'Brand Primary',
871
+ 'slug' => 'brand-primary',
872
+ 'color' => '#FF6600',
873
+ ];
874
+ return $pref;
875
+ });
876
+ ```
877
+
878
+ ---
879
+
880
+ ### `condition_presets`
881
+ `fluent_cart/condition_presets` — Filter email condition presets
882
+
883
+ * **When it runs:** This filter is applied when retrieving available condition presets for email template conditional blocks. Presets define reusable conditions like "has note" or "has downloads" that control block visibility.
884
+ * **Source:** `app/Services/Email/ConditionPresets.php` (line 124)
885
+
886
+ #### Parameters:
887
+ * `$presets` *(array)* — Array of condition preset definitions (`has_order_note`, `has_downloads`, etc.)
888
+ * **Returns:** *(array)* — The modified presets array
889
+
890
+ #### Usage Example:
891
+ ```php
892
+ // Filter email condition presets list
893
+ add_filter('fluent_cart/condition_presets', function ($presets) {
894
+ // Add a custom High Value Order condition preset
895
+ $presets[] = [
896
+ 'id' => 'is_high_value',
897
+ 'label' => 'High Value Order',
898
+ 'hint' => 'Show when order total exceeds $100.',
899
+ 'shortcode' => '{{order.total_amount}}',
900
+ 'condition' => 'greater_than',
901
+ 'compareValue' => '10000', // in cents
902
+ ];
903
+ return $presets;
904
+ });
905
+ ```
906
+
907
+ ---
908
+
909
+ ### `evaluate_condition_preset`
910
+ `fluent_cart/evaluate_condition_preset` — Filter evaluate condition preset
911
+
912
+ * **When it runs:** This filter is applied when evaluating a condition preset that has no shortcode and no callback defined. It serves as a fallback for custom condition evaluation logic.
913
+ * **Source:** `app/Services/Email/Blocks/BaseBlock.php` (line 196)
914
+
915
+ #### Parameters:
916
+ * `$result` *(bool)* — The evaluation result (default: `false`)
917
+ * `$context` *(array)* — Full context for evaluation (`preset`, `resolved`, `data`, `block_attrs`)
918
+ * **Returns:** *(bool)* — Whether the condition is met
919
+
920
+ #### Usage Example:
921
+ ```php
922
+ // Filter evaluation of custom condition presets without built-in shortcodes
923
+ add_filter('fluent_cart/evaluate_condition_preset', function ($result, $context) {
924
+ // Extract preset array and order model
925
+ $preset = $context['preset'];
926
+ if ($preset && $preset['id'] === 'my_custom_condition') {
927
+ $order = $context['data']['order'] ?? null;
928
+ return $order && $order->total_amount > 10000;
929
+ }
930
+ return $result;
931
+ }, 10, 2);
932
+ ```
933
+
934
+ ---
935
+
936
+ ### `confirmation_shortcodes`
937
+ `fluent_cart/confirmation_shortcodes` — Filter confirmation page shortcodes
938
+
939
+ * **When it runs:** This filter is applied when retrieving available shortcodes for the order confirmation (receipt) page template editor.
940
+ * **Source:** `app/Helpers/EditorShortCodeHelper.php` (line 201)
941
+
942
+ #### Parameters:
943
+ * `$groups` *(array)* — Array of shortcode groups (`customer`, `order`, `general`, `settings`)
944
+ * `$data` *(array)* — Additional context data (empty array)
945
+ * **Returns:** *(array)* — The modified shortcode groups array
946
+
947
+ #### Usage Example:
948
+ ```php
949
+ // Filter available shortcodes for order confirmation (receipt) page template editor
950
+ add_filter('fluent_cart/confirmation_shortcodes', function ($groups, $data) {
951
+ // Add a custom shortcode group for tracking URLs
952
+ $groups[] = [
953
+ 'title' => 'Custom Data',
954
+ 'key' => 'custom',
955
+ 'shortcodes' => [
956
+ '{{custom.tracking_url}}' => 'Tracking URL',
957
+ ],
958
+ ];
959
+ return $groups;
960
+ }, 10, 2);
961
+ ```
962
+
963
+ ---
964
+
965
+ ### `editor_shortcodes`
966
+ `fluent_cart/editor_shortcodes` — Filter email editor shortcodes
967
+
968
+ * **When it runs:** This filter is applied when retrieving available shortcodes for the email notification template editor. Includes order, general, customer, transaction, settings, and license shortcode groups.
969
+ * **Source:** `app/Helpers/EditorShortCodeHelper.php` (line 277)
970
+
971
+ #### Parameters:
972
+ * `$shortCodes` *(array)* — Associative array of shortcode groups (`order`, `general`, `customer`, `transaction`, `settings`, `license`)
973
+ * **Returns:** *(array)* — The modified shortcodes array
974
+
975
+ #### Usage Example:
976
+ ```php
977
+ // Filter available shortcodes for email notification template editor
978
+ add_filter('fluent_cart/editor_shortcodes', function ($shortCodes) {
979
+ // Add custom shortcode group for loyalty points and referral codes
980
+ $shortCodes['custom'] = [
981
+ 'title' => 'Custom Fields',
982
+ 'key' => 'custom',
983
+ 'shortcodes' => [
984
+ '{{custom.loyalty_points}}' => 'Loyalty Points',
985
+ '{{custom.referral_code}}' => 'Referral Code',
986
+ ],
987
+ ];
988
+ return $shortCodes;
989
+ });
990
+ ```
991
+
992
+ ---
993
+
994
+ ### `disable_email_celebration_messages`
995
+ `fluent_cart/disable_email_celebration_messages` — Filter whether to disable celebration messages in admin emails
996
+
997
+ * **When it runs:** This filter is applied when generating admin notification emails. By default, FluentCart adds a random celebration message (e.g., "Woo-Hoo! Another Sale!") to admin order emails.
998
+ * **Source:** `app/Services/TemplateService.php` (line 114)
999
+
1000
+ #### Parameters:
1001
+ * `$disable` *(bool)* — Whether to disable celebration messages (default: `false`)
1002
+ * `$context` *(array)* — The notification type context (`['type' => 'order']`)
1003
+ * **Returns:** *(bool)* — Whether to disable the celebration messages
1004
+
1005
+ #### Usage Example:
1006
+ ```php
1007
+ // Filter whether to disable random celebration messages in admin notification emails
1008
+ add_filter('fluent_cart/disable_email_celebration_messages', function ($disable, $context) {
1009
+ // Disable celebration header messages for all admin emails
1010
+ return true;
1011
+ }, 10, 2);
1012
+ ```
1013
+
1014
+ ---
1015
+
1016
+ ## Block Editor
1017
+
1018
+ ### `block_editor_require_nonce`
1019
+ `fluent_cart/block_editor_require_nonce` — Filter whether the block editor requires nonce verification
1020
+
1021
+ * **When it runs:** This filter is applied when loading the FluentCart block editor (email template editor). It controls whether nonce verification is enforced for editor access.
1022
+ * **Source:** `app/Hooks/Handlers/FluentCartBlockEditorHandler.php` (line 54)
1023
+
1024
+ #### Parameters:
1025
+ * `$requireNonce` *(bool)* — Whether to require nonce (default: `true`)
1026
+ * `$blockType` *(string)* — The block editor type being loaded
1027
+ * `$request` *(array)* — The current request data
1028
+ * **Returns:** *(bool)* — Whether to enforce nonce verification
1029
+
1030
+ #### Usage Example:
1031
+ ```php
1032
+ // Filter whether block editor requires nonce verification
1033
+ add_filter('fluent_cart/block_editor_require_nonce', function ($requireNonce, $blockType, $request) {
1034
+ // Disable nonce for specific preview block types if needed
1035
+ if ($blockType === 'preview') {
1036
+ return false;
1037
+ }
1038
+ return $requireNonce;
1039
+ }, 10, 3);
1040
+ ```
1041
+
1042
+ ---
1043
+
1044
+ ### `disable_pro_email_templates`
1045
+ `fluent_cart/disable_pro_email_templates` — Filter whether to disable Pro email templates
1046
+
1047
+ * **When it runs:** This filter is applied when loading starter templates in the email block editor. When true, templates with `/pro` or `/modern` in their IDs are excluded from the template picker.
1048
+ * **Source:** `app/Hooks/Handlers/FluentCartBlockEditorHandler.php` (line 230)
1049
+
1050
+ #### Parameters:
1051
+ * `$disable` *(bool)* — Whether to disable Pro templates (default: `true`)
1052
+ * **Returns:** *(bool)* — Whether to filter out Pro email templates
1053
+
1054
+ #### Usage Example:
1055
+ ```php
1056
+ // Filter whether to disable Pro email starter templates
1057
+ add_filter('fluent_cart/disable_pro_email_templates', function ($disable) {
1058
+ // Enable Pro email templates when Pro plugin is active
1059
+ if (defined('FLUENT_CART_PRO')) {
1060
+ return false;
1061
+ }
1062
+ return $disable;
1063
+ });
1064
+ ```
1065
+
1066
+ ---
1067
+
1068
+ ### `skip_no_conflict` (editor)
1069
+ `fluent_cart_editor/skip_no_conflict` — Filter whether to skip script unloading in the block editor
1070
+
1071
+ * **When it runs:** This filter is applied when the email block editor loads. FluentCart aggressively unloads third-party scripts to prevent conflicts. Return true to skip this behavior and allow all scripts.
1072
+ * **Source:** `app/Hooks/Handlers/FluentCartBlockEditorHandler.php` (line 638)
1073
+
1074
+ #### Parameters:
1075
+ * `$skip` *(bool)* — Whether to skip no-conflict mode (default: `false`)
1076
+ * **Returns:** *(bool)* — Whether to skip unloading third-party scripts
1077
+
1078
+ #### Usage Example:
1079
+ ```php
1080
+ // Filter whether to skip third-party script unloading in block editor
1081
+ add_filter('fluent_cart_editor/skip_no_conflict', function ($skip) {
1082
+ // Allow third-party scripts in the block editor
1083
+ return true;
1084
+ });
1085
+ ```
1086
+
1087
+ ---
1088
+
1089
+ ### `asset_listed_slugs` (editor)
1090
+ `fluent_cart_editor/asset_listed_slugs` — Filter approved script slugs in block editor
1091
+
1092
+ * **When it runs:** This filter is applied when unloading third-party scripts from the email block editor. Only scripts matching these slug patterns (regex) will be kept.
1093
+ * **Source:** `app/Hooks/Handlers/FluentCartBlockEditorHandler.php` (line 650)
1094
+
1095
+ #### Parameters:
1096
+ * `$approvedSlugs` *(array)* — Array of regex slug patterns to keep (`['\/gutenberg\/']`)
1097
+ * **Returns:** *(array)* — The modified approved slugs array
1098
+
1099
+ #### Usage Example:
1100
+ ```php
1101
+ // Filter approved script slug regex patterns in block editor
1102
+ add_filter('fluent_cart_editor/asset_listed_slugs', function ($approvedSlugs) {
1103
+ // Allow scripts from a specific custom plugin
1104
+ $approvedSlugs[] = '\/my-custom-plugin\/';
1105
+ return $approvedSlugs;
1106
+ });
1107
+ ```
1108
+
1109
+ ---
1110
+
1111
+ ### `skip_no_conflict` (styles)
1112
+ `fluent_cart/skip_no_conflict` — Filter whether to skip style unloading in the block editor
1113
+
1114
+ * **When it runs:** This filter is applied when unloading third-party stylesheets from the email block editor. Return true to allow all styles to load without filtering.
1115
+ * **Source:** `app/Hooks/Handlers/FluentCartBlockEditorHandler.php` (line 707)
1116
+
1117
+ #### Parameters:
1118
+ * `$skip` *(bool)* — Whether to skip no-conflict mode for styles (default: `false`)
1119
+ * `$type` *(string)* — The asset type (`'styles'`)
1120
+ * **Returns:** *(bool)* — Whether to skip unloading third-party styles
1121
+
1122
+ #### Usage Example:
1123
+ ```php
1124
+ // Filter whether to skip third-party stylesheet unloading in block editor
1125
+ add_filter('fluent_cart/skip_no_conflict', function ($skip, $type) {
1126
+ // Skip stylesheet unloading for styles asset type
1127
+ if ($type === 'styles') {
1128
+ return true;
1129
+ }
1130
+ return $skip;
1131
+ }, 10, 2);
1132
+ ```
1133
+
1134
+ ---
1135
+
1136
+ ### `asset_listed_slugs` (styles)
1137
+ `fluent_cart/asset_listed_slugs` — Filter approved style slugs in block editor
1138
+
1139
+ * **When it runs:** This filter is applied when filtering third-party stylesheets from the email block editor. Only styles matching these slug patterns (regex) will be kept.
1140
+ * **Source:** `app/Hooks/Handlers/FluentCartBlockEditorHandler.php` (line 720)
1141
+
1142
+ #### Parameters:
1143
+ * `$approvedSlugs` *(array)* — Array of regex slug patterns to keep (`['\/gutenberg\/']`)
1144
+ * **Returns:** *(array)* — The modified approved slugs array
1145
+
1146
+ #### Usage Example:
1147
+ ```php
1148
+ // Filter approved stylesheet slug regex patterns in block editor
1149
+ add_filter('fluent_cart/asset_listed_slugs', function ($approvedSlugs) {
1150
+ // Allow custom plugin stylesheets in block editor
1151
+ $approvedSlugs[] = '\/my-custom-plugin\/';
1152
+ return $approvedSlugs;
1153
+ });
1154
+ ```
1155
+
1156
+ ---
1157
+
1158
+ ### `block_editor_unregister_all_patterns`
1159
+ `fluent_cart/block_editor_unregister_all_patterns` — Filter whether to unregister default block patterns
1160
+
1161
+ * **When it runs:** This filter is applied when loading the email block editor. By default, all WordPress core block patterns are removed since they are designed for web pages, not emails.
1162
+ * **Source:** `app/Hooks/Handlers/FluentCartBlockEditorHandler.php` (line 740)
1163
+
1164
+ #### Parameters:
1165
+ * `$shouldUnregister` *(bool)* — Whether to unregister patterns (default: `true`)
1166
+ * `$context` *(string)* — The editor context
1167
+ * `$data` *(array)* — Additional context data (empty array)
1168
+ * **Returns:** *(bool)* — Whether to unregister default block patterns
1169
+
1170
+ #### Usage Example:
1171
+ ```php
1172
+ // Filter whether to unregister default block patterns in the email editor
1173
+ add_filter('fluent_cart/block_editor_unregister_all_patterns', function ($shouldUnregister, $context, $data) {
1174
+ // Retain default WordPress block patterns in the editor
1175
+ return false;
1176
+ }, 10, 3);
1177
+ ```