PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.5.3
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.5.3
1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 1.7.0.9 1.8.0 All 210 releases
charitable / includes / fields / default-fields / donation-fields.php

donation-fields.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.5.3, at includes/fields/default-fields/donation-fields.php

412 lines 12.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Returns an array of all the default donation fields.
4 *
5 * @since 1.5.0
6 * @package Charitable/i18n
7 * @author Eric Daams
8 * @copyright Copyright (c) 2017, Studio 164a
9 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
10 */
11
12 /**
13 * NOTE: Do not edit this file if you want to register a custom donation field.
14 * Instead, you can register your own donation fields like this:
15
16 charitable_register_donation_field(
17 'select_field',
18 array(
19
20 ),
21 );
22
23 */
24
25 // Exit if accessed directly.
26 if ( ! defined( 'ABSPATH' ) ) { exit; }
27
28 /**
29 * Filter the set of default donation fields.
30 *
31 * This filter is provided primarily for internal use by Charitable
32 * extensions, as it allows us to add to the registered donation fields
33 * as soon as possible.
34 *
35 * @since 1.5.0
36 *
37 * @param array $fields The multi-dimensional array of keys in $key => $args format.
38 */
39 return apply_filters( 'charitable_default_donation_fields', array(
40 'donation_id' => array(
41 'label' => __( 'Donation ID', 'charitable' ),
42 'data_type' => 'core',
43 'value_callback' => false, // Charitable_Donation::get_donation_id()
44 'donation_form' => false,
45 'admin_form' => false,
46 'show_in_meta' => false,
47 'email_tag' => array(
48 'description' => __( 'The donation ID', 'charitable' ),
49 'preview' => 164,
50 ),
51 ),
52 'first_name' => array(
53 'label' => __( 'Donor First Name', 'charitable' ),
54 'data_type' => 'user',
55 'value_callback' => 'charitable_get_donor_meta_value',
56 'donation_form' => array(
57 'label' => __( 'First name', 'charitable' ),
58 'priority' => 4,
59 'required' => true,
60 ),
61 'admin_form' => array(
62 'required' => false,
63 ),
64 'show_in_meta' => false,
65 'show_in_export' => true,
66 'email_tag' => array(
67 'tag' => 'donor_first_name',
68 'description' => __( 'The first name of the donor', 'charitable' ),
69 'preview' => 'John',
70 ),
71 ),
72 'last_name' => array(
73 'label' => __( 'Donor Last Name', 'charitable' ),
74 'data_type' => 'user',
75 'value_callback' => 'charitable_get_donor_meta_value',
76 'donation_form' => array(
77 'label' => __( 'Last name', 'charitable' ),
78 'priority' => 6,
79 'required' => true,
80 ),
81 'admin_form' => array(
82 'required' => false,
83 ),
84 'show_in_meta' => false,
85 'show_in_export' => true,
86 'email_tag' => false,
87 ),
88 'donor' => array(
89 'label' => __( 'Donor', 'charitable' ),
90 'data_type' => 'core',
91 'value_callback' => false,
92 'donation_form' => false,
93 'admin_form' => false,
94 'show_in_meta' => true,
95 'show_in_export' => false,
96 'email_tag' => array(
97 'description' => __( 'The full name of the donor', 'charitable' ),
98 'preview' => 'John Deere',
99 ),
100 ),
101 'email' => array(
102 'label' => __( 'Email', 'charitable' ),
103 'data_type' => 'user',
104 'value_callback' => 'charitable_get_donor_meta_value',
105 'donation_form' => array(
106 'type' => 'email',
107 'label' => __( 'Email', 'charitable' ),
108 'priority' => 8,
109 'required' => true,
110 ),
111 'admin_form' => array(
112 'required' => false,
113 ),
114 'email_tag' => array(
115 'tag' => 'donor_email',
116 'description' => __( 'The email address of the donor', 'charitable' ),
117 'preview' => 'john@example.com',
118 ),
119 ),
120 'donor_address' => array(
121 'label' => __( 'Address', 'charitable' ),
122 'data_type' => 'core',
123 'value_callback' => false, // Will use Charitable_Donation::get_donor_address()
124 'donation_form' => false,
125 'admin_form' => false,
126 'email_tag' => array(
127 'description' => __( 'The donor\'s address', 'charitable' ),
128 'preview' => charitable_get_location_helper()->get_formatted_address( array(
129 'first_name' => 'John',
130 'last_name' => 'Deere',
131 'company' => 'Deere & Company',
132 'address' => 'One John Deere Place',
133 'city' => 'Moline',
134 'state' => 'Illinois',
135 'postcode' => '61265',
136 'country' => 'US',
137 ) ),
138 ),
139 'show_in_meta' => true,
140 'show_in_export' => true,
141 ),
142 'address' => array(
143 'label' => __( 'Address', 'charitable' ),
144 'data_type' => 'user',
145 'value_callback' => 'charitable_get_donor_meta_value',
146 'donation_form' => array(
147 'priority' => 10,
148 'required' => false,
149 ),
150 'admin_form' => true,
151 'email_tag' => false,
152 'show_in_meta' => false,
153 'show_in_export' => true,
154 ),
155 'address_2' => array(
156 'label' => __( 'Address 2', 'charitable' ),
157 'data_type' => 'user',
158 'value_callback' => 'charitable_get_donor_meta_value',
159 'donation_form' => array(
160 'priority' => 12,
161 'required' => false,
162 ),
163 'admin_form' => true,
164 'email_tag' => false,
165 'show_in_meta' => false,
166 'show_in_export' => true,
167 ),
168 'city' => array(
169 'label' => __( 'City', 'charitable' ),
170 'data_type' => 'user',
171 'value_callback' => 'charitable_get_donor_meta_value',
172 'donation_form' => array(
173 'priority' => 14,
174 'required' => false,
175 ),
176 'admin_form' => true,
177 'email_tag' => false,
178 'show_in_meta' => false,
179 'show_in_export' => true,
180 ),
181 'state' => array(
182 'label' => __( 'State', 'charitable' ),
183 'data_type' => 'user',
184 'value_callback' => 'charitable_get_donor_meta_value',
185 'donation_form' => array(
186 'priority' => 16,
187 'required' => false,
188 ),
189 'admin_form' => true,
190 'email_tag' => false,
191 'show_in_meta' => false,
192 'show_in_export' => true,
193 ),
194 'postcode' => array(
195 'label' => __( 'Postcode', 'charitable' ),
196 'data_type' => 'user',
197 'value_callback' => 'charitable_get_donor_meta_value',
198 'donation_form' => array(
199 'priority' => 18,
200 'required' => false,
201 ),
202 'admin_form' => true,
203 'email_tag' => false,
204 'show_in_meta' => false,
205 'show_in_export' => true,
206 ),
207 'country' => array(
208 'label' => __( 'Country', 'charitable' ),
209 'data_type' => 'user',
210 'value_callback' => 'charitable_get_donor_meta_value',
211 'donation_form' => array(
212 'priority' => 20,
213 'required' => false,
214 'type' => 'select',
215 'options' => charitable_get_location_helper()->get_countries(),
216 ),
217 'admin_form' => true,
218 'email_tag' => false,
219 'show_in_meta' => false,
220 'show_in_export' => true,
221 ),
222 'phone' => array(
223 'label' => __( 'Phone Number', 'charitable' ),
224 'data_type' => 'user',
225 'value_callback' => 'charitable_get_donor_meta_value',
226 'donation_form' => array(
227 'priority' => 22,
228 'required' => false,
229 ),
230 'admin_form' => true,
231 'email_tag' => array(
232 'tag' => 'donor_phone',
233 'description' => __( 'The donor\'s phone number', 'charitable' ),
234 'preview' => '1300 000 000',
235 ),
236 'show_in_meta' => true,
237 'show_in_export' => true,
238 ),
239 'campaigns' => array(
240 'label' => __( 'Campaigns', 'charitable' ),
241 'data_type' => 'core',
242 'value_callback' => false, // Will use Charitable_Donation::get_campaigns()
243 'donation_form' => false,
244 'admin_form' => false,
245 'email_tag' => array(
246 'description' => __( 'The campaigns that were donated to', 'charitable' ),
247 'preview' => __( 'Fake Campaign', 'charitable' ),
248 ),
249 'show_in_meta' => false,
250 'show_in_export' => false,
251 ),
252 'campaign_categories_list' => array(
253 'label' => __( 'Campaign Categories', 'charitable' ),
254 'data_type' => 'core',
255 'value_callback' => false, // Will use Charitable_Donation::get_campaign_categories_list()
256 'donation_form' => false,
257 'admin_form' => false,
258 'email_tag' => array(
259 'tag' => 'campaign_categories',
260 'description' => __( 'The categories of the campaigns that were donated to', 'charitable' ),
261 'preview' => __( 'Fake Category', 'charitable' ),
262 ),
263 'show_in_meta' => false,
264 'show_in_export' => true,
265 ),
266 // 'donation_amount' => array(
267 // 'label' => __( 'Amount', 'charitable' ),
268 // 'donation_form' => array(
269 // 'donation_amount' => array(
270 // 'type' => 'donation-amount',
271 // 'priority' => 4,
272 // 'required' => false,
273 // 'section' => 'donation_fields',
274 // ),
275 // ),
276 // 'admin_form' => false,
277 // 'email_tag' => false,
278 // 'show_in_meta' => false,
279 // 'show_in_export' => false,
280 // ),
281 'amount_formatted' => array(
282 'label' => __( 'Donation Amount', 'charitable' ),
283 'data_type' => 'core',
284 'donation_form' => false,
285 'admin_form' => false,
286 'email_tag' => array(
287 'tag' => 'donation_amount',
288 'description' => __( 'The total amount donated', 'charitable' ),
289 'preview' => '$50.00',
290 ),
291 'show_in_meta' => false,
292 'show_in_export' => false,
293 ),
294 'date' => array(
295 'label' => __( 'Date of Donation', 'charitable' ),
296 'data_type' => 'core',
297 'value_callback' => false, // Will use Charitable_Donation::get_date()
298 'donation_form' => false,
299 'admin_form' => array(
300 'type' => 'datepicker',
301 'priority' => 4,
302 'required' => true,
303 'section' => 'meta',
304 'default' => date_i18n( 'F d, Y', time() ),
305 'value_callback' => 'charitable_get_donation_date_for_form_value',
306 ),
307 'email_tag' => array(
308 'tag' => 'donation_date',
309 'description' => __( 'The date the donation was made', 'charitable' ),
310 'preview' => date_i18n( get_option( 'date_format' ) ),
311 ),
312 'show_in_meta' => false,
313 'show_in_export' => true,
314 ),
315 'time' => array(
316 'label' => __( 'Time of Donation', 'charitable' ),
317 'data_type' => 'core',
318 'value_callback' => false, // Will use Charitable_Donation::get_time()
319 'donation_form' => false,
320 'admin_form' => false,
321 'email_tag' => false,
322 'show_in_meta' => false,
323 'show_in_export' => true,
324 ),
325 'status' => array(
326 'label' => __( 'Donation Status', 'charitable' ),
327 'data_type' => 'core',
328 'value_callback' => false, // Will use Charitable_Donation::get_status()
329 'donation_form' => false,
330 'admin_form' => array(
331 'type' => 'select',
332 'priority' => 8,
333 'required' => true,
334 'section' => 'meta',
335 'options' => charitable_get_valid_donation_statuses(),
336 ),
337 'email_tag' => false,
338 'show_in_meta' => false,
339 'show_in_export' => false,
340 ),
341 'status_label' => array(
342 'label' => __( 'Donation Status', 'charitable' ),
343 'data_type' => 'core',
344 'value_callback' => false, // Will use Charitable_Donation::get_status_label()
345 'donation_form' => false,
346 'admin_form' => false,
347 'email_tag' => array(
348 'tag' => 'donation_status',
349 'description' => __( 'The status of the donation (pending, paid, etc.)', 'charitable' ),
350 'preview' => __( 'Paid', 'charitable' ),
351 ),
352 'show_in_meta' => false,
353 'show_in_export' => true,
354 ),
355 'donation_gateway' => array(
356 'label' => __( 'Payment Method', 'charitable' ),
357 'data_type' => 'meta',
358 'value_callback' => 'charitable_get_donation_meta_value',
359 'donation_form' => false,
360 'admin_form' => array(
361 'type' => 'hidden',
362 'section' => 'meta',
363 ),
364 'email_tag' => false,
365 'show_in_meta' => false,
366 'show_in_export' => false,
367 ),
368 'gateway_label' => array(
369 'label' => __( 'Payment Method', 'charitable' ),
370 'data_type' => 'core',
371 'value_callback' => false, // Will use Charitable_Donation::get_gateway_label()
372 'donation_form' => false,
373 'admin_form' => false,
374 'email_tag' => false,
375 'show_in_meta' => true,
376 'show_in_export' => true,
377 ),
378 'donation_key' => array(
379 'label' => __( 'Donation Key', 'charitable' ),
380 'data_type' => 'core',
381 'value_callback' => false, // Will use Charitable_Donation::get_donation_key()
382 'donation_form' => false,
383 'admin_form' => false,
384 'email_tag' => false,
385 'show_in_meta' => true,
386 'show_in_export' => false,
387 ),
388 'test_mode' => array(
389 'label' => __( 'Donation made in test mode?', 'charitable' ),
390 'data_type' => 'core',
391 'value_callback' => false, // Will use Charitable_Donation::get_test_mode_text()
392 'donation_form' => false,
393 'admin_form' => false,
394 'email_tag' => false,
395 'show_in_meta' => true,
396 'show_in_export' => true,
397 ),
398 'donation_summary' => array(
399 'label' => __( 'Summary', 'charitable' ),
400 'data_type' => 'core',
401 'value_callback' => false, // Will use Charitable_Donation::get_donation_summary()
402 'donation_form' => false,
403 'admin_form' => false,
404 'email_tag' => array(
405 'description' => __( 'A summary of the donation', 'charitable' ),
406 'preview' => __( 'Fake Campaign: $50.00', 'charitable' ) . PHP_EOL,
407 ),
408 'show_in_meta' => false,
409 'show_in_export' => false,
410 ),
411 ) );
412