PluginProbe ʕ •ᴥ•ʔ
GiveWP – Donation Plugin and Fundraising Platform / 4.16.0
GiveWP – Donation Plugin and Fundraising Platform v4.16.0
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 2.32.0 2.33.0 2.33.1 2.33.2 2.33.3 2.33.4 2.33.5 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.10.0 3.11.0 3.12.0 3.12.1 3.12.2 3.12.3 3.13.0 3.14.0 3.14.1 3.14.2 3.15.0 3.15.1 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.16.5 3.17.0 3.17.1 3.17.2 3.18.0 3.19.0 3.19.1 3.19.2 3.19.3 3.19.4 3.2.0 3.2.1 3.2.2 3.20.0 3.21.0 3.21.1 3.22.0 3.22.1 3.22.2 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 3.6.0 3.6.1 3.6.2 3.7.0 3.8.0 3.9.0 4.0.0 4.1.0 4.1.1 4.10.0 4.10.1 4.11.0 4.12.0 4.13.0 4.13.1 4.13.2 4.14.0 4.14.1 4.14.2 4.14.3 4.14.4 4.14.5 4.14.6 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.1 4.7.0 4.7.1 4.8.0 4.8.1 4.9.0 trunk 1.9.0 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.10.0 2.10.1 2.10.2 2.10.3 2.10.4 2.11.0 2.11.1 2.11.2 2.11.3 2.12.0 2.12.1 2.12.2 2.12.3 2.13.0 2.13.1 2.13.2 2.13.3 2.13.4 2.14.0 2.15.0 2.16.0 2.16.1 2.17.0 2.17.1 2.17.3 2.18.0 2.18.1 2.19.1 2.19.2 2.19.3 2.19.4 2.19.5 2.19.6 2.19.7 2.19.8 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.20.0 2.20.1 2.20.2 2.21.0 2.21.1 2.21.2 2.21.3 2.21.4 2.22.0 2.22.1 2.22.2 2.22.3 2.23.0 2.23.1 2.23.2 2.24.0 2.24.1 2.24.2 2.25.0 2.25.1 2.25.2 2.25.3 2.26.0 2.27.0 2.27.1 2.27.2 2.27.3 2.28.0 2.29.0 2.29.1 2.29.2
give / src / Views / Form / Templates / Sequoia / Sequoia.php
give / src / Views / Form / Templates / Sequoia Last commit date
assets 1 year ago sections 1 year ago views 1 year ago Actions.php 4 years ago Sequoia.php 1 year ago optionConfig.php 4 years ago
Sequoia.php
484 lines
1 <?php
2
3 namespace Give\Views\Form\Templates\Sequoia;
4
5 use Give\Form\Template;
6 use Give\Form\Template\Hookable;
7 use Give\Form\Template\Scriptable;
8 use Give\Helpers\Form\Template as FormTemplateUtils;
9 use Give\Helpers\Utils;
10 use Give\Receipt\DonationReceipt;
11 use Give_Donate_Form as DonationForm;
12 use Give_Scripts;
13
14 use function give_do_email_tags as formatContent;
15 use function give_is_setting_enabled;
16
17 /**
18 * Class Sequoia
19 *
20 * @package Give\Views\Form\Templates
21 */
22 class Sequoia extends Template implements Hookable, Scriptable
23 {
24 /**
25 * Contains the options for the Sequoia form template.
26 * @since 2.27.0
27 * @var array
28 */
29 private $options;
30
31 public function __construct()
32 {
33 $this->options = FormTemplateUtils::getOptions();
34 }
35
36 /**
37 * @inheritDoc
38 */
39 public function getFormStartingHeight($formId)
40 {
41 $form = new DonationForm($formId);
42 $templateOptions = FormTemplateUtils::getOptions($formId);
43 if ($templateOptions['introduction']['enabled'] === 'disabled') {
44 return 645;
45 }
46 $goalHeight = ! $form->has_goal() ? 0 : 123;
47 $imageHeight = empty($templateOptions['introduction']['image']) && empty(
48 get_post_thumbnail_id(
49 $formId
50 )
51 ) ? 0 : 175;
52
53 return 423 + $goalHeight + $imageHeight;
54 }
55
56 /**
57 * @inheritDoc
58 */
59 public function getLoadingView()
60 {
61 return GIVE_PLUGIN_DIR . 'src/Views/Form/Templates/Sequoia/views/loading.php';
62 }
63
64 /**
65 * @inheritDoc
66 */
67 public function getReceiptView()
68 {
69 return wp_doing_ajax(
70 ) ? GIVE_PLUGIN_DIR . 'src/Views/Form/Templates/Sequoia/views/receipt.php' : parent::getReceiptView();
71 }
72
73 /**
74 * @inheritDoc
75 */
76 public function loadHooks()
77 {
78 $actions = new Actions();
79 $actions->init();
80 }
81
82 /**
83 * @inheritDoc
84 *
85 * @since 4.1.0 Added custom form styles
86 * @since 2.16.0 Load google fonts if "enabled".
87 */
88 public function loadScripts()
89 {
90 // Localize Template options
91 $templateOptions = FormTemplateUtils::getOptions();
92
93 // Set defaults
94 $templateOptions['visual_appearance']['google-fonts'] = ! empty($templateOptions['visual_appearance']['google-fonts']) ? $templateOptions['visual_appearance']['google-fonts'] : 'enabled';
95 $templateOptions['introduction']['donate_label'] = ! empty($templateOptions['introduction']['donate_label']) ? $templateOptions['introduction']['donate_label'] : __(
96 'Donate Now',
97 'give'
98 );
99 $templateOptions['visual_appearance']['primary_color'] = ! empty($templateOptions['visual_appearance']['primary_color']) ? $templateOptions['visual_appearance']['primary_color'] : '#28C77B';
100 $templateOptions['payment_amount']['next_label'] = ! empty($templateOptions['payment_amount']['next_label']) ? $templateOptions['payment_amount']['next_label'] : __(
101 'Continue',
102 'give'
103 );
104 $templateOptions['payment_amount']['header_label'] = ! empty($templateOptions['payment_amount']['header_label']) ? $templateOptions['payment_amount']['header_label'] : __(
105 'Choose Amount',
106 'give'
107 );
108 $templateOptions['payment_information']['header_label'] = ! empty($templateOptions['payment_information']['header_label']) ? $templateOptions['payment_information']['header_label'] : __(
109 'Add Your Information',
110 'give'
111 );
112 $templateOptions['payment_information']['checkout_label'] = ! empty($templateOptions['payment_information']['checkout_label']) ? $templateOptions['payment_information']['checkout_label'] : __(
113 'Process Donation',
114 'give'
115 );
116
117 $isGoogleFontEnabled = give_is_setting_enabled($templateOptions['visual_appearance']['google-fonts']);
118
119 if ($isGoogleFontEnabled) {
120 wp_enqueue_style(
121 'give-google-font-montserrat',
122 'https://fonts.googleapis.com/css?family=Montserrat:400,500,600,700&display=swap',
123 [],
124 GIVE_VERSION
125 );
126 }
127
128 // If default Give styles are disabled globally, enqueue Give default styles here
129 if (! give_is_setting_enabled(give_get_option('css'))) {
130 wp_enqueue_style('give-styles', (new Give_Scripts())->get_frontend_stylesheet_uri(), [], GIVE_VERSION, 'all');
131 }
132
133 // Enqueue Sequoia template styles
134 wp_enqueue_style(
135 'give-sequoia-template-css',
136 GIVE_PLUGIN_URL . 'build/assets/dist/css/give-sequoia-template.css',
137 ['give-styles'],
138 GIVE_VERSION
139 );
140
141 $primaryColor = $templateOptions['visual_appearance']['primary_color'];
142 $dynamicCss = sprintf(
143 '
144 .seperator {
145 background: %1$s !important;
146 }
147 .give-btn {
148 border: 2px solid %1$s !important;
149 background: %1$s !important;
150 }
151 .give-btn:hover {
152 background: %1$s !important;
153 }
154 .give-btn:focus {
155 box-shadow: 0 0 8px %1$s;
156 }
157 .payment .give-gateway-option-selected:focus-within .give-gateway-option::before,
158 .choose-amount .give-total-wrap .give-donation-amount:focus-within {
159 border-color: %1$s !important;
160 }
161 .give-donation-level-btn {
162 border: 2px solid %1$s !important;
163 }
164 .give-donation-level-btn.give-default-level {
165 color: %1$s !important;
166 background: #fff !important;
167 transition: background 0.2s ease, color 0.2s ease;
168 }
169 .give-donation-level-btn.give-default-level:hover {
170 color: %1$s !important; background: #fff !important;
171 }
172 .give-input:focus, .give-select:focus {
173 border: 1px solid %1$s !important;
174 }
175 .checkmark {
176 border-color: %1$s !important;
177 color: %1$s !important;
178 }
179 input[type=\'radio\'] + label::after,
180 [data-field-type=\'radio\'] label::after{
181 background: %1$s !important;
182 }
183 input[type=\'radio\']:focus + label::before{
184 border-color: %1$s;
185 }
186 a {
187 color: %1$s;
188 }
189 .give-square-cc-fields:focus,
190 .give-stripe-cc-field:focus,
191 .give-stripe-single-cc-field-wrap:focus,
192 form[id*="give-form"] .form-row textarea:focus,
193 form[id*="give-form"] .form-row textarea.required:focus,
194 form[id*="give-form"] .form-row input:focus,
195 form[id*="give-form"] .form-row input.required:focus,
196 #give-recurring-form .form-row textarea:focus,
197 #give-recurring-form .form-row textarea.required:focus,
198 #give-recurring-form .form-row input:focus,
199 #give-recurring-form .form-row input.required:focus,
200 form.give-form .form-row textarea:focus,
201 form.give-form .form-row textarea.required:focus,
202 form.give-form .form-row input:focus,
203 form.give-form .form-row input.required:focus,
204 .form-row select, #give-recurring-form .form-row select:focus,
205 form.give-form .form-row select:focus,
206 .form-row select.required:focus,
207 #give-recurring-form .form-row select.required:focus,
208 form.give-form .form-row select.required:focus,
209 .give-select:focus,
210 .give-input-field-wrapper.has-focus,
211 [data-field-type="checkbox"] label:focus-within::before,
212 [data-field-type="radio"] label:focus-within::before {
213 border-color: %1$s !important;
214 }
215 ',
216 $primaryColor
217 );
218
219 $rawColor = trim($primaryColor, '#');
220 $dynamicCss .= "
221 .payment [id*='give-create-account-wrap-'] label::after {
222 background-image: url(\"data:image/svg+xml,%3Csvg width='15' height='11' viewBox='0 0 15 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.73047 10.7812C6.00391 11.0547 6.46875 11.0547 6.74219 10.7812L14.7812 2.74219C15.0547 2.46875 15.0547 2.00391 14.7812 1.73047L13.7969 0.746094C13.5234 0.472656 13.0859 0.472656 12.8125 0.746094L6.25 7.30859L3.16016 4.24609C2.88672 3.97266 2.44922 3.97266 2.17578 4.24609L1.19141 5.23047C0.917969 5.50391 0.917969 5.96875 1.19141 6.24219L5.73047 10.7812Z' fill='%23{$rawColor}'/%3E%3C/svg%3E%0A\");
223 }
224 #give_terms_agreement:hover,
225 #give_terms_agreement:focus-within,
226 #give_terms_agreement.active {
227 border: 1px solid {$primaryColor} !important;
228 }
229 #give_terms_agreement input[type='checkbox']:focus + label::before {
230 border-color: {$primaryColor};
231 }
232 #give_terms_agreement input[type='checkbox'] + label::after,
233 #give-anonymous-donation-wrap label::after,
234 [data-field-type='checkbox'] label.active:after {
235 background-image: url(\"data:image/svg+xml,%3Csvg width='15' height='11' viewBox='0 0 15 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.73047 10.7812C6.00391 11.0547 6.46875 11.0547 6.74219 10.7812L14.7812 2.74219C15.0547 2.46875 15.0547 2.00391 14.7812 1.73047L13.7969 0.746094C13.5234 0.472656 13.0859 0.472656 12.8125 0.746094L6.25 7.30859L3.16016 4.24609C2.88672 3.97266 2.44922 3.97266 2.17578 4.24609L1.19141 5.23047C0.917969 5.50391 0.917969 5.96875 1.19141 6.24219L5.73047 10.7812Z' fill='%23{$rawColor}'/%3E%3C/svg%3E%0A\") !important;
236 }
237 #give-anonymous-donation-wrap label:focus-within::before {
238 border-color: {$primaryColor} !important;
239 }
240 ";
241
242 if (Utils::isPluginActive('give-recurring/give-recurring.php')) {
243 $dynamicCss .= "
244 .give-recurring-donors-choice:hover,
245 .give-recurring-donors-choice:focus-within,
246 .give-recurring-donors-choice.active {
247 border: 1px solid {$primaryColor};
248 }
249 .give-recurring-donors-choice .give-recurring-donors-choice-period:focus,
250 .give-recurring-donors-choice input[type='checkbox']:focus + label::before {
251 border-color: {$primaryColor};
252 }
253 .give-recurring-donors-choice input[type='checkbox'] + label::after {
254 background-image: url(\"data:image/svg+xml,%3Csvg width='15' height='11' viewBox='0 0 15 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.73047 10.7812C6.00391 11.0547 6.46875 11.0547 6.74219 10.7812L14.7812 2.74219C15.0547 2.46875 15.0547 2.00391 14.7812 1.73047L13.7969 0.746094C13.5234 0.472656 13.0859 0.472656 12.8125 0.746094L6.25 7.30859L3.16016 4.24609C2.88672 3.97266 2.44922 3.97266 2.17578 4.24609L1.19141 5.23047C0.917969 5.50391 0.917969 5.96875 1.19141 6.24219L5.73047 10.7812Z' fill='%23{$rawColor}'/%3E%3C/svg%3E%0A\");
255 }
256 ";
257 }
258
259 if (Utils::isPluginActive('give-fee-recovery/give-fee-recovery.php')) {
260 $dynamicCss .= "
261 .give-fee-recovery-donors-choice.give-fee-message:hover,
262 .give-fee-recovery-donors-choice.give-fee-message:focus-within,
263 .give-fee-recovery-donors-choice.give-fee-message.active {
264 border: 1px solid {$primaryColor};
265 }
266 .give-fee-message-label input[type='checkbox']:focus + span::before {
267 border-color: {$primaryColor};
268 }
269 .give-fee-recovery-donors-choice.give-fee-message input[type='checkbox'] + .give-fee-message-label-text::after {
270 background-image: url(\"data:image/svg+xml,%3Csvg width='15' height='11' viewBox='0 0 15 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.73047 10.7812C6.00391 11.0547 6.46875 11.0547 6.74219 10.7812L14.7812 2.74219C15.0547 2.46875 15.0547 2.00391 14.7812 1.73047L13.7969 0.746094C13.5234 0.472656 13.0859 0.472656 12.8125 0.746094L6.25 7.30859L3.16016 4.24609C2.88672 3.97266 2.44922 3.97266 2.17578 4.24609L1.19141 5.23047C0.917969 5.50391 0.917969 5.96875 1.19141 6.24219L5.73047 10.7812Z' fill='%23{$rawColor}'/%3E%3C/svg%3E%0A\");
271 }
272 ";
273 }
274
275 if (Utils::isPluginActive('give-activecampaign/give-activecampaign.php')) {
276 $dynamicCss .= "
277 .give-activecampaign-fieldset:hover,
278 .give-activecampaign-fieldset:focus-within,
279 .give-activecampaign-fieldset.active {
280 border: 1px solid {$primaryColor} !important;
281 }
282 .give-activecampaign-fieldset input[type='checkbox']:focus + span::before {
283 border-color: {$primaryColor};
284 }
285 .give-activecampaign-fieldset input[type='checkbox'] + span::after {
286 background-image: url(\"data:image/svg+xml,%3Csvg width='15' height='11' viewBox='0 0 15 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.73047 10.7812C6.00391 11.0547 6.46875 11.0547 6.74219 10.7812L14.7812 2.74219C15.0547 2.46875 15.0547 2.00391 14.7812 1.73047L13.7969 0.746094C13.5234 0.472656 13.0859 0.472656 12.8125 0.746094L6.25 7.30859L3.16016 4.24609C2.88672 3.97266 2.44922 3.97266 2.17578 4.24609L1.19141 5.23047C0.917969 5.50391 0.917969 5.96875 1.19141 6.24219L5.73047 10.7812Z' fill='%23{$rawColor}'/%3E%3C/svg%3E%0A\") !important;
287 }
288 ";
289 }
290
291 if (Utils::isPluginActive('give-mailchimp/give-mailchimp.php')) {
292 $dynamicCss .= "
293 .give-mailchimp-fieldset:hover,
294 .give-mailchimp-fieldset:focus-within,
295 .give-mailchimp-fieldset.active {
296 border: 1px solid {$primaryColor} !important;
297 }
298 .give-mailchimp-fieldset input[type='checkbox']:focus + span::before {
299 border-color: {$primaryColor};
300 }
301 .give-mailchimp-fieldset input[type='checkbox'] + span::after {
302 background-image: url(\"data:image/svg+xml,%3Csvg width='15' height='11' viewBox='0 0 15 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.73047 10.7812C6.00391 11.0547 6.46875 11.0547 6.74219 10.7812L14.7812 2.74219C15.0547 2.46875 15.0547 2.00391 14.7812 1.73047L13.7969 0.746094C13.5234 0.472656 13.0859 0.472656 12.8125 0.746094L6.25 7.30859L3.16016 4.24609C2.88672 3.97266 2.44922 3.97266 2.17578 4.24609L1.19141 5.23047C0.917969 5.50391 0.917969 5.96875 1.19141 6.24219L5.73047 10.7812Z' fill='%23{$rawColor}'/%3E%3C/svg%3E%0A\") !important;
303 }
304 ";
305 }
306
307 if (Utils::isPluginActive('give-constant-contact/give-constant-contact.php')) {
308 $dynamicCss .= "
309 .give-constant-contact-fieldset:hover,
310 .give-constant-contact-fieldset:focus-within,
311 .give-constant-contact-fieldset.active {
312 border: 1px solid {$primaryColor} !important;
313 }
314 .give-constant-contact-fieldset input[type='checkbox']:focus + span::before {
315 border-color: {$primaryColor};
316 }
317 .give-constant-contact-fieldset input[type='checkbox'] + span::after {
318 background-image: url(\"data:image/svg+xml,%3Csvg width='15' height='11' viewBox='0 0 15 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.73047 10.7812C6.00391 11.0547 6.46875 11.0547 6.74219 10.7812L14.7812 2.74219C15.0547 2.46875 15.0547 2.00391 14.7812 1.73047L13.7969 0.746094C13.5234 0.472656 13.0859 0.472656 12.8125 0.746094L6.25 7.30859L3.16016 4.24609C2.88672 3.97266 2.44922 3.97266 2.17578 4.24609L1.19141 5.23047C0.917969 5.50391 0.917969 5.96875 1.19141 6.24219L5.73047 10.7812Z' fill='%23{$rawColor}'/%3E%3C/svg%3E%0A\") !important;
319 }
320 ";
321 }
322
323 if (Utils::isPluginActive('give-form-field-manager/give-ffm.php')) {
324 $dynamicCss .= "
325 .ffm-checkbox-field label.checked::after {
326 background-image: url(\"data:image/svg+xml,%3Csvg width='15' height='11' viewBox='0 0 15 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.73047 10.7812C6.00391 11.0547 6.46875 11.0547 6.74219 10.7812L14.7812 2.74219C15.0547 2.46875 15.0547 2.00391 14.7812 1.73047L13.7969 0.746094C13.5234 0.472656 13.0859 0.472656 12.8125 0.746094L6.25 7.30859L3.16016 4.24609C2.88672 3.97266 2.44922 3.97266 2.17578 4.24609L1.19141 5.23047C0.917969 5.50391 0.917969 5.96875 1.19141 6.24219L5.73047 10.7812Z' fill='%23{$rawColor}'/%3E%3C/svg%3E%0A\");
327 }
328 .ffm-radio-field label::after {
329 background: {$primaryColor};
330 }
331 .ffm-attachment-upload-filelist:focus-within,
332 .ffm-checkbox-field label:focus-within::before,
333 .ffm-radio-field label:focus-within::before {
334 border-color: {$primaryColor};
335 }
336 ";
337 }
338
339 if (Utils::isPluginActive('give-tributes/give-tributes.php')) {
340 $dynamicCss .= "
341 .give-tributes-type-button-list input[type='radio']:checked + label.give-tribute-type-button {
342 color: {$primaryColor} !important;
343 }
344 ";
345 }
346
347 if ($isGoogleFontEnabled) {
348 $dynamicCss .= "body, button, input, select{font-family: 'Montserrat', sans-serif;}";
349 }
350
351 wp_add_inline_style('give-sequoia-template-css', $dynamicCss);
352
353 // Custom styles
354 wp_add_inline_style(
355 'give-sequoia-template-css',
356 wp_strip_all_tags(give_get_option('custom_form_styles', ''))
357 );
358
359 wp_enqueue_script(
360 'give-sequoia-template-js',
361 GIVE_PLUGIN_URL . 'build/assets/dist/js/give-sequoia-template.js',
362 ['give'],
363 GIVE_VERSION,
364 true
365 );
366 wp_localize_script('give-sequoia-template-js', 'sequoiaTemplateOptions', $templateOptions);
367 wp_localize_script(
368 'give-sequoia-template-js',
369 'sequoiaTemplateL10n',
370 [
371 'optionalLabel' => sprintf('&nbsp;(%s)', esc_html__('optional', 'give')),
372 ]
373 );
374 }
375
376 /**
377 * @inheritDoc
378 */
379 public function getID()
380 {
381 return 'sequoia';
382 }
383
384 /**
385 * @inheritDoc
386 */
387 public function getName()
388 {
389 return __('Multi-Step Form', 'give');
390 }
391
392 /**
393 * @inheritDoc
394 */
395 public function getImage()
396 {
397 return GIVE_PLUGIN_URL . 'build/assets/dist/images/admin/template-preview-multi-step.png';
398 }
399
400 /**
401 * @inheritDoc
402 */
403 public function getOptionsConfig()
404 {
405 return require 'optionConfig.php';
406 }
407
408 /**
409 * @inheritDoc
410 * @since 2.15.0 Allow HTML in thank you message.
411 */
412 public function getReceiptDetails($donationId)
413 {
414 $receipt = new DonationReceipt($donationId);
415 $options = FormTemplateUtils::getOptions();
416
417 $receipt->heading = esc_html($options['thank-you']['headline']);
418 $receipt->message = wp_kses_post(
419 formatContent($options['thank-you']['description'], ['payment_id' => $donationId])
420 );
421
422 /**
423 * Fire the action for receipt object.
424 *
425 * @since 2.7.0
426 */
427 do_action('give_new_receipt', $receipt);
428
429 return $receipt;
430 }
431
432 /**
433 * Get form heading
434 *
435 * @since 2.7.0
436 *
437 * @param int $formId
438 *
439 * @return string
440 */
441 public function getFormHeading($formId)
442 {
443 $templateOptions = FormTemplateUtils::getOptions($formId);
444
445 return ! empty($templateOptions['introduction']['headline']) ?
446 $templateOptions['introduction']['headline'] :
447 get_the_title($formId);
448 }
449
450 /**
451 * Get form image
452 *
453 * @since 2.7.0
454 *
455 * @param int $formId
456 *
457 * @return string
458 */
459 public function getFormFeaturedImage($formId)
460 {
461 $templateOptions = FormTemplateUtils::getOptions($formId);
462
463 return ! empty($templateOptions['introduction']['image']) ?
464 $templateOptions['introduction']['image'] :
465 get_the_post_thumbnail_url($formId, 'full');
466 }
467
468 /**
469 * Get form excerpt
470 *
471 * @since 2.27.0 Display only form description in Multi-Step donation form template.
472 * @since 2.19.6 Form excerpt has precedence over form description
473 * @since 2.7.0
474 *
475 * @param int|null $formId
476 *
477 * @return string|void
478 */
479 public function getFormExcerpt($formId)
480 {
481 return $this->options['introduction']['description'];
482 }
483 }
484