PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.9
GiveWP – Donation Plugin and Fundraising Platform v4.16.9
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
give / src / DonationSpam / ServiceProvider.php

ServiceProvider.php in GiveWP – Donation Plugin and Fundraising Platform 4.16.9, at src/DonationSpam/ServiceProvider.php

49 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\DonationSpam;
4
5 use Give\DonationSpam\Akismet\Actions\ValidateDonationOnFinalSubmission;
6 use Give\Helpers\Hooks;
7 use Give\ServiceProviders\ServiceProvider as ServiceProviderInterface;
8
9 /**
10 * @since 3.15.0
11 */
12 class ServiceProvider implements ServiceProviderInterface
13 {
14 /**
15 * @since 3.15.0
16 * @inheritDoc
17 */
18 public function register(): void
19 {
20 /**
21 * @since 3.15.1 Case filtered value as an array to enforce type.
22 * @since 3.15.0
23 */
24 give()->singleton(EmailAddressWhiteList::class, function () {
25 return new EmailAddressWhiteList(
26 (array)apply_filters('give_akismet_whitelist_emails', give_akismet_get_whitelisted_emails())
27 );
28 });
29 }
30
31 /**
32 * @since 4.16.0 register an invokable action that gates the Akismet check to the final submission
33 * @since 3.22.0 updated Akismet validation to use new givewp_donation_form_fields_validated action
34 * @since 3.15.0
35 *
36 * @inheritDoc
37 */
38 public function boot(): void
39 {
40 Hooks::addAction(
41 'givewp_donation_form_fields_validated',
42 ValidateDonationOnFinalSubmission::class,
43 '__invoke',
44 10,
45 2
46 );
47 }
48 }
49