PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 2.10.3
GiveWP – Donation Plugin and Fundraising Platform v2.10.3
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 2.31.0 2.31.1 All 253 releases
give / src / Form / LegacyConsumer / Commands / SetupPaymentDetailsDisplay.php
SetupPaymentDetailsDisplay.php
64 lines 1.1 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\Commands;
4
5 use Give\Framework\FieldsAPI\FormField;
6 use Give\Framework\FieldsAPI\FieldCollection;
7 use Give\Form\LegacyConsumer\FieldView;
8
9 /**
10 * @since 2.10.2
11 */
12 class SetupPaymentDetailsDisplay {
13
14 /**
15 * @since 2.10.2
16 *
17 * @param int $donationID
18 */
19 public function __construct( $donationID ) {
20 $this->donationID = $donationID;
21 }
22
23
24 /**
25 * @since 2.10.2
26 *
27 * @param string $hook
28 *
29 * @return void
30 */
31 public function __invoke( $hook ) {
32
33 $fieldCollection = new FieldCollection( 'root' );
34 do_action( "give_fields_{$hook}", $fieldCollection, get_the_ID() );
35
36 $fieldCollection->walk( [ $this, 'render' ] );
37 }
38
39 /**
40 * @since 2.10.2
41 *
42 * @param FormField $field
43 *
44 * @return void
45 */
46 public function render( FormField $field ) {
47 if ( $field->shouldStoreAsDonorMeta() ) {
48 return;
49 }
50 ?>
51 <div class="referral-data postbox" style="padding-bottom: 15px;">
52 <h3 class="hndle">
53 <?php echo $field->getLabel(); ?>
54 </h3>
55 <div class="inside">
56 <p>
57 <?php echo give_get_meta( $this->donationID, $field->getName(), true ); ?>
58 </p>
59 </div>
60 </div>
61 <?php
62 }
63 }
64