PluginProbe
weForms – Easy Drag & Drop Contact Form Builder For WordPress / 1.4.8
weForms – Easy Drag & Drop Contact Form Builder For WordPress v1.4.8
1.6.7 1.6.8 1.6.9 1.6.12 1.6.13 1.6.14 1.6.15 1.6.16 1.6.17 1.6.18 1.6.19 1.6.2 1.6.20 1.6.21 1.6.22 1.6.23 1.6.24 1.6.25 1.6.26 1.6.27 1.6.28 1.6.3 1.6.4 1.6.5 1.6.6 All 74 releases
weforms / includes / templates / class-template-donation-form.php

class-template-donation-form.php in weForms – Easy Drag & Drop Contact Form Builder For WordPress 1.4.8, at includes/templates/class-template-donation-form.php

84 lines 3.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Blank form template
4 */
5 class Weforms_Donation_Form extends WeForms_Form_Template {
6
7 public function __construct() {
8 parent::__construct();
9
10 $this->enabled = class_exists( 'WeForms_Pro' );
11 $this->title = __( 'Donation Form', 'weforms' );
12 $this->description = __( 'Inspire people to donate more on your site with this form', 'weforms' );
13 $this->image = WEFORMS_ASSET_URI . '/images/form-template/donation-form.png';
14 $this->category = 'payment';
15 }
16
17 /**
18 * Get the form fields
19 *
20 * @return array
21 */
22 public function get_form_fields() {
23 $all_fields = $this->get_available_fields();
24
25 $form_fields = [
26 array_merge( $all_fields['name_field']->get_field_props(), [
27 'required' => 'yes',
28 'format' => 'first-last',
29 'first_name' => [
30 'placeholder' => '',
31 'default' => '',
32 'sub' => __( 'First Name', 'weforms' ),
33 ],
34 'last_name' => [
35 'placeholder' => '',
36 'default' => '',
37 'sub' => __( 'Last Name', 'weforms' ),
38 ],
39 'hide_subs' => false,
40 'name' => 'format',
41 ] ),
42 array_merge( $all_fields['email_address']->get_field_props(), [
43 'required' => 'yes',
44 'label' => 'Email Address',
45 'name' => 'email_address',
46 ] ),
47 array_merge( $all_fields['numeric_text_field']->get_field_props(), [
48 'label' => 'Phone Number',
49 'name' => 'phone_number',
50 ] ),
51 array_merge( $all_fields['radio_field']->get_field_props(), [
52 'required' => 'yes',
53 'label' => 'Type Of Donation',
54 'name' => 'type_of_donation',
55 'options' => [
56 'donation_1' => __( 'Donation-1', 'weforms' ),
57 'donation_2' => __( 'Donation-2', 'weforms' ),
58 'donation_3' => __( 'Donation-3', 'weforms' ),
59 ],
60 ] ),
61 array_merge( $all_fields['single_product']->get_field_props(), [
62 'required' => 'yes',
63 'label' => __( 'Donation Amount', 'weforms' ),
64 'name' => 'price',
65 'price' => [
66 'price' => 10,
67 'type' => 'donation',
68 ],
69 ] ),
70 array_merge( $all_fields['payment_method']->get_field_props(), [
71 'required' => 'yes',
72 'label' => __( 'Payment Method', 'weforms' ),
73 'name' => 'payment_method',
74 ] ),
75 array_merge( $all_fields['textarea_field']->get_field_props(), [
76 'label' => 'Comments',
77 'name' => 'comments',
78 ] ),
79 ];
80
81 return $form_fields;
82 }
83 }
84