PluginProbe
The Innovative Form Builder – IvyForms / 1.5.1
The Innovative Form Builder – IvyForms v1.5.1
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
← All changes | backend/src/Services/Menu/MenuMapper.php +16 -1 1.4.1 → 1.5.1 View file →
@@ -2,8 +2,9 @@
2 2
3 3 namespace IvyForms\Services\Menu;
4 4
5 5 use IvyForms\Services\API\IvyFormsAPI;
6 +use IvyForms\Services\Payment\PaymentsFeature;
6 7 use IvyForms\Services\Permissions\IvyFormsAccess;
7 8 use IvyForms\Services\Permissions\PermissionResolver;
8 9 use IvyForms\Services\Translations\BackendStrings;
9 10
@@ -55,11 +56,17 @@
55 56 'menuTitle' => BackendStrings::getEntriesStrings()['entries'],
56 57 'capability' => IvyFormsAccess::CAP_ACCESS_PLUGIN,
57 58 'menuSlug' => 'ivyforms-entries',
58 59 ],
59 -// // TODO Add Settings page
60 60 [
61 61 'parentSlug' => 'ivyforms',
62 + 'pageTitle' => 'Payments',
63 + 'menuTitle' => BackendStrings::getPaymentStrings()['payments'],
64 + 'capability' => 'manage_options',
65 + 'menuSlug' => 'ivyforms-payments',
66 + ],
67 + [
68 + 'parentSlug' => 'ivyforms',
62 69 'pageTitle' => 'Settings',
63 70 'menuTitle' => BackendStrings::getCommonStrings()['settings'],
64 71 'capability' => IvyFormsAccess::CAP_ACCESS_PLUGIN,
65 72 'menuSlug' => 'ivyforms-settings',
@@ -71,8 +78,16 @@
71 78 'capability' => IvyFormsAccess::CAP_ACCESS_PLUGIN,
72 79 'menuSlug' => 'ivyforms-integrations',
73 80 ],
74 81 ];
82 +
83 + // Payments page stays hidden while Stripe and PayPal are turned off
84 + if (!PaymentsFeature::isEnabled()) {
85 + $menus = array_values(array_filter(
86 + $menus,
87 + static fn(array $menu): bool => $menu['menuSlug'] !== 'ivyforms-payments'
88 + ));
89 + }
75 90
76 91 // Add "Upgrade to PRO" menu only if Pro plugin is not installed/activated
77 92 if (!IvyFormsAPI::isProPluginActive()) {
78 93 $menus[] = [