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-contact.php

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

45 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Contact form template
5 */
6 class WeForms_Template_Contact extends WeForms_Form_Template {
7
8 public function __construct() {
9 parent::__construct();
10
11 $this->enabled = true;
12 $this->title = __( 'Contact Form', 'weforms' );
13 $this->description = __( 'Create a simple contact form for your site.', 'weforms' );
14 $this->image = WEFORMS_ASSET_URI . '/images/form-template/contact.png';
15 $this->category = 'default';
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 ] ),
35 array_merge( $all_fields['textarea_field']->get_field_props(), [
36 'required' => 'yes',
37 'label' => __( 'Message', 'weforms' ),
38 'name' => 'message',
39 ] ),
40 ];
41
42 return $form_fields;
43 }
44 }
45