PluginProbe ʕ •ᴥ•ʔ
GiveWP – Donation Plugin and Fundraising Platform / 2.12.2
GiveWP – Donation Plugin and Fundraising Platform v2.12.2
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 4 years ago sections 5 years ago views 5 years ago Actions.php 5 years ago Sequoia.php 5 years ago optionConfig.php 5 years ago
Sequoia.php
391 lines
1 <?php
2 namespace Give\Views\Form\Templates\Sequoia;
3
4 use Give\Form\Template;
5 use Give\Form\Template\Hookable;
6 use Give\Form\Template\Scriptable;
7 use Give\Receipt\DonationReceipt;
8 use Give\Helpers\Utils;
9 use Give\Helpers\Form\Template as FormTemplateUtils;
10 use \Give_Donate_Form as DonationForm;
11 use Give_Scripts;
12 use function give_do_email_tags as formatContent;
13 use function give_is_setting_enabled;
14
15
16 /**
17 * Class Sequoia
18 *
19 * @package Give\Views\Form\Templates
20 */
21 class Sequoia extends Template implements Hookable, Scriptable {
22 /**
23 * @inheritDoc
24 */
25 public function getFormStartingHeight( $formId ) {
26 $form = new DonationForm( $formId );
27 $templateOptions = FormTemplateUtils::getOptions( $formId );
28 if ( $templateOptions['introduction']['enabled'] === 'disabled' ) {
29 return 645;
30 }
31 $goalHeight = ! $form->has_goal() ? 0 : 123;
32 $imageHeight = empty( $templateOptions['introduction']['image'] ) && empty( get_post_thumbnail_id( $formId ) ) ? 0 : 175;
33 return 423 + $goalHeight + $imageHeight;
34 }
35
36 /**
37 * @inheritDoc
38 */
39 public function getLoadingView() {
40 return GIVE_PLUGIN_DIR . 'src/Views/Form/Templates/Sequoia/views/loading.php';
41 }
42
43 /**
44 * @inheritDoc
45 */
46 public function getReceiptView() {
47 return wp_doing_ajax() ? GIVE_PLUGIN_DIR . 'src/Views/Form/Templates/Sequoia/views/receipt.php' : parent::getReceiptView();
48 }
49
50 /**
51 * @inheritDoc
52 */
53 public function loadHooks() {
54 $actions = new Actions();
55 $actions->init();
56 }
57
58 /**
59 * @inheritDoc
60 */
61 public function loadScripts() {
62
63 // Localize Template options
64 $templateOptions = FormTemplateUtils::getOptions();
65
66 // Set defaults
67 $templateOptions['introduction']['donate_label'] = ! empty( $templateOptions['introduction']['donate_label'] ) ? $templateOptions['introduction']['donate_label'] : __( 'Donate Now', 'give' );
68 $templateOptions['introduction']['primary_color'] = ! empty( $templateOptions['introduction']['primary_color'] ) ? $templateOptions['introduction']['primary_color'] : '#28C77B';
69 $templateOptions['payment_amount']['next_label'] = ! empty( $templateOptions['payment_amount']['next_label'] ) ? $templateOptions['payment_amount']['next_label'] : __( 'Continue', 'give' );
70 $templateOptions['payment_amount']['header_label'] = ! empty( $templateOptions['payment_amount']['header_label'] ) ? $templateOptions['payment_amount']['header_label'] : __( 'Choose Amount', 'give' );
71 $templateOptions['payment_information']['header_label'] = ! empty( $templateOptions['payment_information']['header_label'] ) ? $templateOptions['payment_information']['header_label'] : __( 'Add Your Information', 'give' );
72 $templateOptions['payment_information']['checkout_label'] = ! empty( $templateOptions['payment_information']['checkout_label'] ) ? $templateOptions['payment_information']['checkout_label'] : __( 'Process Donation', 'give' );
73
74 wp_enqueue_style( 'give-google-font-montserrat', 'https://fonts.googleapis.com/css?family=Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i&display=swap', [], GIVE_VERSION );
75
76 // If default Give styles are disabled globally, enqueue Give default styles here
77 if ( ! give_is_setting_enabled( give_get_option( 'css' ) ) ) {
78 wp_enqueue_style( 'give-styles', ( new Give_Scripts )->get_frontend_stylesheet_uri(), [], GIVE_VERSION, 'all' );
79 }
80
81 // Enqueue Sequoia template styles
82 wp_enqueue_style( 'give-sequoia-template-css', GIVE_PLUGIN_URL . 'assets/dist/css/give-sequoia-template.css', [ 'give-styles' ], GIVE_VERSION );
83
84 $primaryColor = $templateOptions['introduction']['primary_color'];
85 $dynamicCss = sprintf(
86 '
87 .seperator {
88 background: %1$s !important;
89 }
90 .give-btn {
91 border: 2px solid %1$s !important;
92 background: %1$s !important;
93 }
94 .give-btn:hover {
95 background: %1$s !important;
96 }
97 .give-btn:focus {
98 box-shadow: 0 0 8px %1$s;
99 }
100 .payment .give-gateway-option-selected:focus-within .give-gateway-option::before,
101 .choose-amount .give-total-wrap .give-donation-amount:focus-within {
102 border-color: %1$s !important;
103 }
104 .give-donation-level-btn {
105 border: 2px solid %1$s !important;
106 }
107 .give-donation-level-btn.give-default-level {
108 color: %1$s !important;
109 background: #fff !important;
110 transition: background 0.2s ease, color 0.2s ease;
111 }
112 .give-donation-level-btn.give-default-level:hover {
113 color: %1$s !important; background: #fff !important;
114 }
115 .give-input:focus, .give-select:focus {
116 border: 1px solid %1$s !important;
117 }
118 .checkmark {
119 border-color: %1$s !important;
120 color: %1$s !important;
121 }
122 input[type=\'radio\'] + label::after {
123 background: %1$s !important;
124 }
125 input[type=\'radio\']:focus + label::before {
126 border-color: %1$s;
127 }
128 a {
129 color: %1$s;
130 }
131 .give-square-cc-fields:focus,
132 .give-stripe-cc-field:focus,
133 .give-stripe-single-cc-field-wrap:focus,
134 form[id*="give-form"] .form-row textarea:focus,
135 form[id*="give-form"] .form-row textarea.required:focus,
136 form[id*="give-form"] .form-row input:focus,
137 form[id*="give-form"] .form-row input.required:focus,
138 #give-recurring-form .form-row textarea:focus,
139 #give-recurring-form .form-row textarea.required:focus,
140 #give-recurring-form .form-row input:focus,
141 #give-recurring-form .form-row input.required:focus,
142 form.give-form .form-row textarea:focus,
143 form.give-form .form-row textarea.required:focus,
144 form.give-form .form-row input:focus,
145 form.give-form .form-row input.required:focus,
146 .form-row select, #give-recurring-form .form-row select:focus,
147 form.give-form .form-row select:focus,
148 .form-row select.required:focus,
149 #give-recurring-form .form-row select.required:focus,
150 form.give-form .form-row select.required:focus, .give-select:focus,
151 .give-input-field-wrapper.has-focus{
152 border-color: %1$s !important;
153 }
154 ',
155 $primaryColor
156 );
157
158 $rawColor = trim( $primaryColor, '#' );
159 $dynamicCss .= "
160 .payment [id*='give-create-account-wrap-'] label::after {
161 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\");
162 }
163 #give_terms_agreement:hover,
164 #give_terms_agreement:focus-within,
165 #give_terms_agreement.active {
166 border: 1px solid {$primaryColor} !important;
167 }
168 #give_terms_agreement input[type='checkbox']:focus + label::before {
169 border-color: {$primaryColor};
170 }
171 #give_terms_agreement input[type='checkbox'] + label::after {
172 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;
173 }
174 #give-anonymous-donation-wrap label::after {
175 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;
176 }
177 #give-anonymous-donation-wrap label:focus-within::before {
178 border-color: {$primaryColor} !important;
179 }
180 ";
181
182 if ( Utils::isPluginActive( 'give-recurring/give-recurring.php' ) ) {
183 $dynamicCss .= "
184 .give-recurring-donors-choice:hover,
185 .give-recurring-donors-choice:focus-within,
186 .give-recurring-donors-choice.active {
187 border: 1px solid {$primaryColor};
188 }
189 .give-recurring-donors-choice .give-recurring-donors-choice-period:focus,
190 .give-recurring-donors-choice input[type='checkbox']:focus + label::before {
191 border-color: {$primaryColor};
192 }
193 .give-recurring-donors-choice input[type='checkbox'] + label::after {
194 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\");
195 }
196 ";
197 }
198
199 if ( Utils::isPluginActive( 'give-fee-recovery/give-fee-recovery.php' ) ) {
200 $dynamicCss .= "
201 .give-fee-recovery-donors-choice.give-fee-message:hover,
202 .give-fee-recovery-donors-choice.give-fee-message:focus-within,
203 .give-fee-recovery-donors-choice.give-fee-message.active {
204 border: 1px solid {$primaryColor};
205 }
206 .give-fee-message-label input[type='checkbox']:focus + span::before {
207 border-color: {$primaryColor};
208 }
209 .give-fee-recovery-donors-choice.give-fee-message input[type='checkbox'] + .give-fee-message-label-text::after {
210 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\");
211 }
212 ";
213 }
214
215 if ( Utils::isPluginActive( 'give-activecampaign/give-activecampaign.php' ) ) {
216 $dynamicCss .= "
217 .give-activecampaign-fieldset:hover,
218 .give-activecampaign-fieldset:focus-within,
219 .give-activecampaign-fieldset.active {
220 border: 1px solid {$primaryColor} !important;
221 }
222 .give-activecampaign-fieldset input[type='checkbox']:focus + span::before {
223 border-color: {$primaryColor};
224 }
225 .give-activecampaign-fieldset input[type='checkbox'] + span::after {
226 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;
227 }
228 ";
229 }
230
231 if ( Utils::isPluginActive( 'give-mailchimp/give-mailchimp.php' ) ) {
232 $dynamicCss .= "
233 .give-mailchimp-fieldset:hover,
234 .give-mailchimp-fieldset:focus-within,
235 .give-mailchimp-fieldset.active {
236 border: 1px solid {$primaryColor} !important;
237 }
238 .give-mailchimp-fieldset input[type='checkbox']:focus + span::before {
239 border-color: {$primaryColor};
240 }
241 .give-mailchimp-fieldset input[type='checkbox'] + span::after {
242 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;
243 }
244 ";
245 }
246
247 if ( Utils::isPluginActive( 'give-constant-contact/give-constant-contact.php' ) ) {
248 $dynamicCss .= "
249 .give-constant-contact-fieldset:hover,
250 .give-constant-contact-fieldset:focus-within,
251 .give-constant-contact-fieldset.active {
252 border: 1px solid {$primaryColor} !important;
253 }
254 .give-constant-contact-fieldset input[type='checkbox']:focus + span::before {
255 border-color: {$primaryColor};
256 }
257 .give-constant-contact-fieldset input[type='checkbox'] + span::after {
258 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;
259 }
260 ";
261 }
262
263 if ( Utils::isPluginActive( 'give-form-field-manager/give-ffm.php' ) ) {
264 $dynamicCss .= "
265 .ffm-checkbox-field label.checked::after {
266 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\");
267 }
268 .ffm-radio-field label::after {
269 background: {$primaryColor};
270 }
271 .ffm-attachment-upload-filelist:focus-within,
272 .ffm-checkbox-field label:focus-within::before,
273 .ffm-radio-field label:focus-within::before {
274 border-color: {$primaryColor};
275 }
276 ";
277 }
278
279 wp_add_inline_style( 'give-sequoia-template-css', $dynamicCss );
280
281 wp_enqueue_script( 'give-sequoia-template-js', GIVE_PLUGIN_URL . 'assets/dist/js/give-sequoia-template.js', [ 'give' ], GIVE_VERSION, true );
282 wp_localize_script( 'give-sequoia-template-js', 'sequoiaTemplateOptions', $templateOptions );
283 wp_localize_script(
284 'give-sequoia-template-js',
285 'sequoiaTemplateL10n',
286 [
287 'optionalLabel' => sprintf( '&nbsp;(%s)', esc_html__( 'optional', 'give' ) ),
288 ]
289 );
290 }
291
292 /**
293 * @inheritDoc
294 */
295 public function getID() {
296 return 'sequoia';
297 }
298
299 /**
300 * @inheritDoc
301 */
302 public function getName() {
303 return __( 'Multi-Step Donation Form', 'give' );
304 }
305
306 /**
307 * @inheritDoc
308 */
309 public function getImage() {
310 return GIVE_PLUGIN_URL . 'assets/dist/images/admin/SequoiaForm.jpg';
311 }
312
313 /**
314 * @inheritDoc
315 */
316 public function getOptionsConfig() {
317 return require 'optionConfig.php';
318 }
319
320 /**
321 * @inheritDoc
322 */
323 public function getReceiptDetails( $donationId ) {
324 $receipt = new DonationReceipt( $donationId );
325 $options = FormTemplateUtils::getOptions();
326
327 $receipt->heading = esc_html( $options['thank-you']['headline'] );
328 $receipt->message = esc_html( formatContent( $options['thank-you']['description'], [ 'payment_id' => $donationId ] ) );
329
330 /**
331 * Fire the action for receipt object.
332 *
333 * @since 2.7.0
334 */
335 do_action( 'give_new_receipt', $receipt );
336
337 return $receipt;
338 }
339
340 /**
341 * Get form heading
342 *
343 * @param int $formId
344 *
345 * @return string
346 * @since 2.7.0
347 *
348 */
349 public function getFormHeading( $formId ) {
350 $templateOptions = FormTemplateUtils::getOptions( $formId );
351
352 return ! empty( $templateOptions['introduction']['headline'] ) ?
353 $templateOptions['introduction']['headline'] :
354 get_the_title( $formId );
355 }
356
357 /**
358 * Get form image
359 *
360 * @param int $formId
361 *
362 * @return string
363 * @since 2.7.0
364 *
365 */
366 public function getFormFeaturedImage( $formId ) {
367 $templateOptions = FormTemplateUtils::getOptions( $formId );
368
369 return ! empty( $templateOptions['introduction']['image'] ) ?
370 $templateOptions['introduction']['image'] :
371 get_the_post_thumbnail_url( $formId, 'full' );
372 }
373
374 /**
375 * Get form excerpt
376 *
377 * @param int|null $formId
378 *
379 * @return string
380 * @since 2.7.0
381 *
382 */
383 public function getFormExcerpt( $formId ) {
384 $templateOptions = FormTemplateUtils::getOptions( $formId );
385
386 return ! empty( $templateOptions['introduction']['description'] ) ?
387 $templateOptions['introduction']['description'] :
388 get_the_excerpt( $formId );
389 }
390 }
391