PluginProbe
weForms – Easy Drag & Drop Contact Form Builder For WordPress / 1.2.3
weForms – Easy Drag & Drop Contact Form Builder For WordPress v1.2.3
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-comment-and-rating.php

class-template-comment-and-rating.php in weForms – Easy Drag & Drop Contact Form Builder For WordPress 1.2.3, at includes/templates/class-template-comment-and-rating.php

62 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * A simple contact form for sending message
4 */
5 class WeForms_Template_Comment_Rating extends WeForms_Form_Template {
6
7 public function __construct() {
8 parent::__construct();
9
10 $this->enabled = class_exists( 'WeForms_Pro' );
11 $this->title = __( 'Comment & Rating Form', 'weforms' );
12 $this->description = '';
13 $this->category = 'default';
14 $this->image = WEFORMS_ASSET_URI . '/images/form-template/comment-and-rating.png';
15 $this->category = 'feedback';
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 = array(
27 array_merge( $all_fields['ratings']->get_field_props(), array(
28 'required' => 'yes',
29 'label' => 'Rating',
30 'name' => 'rating',
31 ) ),
32 array_merge( $all_fields['textarea_field']->get_field_props(), array(
33 'label' => __( 'Comment', 'weforms' ),
34 'name' => 'comment',
35 ) ),
36 array_merge( $all_fields['text_field']->get_field_props(), array(
37 'required' => 'yes',
38 'label' => 'Name',
39 'name' => 'name',
40 ) ),
41 );
42
43 return $form_fields;
44 }
45
46 /**
47 * Get the form settings
48 *
49 * @return array
50 */
51 public function get_form_settings() {
52 $defaults = $this->get_default_settings();
53
54 return array_merge( $defaults, array(
55 'message' => __( 'Thanks for your rating!', 'weforms' ),
56 'submit_text' => __( 'Submit', 'weforms' ),
57 'label_position' => 'left',
58 ) );
59 }
60
61 }
62