PluginProbe
weForms – Easy Drag & Drop Contact Form Builder For WordPress / 1.6.1
weForms – Easy Drag & Drop Contact Form Builder For WordPress v1.6.1
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-online-booking-form.php

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

94 lines 3.7 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_Template_Online_Booking_Form extends WeForms_Form_Template {
6
7 public function __construct() {
8 parent::__construct();
9
10 $this->enabled = class_exists( 'WeForms_Pro' );
11 $this->title = __( 'Online Booking Form', 'weforms' );
12 $this->description = __( 'Have more guests book with this easy to fill booking form.', 'weforms' );
13 $this->image = WEFORMS_ASSET_URI . '/images/form-template/online-booking-form.png';
14 $this->category = 'reservation';
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 'required' => true,
49 'label' => 'Phone Number',
50 'name' => 'phone_number',
51 ] ),
52 array_merge( $all_fields['date_field']->get_field_props(), [
53 'label' => __( 'Departure Date/Time', 'weforms' ),
54 'name' => 'departure_date',
55 ] ),
56 array_merge( $all_fields['date_field']->get_field_props(), [
57 'label' => __( 'Return Date/Time', 'weforms' ),
58 'name' => 'return_date',
59 ] ),
60 array_merge( $all_fields['textarea_field']->get_field_props(), [
61 'required' => true,
62 'label' => 'Pickup Address',
63 'name' => 'pickup_address',
64 ] ),
65 array_merge( $all_fields['textarea_field']->get_field_props(), [
66 'required' => true,
67 'label' => 'Destination Address',
68 'name' => 'destination_address',
69 ] ),
70 array_merge( $all_fields['dropdown_field']->get_field_props(), [
71 'required' => true,
72 'label' => 'Journey Type',
73 'name' => 'journey_type',
74 'options' => [
75 'one_way' => __( 'One Way', 'weforms' ),
76 'return' => __( 'Return', 'weforms' ),
77 ],
78 ] ),
79 array_merge( $all_fields['numeric_text_field']->get_field_props(), [
80 'required' => true,
81 'label' => 'Number of Passengers',
82 'name' => 'number_of_passengers',
83 ] ),
84 array_merge( $all_fields['textarea_field']->get_field_props(), [
85 'required' => true,
86 'label' => 'Additional Message',
87 'name' => 'additional_message',
88 ] ),
89 ];
90
91 return $form_fields;
92 }
93 }
94