| Server IP : 46.105.57.169 / Your IP : 216.73.216.67 Web Server : Apache System : Linux webm002.cluster120.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : verseaumee ( 152031) PHP Version : 8.5.7 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/verseaumee/blueversion/wp-content/plugins/give/src/DonationForms/V2/ |
Upload File : |
<?php
namespace Give\DonationForms\V2;
use Give\DonationForms\V2\ListTable\DonationFormsListTable;
use Give\DonationForms\V2\Repositories\DonationFormsRepository;
use Give\Helpers\Hooks;
use Give\ServiceProviders\ServiceProvider as ServiceProviderInterface;
/**
* @since 2.19.0
*/
class ServiceProvider implements ServiceProviderInterface
{
/**
* @inheritDoc
*/
public function register()
{
give()->singleton('donationForms', DonationFormsRepository::class);
give()->singleton(DonationFormsListTable::class, function () {
$listTable = new DonationFormsListTable();
Hooks::doAction('givewp_donation_forms_list_table', $listTable);
return $listTable;
});
}
/**
* @inheritDoc
*/
public function boot()
{
$userId = get_current_user_id();
$showLegacy = get_user_meta($userId, '_give_donation_forms_archive_show_legacy', true);
// only register new admin page if user hasn't chosen to use the old one
if (empty($showLegacy)) {
Hooks::addAction('admin_menu', DonationFormsAdminPage::class, 'register', 0);
Hooks::addAction('admin_menu', DonationFormsAdminPage::class, 'highlightAllFormsMenuItem');
if (DonationFormsAdminPage::isShowing()) {
Hooks::addAction('admin_enqueue_scripts', DonationFormsAdminPage::class, 'loadScripts');
}
} elseif (DonationFormsAdminPage::isShowingLegacyPage()) {
Hooks::addAction('admin_head', DonationFormsAdminPage::class, 'renderReactSwitch');
}
// Onboarding
Hooks::addAction('submitpost_box', DonationFormsAdminPage::class, 'renderMigrationGuideBox');
Hooks::addAction('admin_enqueue_scripts', DonationFormsAdminPage::class, 'loadMigrationScripts');
add_action('wp_ajax_givewp_show_onboarding_banner', static function () {
add_user_meta(get_current_user_id(), 'givewp-show-onboarding-banner', time(), true);
});
add_action('wp_ajax_givewp_show_upgraded_tooltip', static function () {
add_user_meta(get_current_user_id(), 'givewp-show-upgraded-tooltip', time(), true);
});
}
}