Server IP : 192.158.238.246 / Your IP : 3.144.230.177 Web Server : LiteSpeed System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64 User : jenniferflocom ( 1321) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/7779/task/7779/cwd/plugins/give/src/Form/LegacyConsumer/Commands/ |
Upload File : |
<?php namespace Give\Form\LegacyConsumer\Commands; use Give\Donations\Models\Donation; use Give\Framework\FieldsAPI\Concerns\HasLabel; use Give\Framework\FieldsAPI\Concerns\ShowInReceipt; use Give\Framework\FieldsAPI\Field; use Give\Framework\FieldsAPI\Group; /** * @since 2.10.2 */ class SetupFieldConfirmation { /** * @var Donation */ protected $payment; /** * @var array */ protected $receiptArgs; /** * @since 2.10.2 * * @param Donation $payment * @param array $receiptArgs */ public function __construct($payment, $receiptArgs) { $this->payment = $payment; $this->receiptArgs = $receiptArgs; } /** * @since 2.10.2 * * @param string $hook * * @return void */ public function __invoke($hook) { $formID = give_get_payment_meta($this->payment->ID, '_give_payment_form_id'); $collection = Group::make($hook); do_action("give_fields_{$hook}", $collection, $formID); $collection->walkFields([$this, 'render']); } /** * @since 2.10.2 * * @param Field $field * * @return void */ public function render(Field $field) { /** @var Field|HasLabel $field */ if ( ! $field->shouldShowInReceipt()) { return; } if ($field->shouldStoreAsDonorMeta()) { $donorID = give_get_payment_meta($this->payment->ID, '_give_payment_donor_id'); $value = Give()->donor_meta->get_meta($donorID, $field->getName(), true); } else { $value = give_get_payment_meta($this->payment->ID, $field->getName()); } if ( ! $value) { return; } ?> <tr> <td scope="row"> <strong> <?php echo $field->getLabel(); ?> </strong> </td> <td> <?php echo $value; ?> </td> </tr> <?php } }