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 / Form / LegacyConsumer / TemplateHooks.php

TemplateHooks.php in GiveWP – Donation Plugin and Fundraising Platform 4.16.9, at src/Form/LegacyConsumer/TemplateHooks.php

55 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\Form\LegacyConsumer;
4
5 class TemplateHooks
6 {
7 /**
8 * A "full-ish" list of available actions.
9 * @note The `give_` prefix has been removed for interoperability.
10 * @note Update to account for previously deprecated hooks.
11 * @link https://givewp.com/documentation/developers/how-to-create-custom-form-fields/
12 * @link https://givewp.com/add-content-donation-forms/
13 */
14 const TEMPLATE_HOOKS = [
15 'before_donation_levels',
16 'after_donation_amount',
17 'after_donation_levels',
18 'payment_mode_top',
19 'payment_mode_before_gateways',
20 'payment_mode_after_gateways',
21 'payment_mode_after_gateways_wrap',
22 'payment_mode_bottom',
23 'donation_form',
24 'donation_form_top',
25 'purchase_form_top',
26 'donation_form_register_login_fields',
27 'donation_form_before_cc_form',
28 'cc_form',
29 'before_cc_fields',
30 'before_cc_expiration',
31 'after_cc_expiration',
32 'after_cc_fields',
33 'donation_form_after_cc_form',
34 'purchase_form_bottom',
35 'donation_form_before_personal_info',
36 'donation_form_after_personal_info',
37 ];
38
39 public function walk(callable $callback)
40 {
41 $hooks = $this->getHooks();
42 array_walk($hooks, $callback);
43 }
44
45 public function reduce(callable $callback, $initial = null)
46 {
47 return array_reduce($this->getHooks(), $callback, $initial);
48 }
49
50 public function getHooks()
51 {
52 return self::TEMPLATE_HOOKS;
53 }
54 }
55