resources
4 years ago
AddonsAdminPage.php
4 years ago
AddonsRepository.php
4 years ago
HideSaleBannerRoute.php
4 years ago
RecurringDonationsTab.php
4 years ago
SaleBanners.php
4 years ago
ServiceProvider.php
4 years ago
RecurringDonationsTab.php
49 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\InPluginUpsells; |
| 4 | |
| 5 | /** |
| 6 | * @since 2.17.0 |
| 7 | */ |
| 8 | class RecurringDonationsTab |
| 9 | { |
| 10 | /** |
| 11 | * Load scripts |
| 12 | */ |
| 13 | public function loadScripts() |
| 14 | { |
| 15 | wp_enqueue_script( |
| 16 | 'give-in-plugin-upsells-recurring-donations', |
| 17 | GIVE_PLUGIN_URL . 'assets/dist/js/admin-upsell-recurring-donations-settings-tab.js', |
| 18 | ['wp-element', 'wp-i18n', 'wp-hooks'], |
| 19 | GIVE_VERSION, |
| 20 | true |
| 21 | ); |
| 22 | |
| 23 | wp_enqueue_style( |
| 24 | 'give-in-plugin-upsells-addons-font', |
| 25 | 'https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap', |
| 26 | [], |
| 27 | null |
| 28 | ); |
| 29 | |
| 30 | wp_localize_script( |
| 31 | 'give-in-plugin-upsells-recurring-donations', |
| 32 | 'GiveRecurringDonations', |
| 33 | ['assetsUrl' => GIVE_PLUGIN_URL . 'assets/dist/'] |
| 34 | ); |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * Is the tab active? |
| 39 | */ |
| 40 | public static function isShowing() |
| 41 | { |
| 42 | $recurringIsNotActive = ! defined('GIVE_RECURRING_VERSION'); |
| 43 | $isSettingPage = isset($_GET['page']) && 'give-settings' === $_GET['page']; |
| 44 | $isRecurringDonationsTab = isset($_GET['tab']) && 'recurring' === $_GET['tab']; |
| 45 | |
| 46 | return $recurringIsNotActive && $isSettingPage && $isRecurringDonationsTab; |
| 47 | } |
| 48 | } |
| 49 |