PluginProbe
weForms – Easy Drag & Drop Contact Form Builder For WordPress / 1.6.8
weForms – Easy Drag & Drop Contact Form Builder For WordPress v1.6.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-support.php

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

62 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Support form template
5 */
6 class WeForms_Template_Support extends WeForms_Form_Template {
7
8 public function __construct() {
9 parent::__construct();
10
11 $this->enabled = true;
12 $this->title = __( 'Support Form', 'weforms' );
13 $this->description = __( 'Enable your users for asking support questions.', 'weforms' );
14 $this->category = 'default';
15 $this->image = WEFORMS_ASSET_URI . '/images/form-template/support.png';
16 }
17
18 /**
19 * Get the form fields
20 *
21 * @return array
22 */
23 public function get_form_fields() {
24 $all_fields = $this->get_available_fields();
25
26 $form_fields = [
27 array_merge( $all_fields['name_field']->get_field_props(), [
28 'required' => 'yes',
29 'name' => 'name',
30 ] ),
31 array_merge( $all_fields['email_address']->get_field_props(), [
32 'required' => 'yes',
33 'name' => 'email',
34 'help' => __( 'Please provide a valid email address so we can get back to you', 'weforms' ),
35 ] ),
36 array_merge( $all_fields['radio_field']->get_field_props(), [
37 'required' => 'yes',
38 'label' => __( 'Department', 'weforms' ),
39 'name' => 'department',
40 'options' => [
41 'sales' => __( 'Sales', 'weforms' ),
42 'support' => __( 'Customer Support', 'weforms' ),
43 'product_development' => __( 'Product Development', 'weforms' ),
44 'other' => __( 'Other', 'weforms' ),
45 ],
46 ] ),
47 array_merge( $all_fields['text_field']->get_field_props(), [
48 'required' => 'yes',
49 'label' => __( 'Subject', 'weforms' ),
50 'name' => 'subject',
51 ] ),
52 array_merge( $all_fields['textarea_field']->get_field_props(), [
53 'label' => __( 'Message', 'weforms' ),
54 'name' => 'message',
55 'help' => __( 'How may we help you? Please be brief as much as possible.', 'weforms' ),
56 ] ),
57 ];
58
59 return $form_fields;
60 }
61 }
62