PluginProbe
Comments Extra Fields For Post,Pages and CPT / trunk
Comments Extra Fields For Post,Pages and CPT vtrunk
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.hidden.php

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

77 lines 2.2 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 hidden input control and their
4 * dependencies. Do not make changes in code
5 * Create on: 9 November, 2013
6 */
7
8 class NM_Hidden_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 = __ ( 'Hidden Input', "wpcomment" );
25 $this -> desc = __ ( 'regular hidden input', "wpcomment" );
26 $this -> icon = __ ( '<i class="fa fa-hashtag" aria-hidden="true"></i>', 'wp-comment-fields' );
27 $this -> settings = self::get_settings();
28
29 }
30
31
32
33
34 private function get_settings(){
35
36 $input_meta = array (
37
38 'title' => array (
39 'type' => 'text',
40 'title' => __ ( 'Title', 'wp-comment-fields' ),
41 'desc' => __ ( 'Label will show in cart', 'wp-comment-fields' )
42 ),
43 'data_name' => array (
44 'type' => 'text',
45 'title' => __ ( 'Data name', "wpcomment" ),
46 'desc' => __ ( 'REQUIRED: The identification name of this field, that you can insert into body email configuration. Note:Use only lowercase characters and underscores.', "wpcomment" )
47 ),
48 'field_value' => array (
49 'type' => 'text',
50 'title' => __ ( 'Field value', "wpcomment" ),
51 'desc' => __ ( 'you can pre-set the value of this hidden input.', "wpcomment" )
52 ),
53 'visibility' => array (
54 'type' => 'select',
55 'title' => __ ( 'Visibility', 'wp-comment-fields' ),
56 'desc' => __ ( 'Set field visibility based on user.', "wpcomment"),
57 'options' => wpcomment_field_visibility_options(),
58 'default' => 'everyone',
59 ),
60 'visibility_role' => array (
61 'type' => 'text',
62 'title' => __ ( 'User Roles', 'wp-comment-fields' ),
63 'desc' => __ ( 'Role separated by comma.', "wpcomment"),
64 'hidden' => true,
65 ),
66 'cart_display' => array (
67 'type' => 'checkbox',
68 'title' => __ ( 'Show in Cart', 'wp-comment-fields' ),
69 'desc' => __ ( 'Display Field Value in Cart', 'wp-comment-fields' ),
70 'col_classes' => array('col-md-3','col-sm-12')
71 ),
72 );
73
74 $type = 'hidden';
75 return apply_filters("poom_{$type}_input_setting", $input_meta, $this);
76 }
77 }