PluginProbe
Comments Extra Fields For Post,Pages and CPT / 4.7
Comments Extra Fields For Post,Pages and CPT v4.7
trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 2.2 2.3 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 5.0 5.1 5.2
wp-comment-fields / classes / inputs / input.textarea.php

input.textarea.php in Comments Extra Fields For Post,Pages and CPT 4.7, at classes/inputs/input.textarea.php

132 lines 4.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 * Followig class handling textarea input control and their
4 * dependencies. Do not make changes in code
5 * Create on: 9 November, 2013
6 */
7
8 class NM_Textarea_WPC extends WPComment_Inputs{
9
10 /*
11 * input control settings
12 */
13 var $title, $desc, $settings;
14
15 /*
16 * this var is pouplated with current plugin meta
17 */
18 var $plugin_meta;
19
20 function __construct(){
21
22 [];
23
24 $this -> title = __ ( 'Textarea Input', "wpcomment" );
25 $this -> desc = __ ( 'regular textarea input', "wpcomment" );
26 $this -> icon = __ ( '<i class="fa fa-file-text-o" aria-hidden="true"></i>', 'wp-comment-fields' );
27 $this -> settings = self::get_settings();
28
29 }
30
31
32 private function get_settings(){
33
34 $input_meta = array (
35 'title' => array (
36 'type' => 'text',
37 'title' => __ ( 'Title', "wpcomment" ),
38 'desc' => __ ( 'It will be shown as field label', "wpcomment" )
39 ),
40 'data_name' => array (
41 'type' => 'text',
42 'title' => __ ( 'Data name', "wpcomment" ),
43 'desc' => __ ( 'REQUIRED: The identification name of this field, that you can insert into body email configuration. Note:Use only lowercase characters and underscores.', "wpcomment" )
44 ),
45 'description' => array (
46 'type' => 'textarea',
47 'title' => __ ( 'Description', "wpcomment" ),
48 'desc' => __ ( 'Small description, it will be display near name title.', "wpcomment" )
49 ),
50 'placeholder' => array (
51 'type' => 'text',
52 'title' => __ ( 'Placeholder', 'wp-comment-fields' ),
53 'desc' => __ ( 'Optional.', 'wp-comment-fields' )
54 ),
55 'error_message' => array (
56 'type' => 'text',
57 'title' => __ ( 'Error message', "wpcomment" ),
58 'desc' => __ ( 'Insert the error message for validation.', "wpcomment" )
59 ),
60 'default_value' => array (
61 'type' => 'text',
62 'title' => __ ( 'Post ID', "wpcomment" ),
63 'desc' => __ ( 'It will pull content from post. e.g: 22', "wpcomment" )
64 ),
65 'max_length' => array (
66 'type' => 'text',
67 'title' => __ ( 'Max. Length', "wpcomment" ),
68 'desc' => __ ( 'Max. characters allowed, leave blank for default', "wpcomment" ),
69 'col_classes' => array('col-md-3','col-sm-12')
70 ),
71 'class' => array (
72 'type' => 'text',
73 'title' => __ ( 'Class', "wpcomment" ),
74 'desc' => __ ( 'Insert an additional class(es) (separateb by comma) for more personalization.', "wpcomment" ),
75 'col_classes' => array('col-md-3','col-sm-12')
76 ),
77 'width' => array (
78 'type' => 'select',
79 'title' => __ ( 'Width', 'wp-comment-fields' ),
80 'desc' => __ ( 'Select width column', "wpcomment"),
81 'options' => wpcomment_get_input_cols(),
82 'default' => 12,
83 'col_classes' => array('col-md-3','col-sm-12')
84 ),
85 'visibility' => array (
86 'type' => 'select',
87 'title' => __ ( 'Visibility', 'wp-comment-fields' ),
88 'desc' => __ ( 'Set field visibility based on user.', "wpcomment"),
89 'options' => wpcomment_field_visibility_options(),
90 'default' => 'everyone',
91 ),
92 'visibility_role' => array (
93 'type' => 'text',
94 'title' => __ ( 'User Roles', 'wp-comment-fields' ),
95 'desc' => __ ( 'Role separated by comma.', "wpcomment"),
96 'hidden' => true,
97 ),
98 'rich_editor' => array (
99 'type' => 'checkbox',
100 'title' => __ ( 'Rich Editor', "wpcomment" ),
101 'desc' => __ ( 'Enable WordPress rich editor.', "wpcomment" ),
102 'link' => __ ( '<a target="_blank" href="https://codex.wordpress.org/Function_Reference/wp_editor">Editor</a>', 'wp-comment-fields' ),
103 'col_classes' => array('col-md-3','col-sm-12')
104 ),
105 'desc_tooltip' => array (
106 'type' => 'checkbox',
107 'title' => __ ( 'Show tooltip (PRO)', 'wp-comment-fields' ),
108 'desc' => __ ( 'Show Description in Tooltip with Help Icon', 'wp-comment-fields' ),
109 'col_classes' => array('col-md-3','col-sm-12')
110 ),
111 'required' => array (
112 'type' => 'checkbox',
113 'title' => __ ( 'Required', "wpcomment" ),
114 'desc' => __ ( 'Select this if it must be required.', "wpcomment" ),
115 'col_classes' => array('col-md-3','col-sm-12')
116 ),
117 'logic' => array (
118 'type' => 'checkbox',
119 'title' => __ ( 'Enable Conditions', "wpcomment" ),
120 'desc' => __ ( 'Tick it to turn conditional logic to work below', "wpcomment" )
121 ),
122 'conditions' => array (
123 'type' => 'html-conditions',
124 'title' => __ ( 'Conditions', "wpcomment" ),
125 'desc' => __ ( 'Tick it to turn conditional logic to work below', "wpcomment" )
126 ),
127 );
128
129 $type = 'textarea';
130 return apply_filters("poom_{$type}_input_setting", $input_meta, $this);
131 }
132 }