Click to Chat for WhatsApp Chat - Version 1.4

Version Description

  • New style-9, Green Square
  • Supports Analytics - using google tag manager
  • animations - alpha version
  • Supports Translations
  • style-3 can choose .svg or .png image versions
  • style-4 image size reduced, ~ 2kb
  • performance improvement.
Download this release

Release Info

Developer bhvreddy
Plugin Icon 128x128 Click to Chat for WhatsApp Chat
Version 1.4
Comparing to
See all releases

Code changes from version 1.3 to 1.4

Files changed (63) hide show
  1. admin/admin.php +6 -1
  2. admin/class-ccw-add-styles-scripts-admin.php +8 -5
  3. admin/class-ccw-admin-menu.php +1 -1
  4. admin/class-ccw-admin-page-customize-styles.php +277 -132
  5. admin/class-ccw-admin-page.php +144 -136
  6. admin/commons/class-ht-ccw-admin-lists.php +28 -0
  7. admin/default-values.php +26 -12
  8. admin/settings_page.php +17 -17
  9. assets/css/{admin_main.css → admin_mainstyles.css} +4328 -4759
  10. assets/css/mainstyles.css +171 -0
  11. assets/css/{main.css → mdstyles.css} +2695 -3949
  12. assets/img/whatsapp-icon-square.svg +1 -0
  13. assets/img/whatsapp-logo-32x32-d.png +0 -0
  14. assets/img/whatsapp-logo-32x32.png +0 -0
  15. assets/img/{WhatsApp_logo_12.png → whatsapp-logo-deprecated.png} +0 -0
  16. assets/img/whatsapp-logo.png +0 -0
  17. assets/img/whatsapp-logo.svg +1 -0
  18. assets/js/admin_app.js +0 -23107
  19. assets/js/{main.js → admin_mainstyles.js} +74 -74
  20. assets/js/app.js +103 -1369
  21. assets/js/mainstyles.js +74 -0
  22. assets/js/{admin_main.js → mdstyles.js} +2 -2
  23. assets/js/required/admin_app-works.js +23107 -0
  24. assets/js/required/mdjs.js +1370 -0
  25. click-to-chat.php +11 -46
  26. inc/class-ccw-add-styles-scripts.php +128 -12
  27. inc/class-ccw-chatbot-mobile.php +0 -109
  28. inc/class-ccw-chatbot.php +0 -108
  29. inc/class-ccw-shortcode.php +55 -243
  30. inc/{class-ccw-first.php → class-ht-ccw-register.php} +12 -9
  31. inc/class-ht-ccw.php +241 -0
  32. inc/class-ht_ccw-chat.php +158 -0
  33. inc/commons/class-ht-ccw-ismobile.php +93 -0
  34. inc/commons/class-ht-ccw-variables.php +53 -0
  35. inc/commons/positions.php +0 -25
  36. inc/commons/styles-list-sc/sc-style-1.php +48 -0
  37. inc/commons/styles-list-sc/sc-style-2.php +21 -0
  38. inc/commons/styles-list-sc/sc-style-3.php +15 -0
  39. inc/commons/styles-list-sc/sc-style-4.1.php +17 -0
  40. inc/commons/styles-list-sc/sc-style-4.php +22 -0
  41. inc/commons/styles-list-sc/sc-style-5.php +20 -0
  42. inc/commons/styles-list-sc/sc-style-6.php +31 -0
  43. inc/commons/styles-list-sc/sc-style-7.php +31 -0
  44. inc/commons/styles-list-sc/sc-style-8.1.php +30 -0
  45. inc/commons/styles-list-sc/sc-style-8.php +33 -0
  46. inc/commons/styles-list-sc/sc-style-9.php +12 -0
  47. inc/commons/styles-list/style-0.php +5 -0
  48. inc/commons/styles-list/style-1.php +44 -0
  49. inc/commons/styles-list/style-2.php +20 -0
  50. inc/commons/styles-list/style-3.php +17 -0
  51. inc/commons/styles-list/style-4.php +23 -0
  52. inc/commons/styles-list/style-5.php +20 -0
  53. inc/commons/styles-list/style-6.php +29 -0
  54. inc/commons/styles-list/style-7.php +29 -0
  55. inc/commons/styles-list/style-8.php +32 -0
  56. inc/commons/styles-list/style-9.php +16 -0
  57. inc/commons/styles-list/style-new-plan.php +39 -0
  58. inc/commons/styles.php +48 -259
  59. inc/commons/variables.php +0 -31
  60. inc/whatsapp-url-group.php +1 -0
  61. inc/whatsapp-url.php +1 -0
  62. languages/read.md +4 -0
  63. readme.txt +21 -9
admin/admin.php CHANGED
@@ -16,11 +16,16 @@ if ( ! defined( 'ABSPATH' ) ) exit;
16
/*************** includes ***********/
17
require_once('class-ccw-add-styles-scripts-admin.php');
18
19
20
require_once('class-ccw-admin-menu.php');
21
require_once('class-ccw-admin-page.php');
22
require_once('class-ccw-admin-page-customize-styles.php');
23
24
25
26
- /*************** hooks ***********/
16
/*************** includes ***********/
17
require_once('class-ccw-add-styles-scripts-admin.php');
18
19
+ require_once('commons/class-ht-ccw-admin-lists.php');
20
21
require_once('class-ccw-admin-menu.php');
22
require_once('class-ccw-admin-page.php');
23
require_once('class-ccw-admin-page-customize-styles.php');
24
25
26
+ // as translation text added only in admin - so done here
27
+ function load_ht_ccw_textdomain() {
28
+ load_plugin_textdomain( 'click-to-chat-for-whatsapp', FALSE, HT_CCW_PLUGIN_BASENAME . '/languages/' );
29
+ }
30
31
+ add_action( 'plugins_loaded', 'load_ht_ccw_textdomain' );
admin/class-ccw-add-styles-scripts-admin.php CHANGED
@@ -11,7 +11,7 @@
11
12
if ( ! defined( 'ABSPATH' ) ) exit;
13
14
- if ( !class_exists( 'CCW_Add_Styles_Scripts_Admin' ) ) :
15
16
class CCW_Add_Styles_Scripts_Admin {
17
@@ -19,10 +19,9 @@ class CCW_Add_Styles_Scripts_Admin {
19
// Register css styles, javascript files only on 'click-to-chat' page
20
function ccw_register_files_admin($hook) {
21
22
- // ?page=click-to-chat
23
if( 'toplevel_page_click-to-chat' == $hook || 'click-to-chat_page_ccw-edit-styles' == $hook ) {
24
25
- wp_register_style('ccw_new_css_admin', plugins_url( 'assets/css/admin_main.css', dirname(__FILE__) ) , '', CCW_VERSION );
26
27
28
wp_enqueue_style('ccw_new_css_admin');
@@ -30,8 +29,12 @@ class CCW_Add_Styles_Scripts_Admin {
30
wp_enqueue_style( 'wp-color-picker' );
31
32
33
- wp_enqueue_script( 'ccw_app_admin', plugins_url( 'assets/js/admin_app.js', dirname(__FILE__) ), array( 'wp-color-picker' ), CCW_VERSION, true );
34
- // wp_enqueue_script( 'ccw_app_admin_dir', plugins_url( 'assets/js/dir.js', dirname(__FILE__) ), '', '', true );
35
// return;
36
} else {
37
return;
11
12
if ( ! defined( 'ABSPATH' ) ) exit;
13
14
+ if ( ! class_exists( 'CCW_Add_Styles_Scripts_Admin' ) ) :
15
16
class CCW_Add_Styles_Scripts_Admin {
17
19
// Register css styles, javascript files only on 'click-to-chat' page
20
function ccw_register_files_admin($hook) {
21
22
if( 'toplevel_page_click-to-chat' == $hook || 'click-to-chat_page_ccw-edit-styles' == $hook ) {
23
24
+ wp_register_style('ccw_new_css_admin', plugins_url( 'assets/css/admin_mainstyles.css', HT_CCW_PLUGIN_FILE ) , '', HT_CCW_VERSION );
25
26
27
wp_enqueue_style('ccw_new_css_admin');
29
wp_enqueue_style( 'wp-color-picker' );
30
31
32
+ // wp_enqueue_script( 'ccw_app_admin', plugins_url( 'assets/js/admin_app.js', HT_CCW_PLUGIN_FILE ), array( 'wp-color-picker' ), HT_CCW_VERSION, true );
33
+ wp_enqueue_script( 'ccw_app_admin', plugins_url( 'assets/js/required/admin_app-works.js', HT_CCW_PLUGIN_FILE ), array( 'wp-color-picker' ), HT_CCW_VERSION, true );
34
+
35
+
36
+
37
+ // wp_enqueue_script( 'ccw_app_admin_dir', plugins_url( 'assets/js/dir.js', HT_CCW_PLUGIN_FILE ), '', '', true );
38
// return;
39
} else {
40
return;
admin/class-ccw-admin-menu.php CHANGED
@@ -11,7 +11,7 @@
11
12
if ( ! defined( 'ABSPATH' ) ) exit;
13
14
- if ( !class_exists( 'CCW_Admin_Menu' ) ) :
15
16
class CCW_Admin_Menu {
17
11
12
if ( ! defined( 'ABSPATH' ) ) exit;
13
14
+ if ( ! class_exists( 'CCW_Admin_Menu' ) ) :
15
16
class CCW_Admin_Menu {
17
admin/class-ccw-admin-page-customize-styles.php CHANGED
@@ -13,7 +13,7 @@
13
14
if ( ! defined( 'ABSPATH' ) ) exit;
15
16
- if ( !class_exists( 'CCW_Admin_Page_Customize_Styles' ) ) :
17
18
class CCW_Admin_Page_Customize_Styles {
19
@@ -32,7 +32,11 @@ class CCW_Admin_Page_Customize_Styles {
32
add_settings_field( 'ccw_style_6_cs', 'Style 6', array( $this, 'ccw_style_6_cb' ), 'ccw_options_settings_cs', 'ccw_settings_cs' );
33
add_settings_field( 'ccw_style_7_cs', 'Style 7', array( $this, 'ccw_style_7_cb' ), 'ccw_options_settings_cs', 'ccw_settings_cs' );
34
add_settings_field( 'ccw_style_8_cs', 'Style 8', array( $this, 'ccw_style_8_cb' ), 'ccw_options_settings_cs', 'ccw_settings_cs' );
35
-
36
}
37
38
@@ -41,6 +45,7 @@ class CCW_Admin_Page_Customize_Styles {
41
}
42
43
44
function ccw_style_1_cb() {
45
$ccw_style_1 = get_option('ccw_options_cs');
46
?>
@@ -51,7 +56,7 @@ class CCW_Admin_Page_Customize_Styles {
51
52
<div class="row">
53
<div class="col s6">
54
- <p>Color of text</p>
55
</div>
56
<div class="input-field col s6">
57
<input name="ccw_options_cs[s1_text_color]" data-default-color="#9e9e9e" value="<?php echo esc_attr( $ccw_style_1['s1_text_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
@@ -60,7 +65,7 @@ class CCW_Admin_Page_Customize_Styles {
60
61
<div class="row">
62
<div class="col s6">
63
- <p>Color of text when focus on input box</p>
64
</div>
65
<div class="input-field col s6">
66
<input name="ccw_options_cs[s1_text_color_onfocus]" data-default-color="#26a69a" value="<?php echo esc_attr( $ccw_style_1['s1_text_color_onfocus'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
@@ -69,7 +74,7 @@ class CCW_Admin_Page_Customize_Styles {
69
70
<div class="row">
71
<div class="col s6">
72
- <p>Color of input field bottom border</p>
73
</div>
74
<div class="input-field col s6">
75
<input name="ccw_options_cs[s1_border_color]" data-default-color="#9e9e9e" value="<?php echo esc_attr( $ccw_style_1['s1_border_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
@@ -78,7 +83,7 @@ class CCW_Admin_Page_Customize_Styles {
78
79
<div class="row">
80
<div class="col s6">
81
- <p>Color of input field border bottom on focus</p>
82
</div>
83
<div class="input-field col s6">
84
<input name="ccw_options_cs[s1_border_color_onfocus]" data-default-color="#26a69a" value="<?php echo esc_attr( $ccw_style_1['s1_border_color_onfocus'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
@@ -87,7 +92,7 @@ class CCW_Admin_Page_Customize_Styles {
87
88
<div class="row">
89
<div class="col s6">
90
- <p>Color of submit button</p>
91
</div>
92
<div class="input-field col s6">
93
<input name="ccw_options_cs[s1_submit_btn_color]" data-default-color="#26a69a" value="<?php echo esc_attr( $ccw_style_1['s1_submit_btn_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
@@ -96,7 +101,7 @@ class CCW_Admin_Page_Customize_Styles {
96
97
<div class="row">
98
<div class="col s6">
99
- <p>Color of submit button - text, icon </p>
100
</div>
101
<div class="input-field col s6">
102
<input name="ccw_options_cs[s1_submit_btn_text_and_icon_color]" data-default-color="#fff" value="<?php echo esc_attr( $ccw_style_1['s1_submit_btn_text_and_icon_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
@@ -105,7 +110,7 @@ class CCW_Admin_Page_Customize_Styles {
105
106
<div class="row">
107
<div class="col s6">
108
- <p>Button Text</p>
109
</div>
110
<div class="input-field col s4">
111
<input name="ccw_options_cs[s1_btn_text]" value="<?php echo esc_attr( $ccw_style_1['s1_btn_text'] ) ?>" type="text" class="" >
@@ -115,7 +120,7 @@ class CCW_Admin_Page_Customize_Styles {
115
<!-- This is hidden row -->
116
<div class="row hide">
117
<div class="col s6">
118
- <p>Icon size</p>
119
</div>
120
<div class="input-field col s4">
121
<input name="ccw_options_cs[s1_width]" value="<?php echo esc_attr( $ccw_style_1['s1_width'] ) ?>" type="text" class="" >
@@ -132,6 +137,7 @@ class CCW_Admin_Page_Customize_Styles {
132
}
133
134
135
function ccw_style_2_cb() {
136
$ccw_style_2 = get_option('ccw_options_cs');
137
$s2_decoration_value = esc_attr( $ccw_style_2['s2_decoration'] );
@@ -144,7 +150,7 @@ class CCW_Admin_Page_Customize_Styles {
144
145
<div class="row">
146
<div class="col s6">
147
- <p>Text Color</p>
148
</div>
149
<div class="input-field col s6">
150
<input name="ccw_options_cs[s2_text_color]" data-default-color="inherit" value="<?php echo esc_attr( $ccw_style_2['s2_text_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
@@ -153,7 +159,7 @@ class CCW_Admin_Page_Customize_Styles {
153
154
<div class="row">
155
<div class="col s6">
156
- <p>Text Color When Hover</p>
157
</div>
158
<div class="input-field col s6">
159
<input name="ccw_options_cs[s2_text_color_onhover]" data-default-color="inherit" value="<?php echo esc_attr( $ccw_style_2['s2_text_color_onhover'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
@@ -162,7 +168,7 @@ class CCW_Admin_Page_Customize_Styles {
162
163
<div class="row">
164
<div class="col s6">
165
- <p>Text Decoration</p>
166
</div>
167
<div class="input-field col s6">
168
<select name="ccw_options_cs[s2_decoration]" class="select-2_2">
@@ -173,13 +179,13 @@ class CCW_Admin_Page_Customize_Styles {
173
<option value="initial" <?php echo $s2_decoration_value == 'initial' ? 'SELECTED' : ''; ?> >initial</option>
174
<option value="inherit" <?php echo $s2_decoration_value == 'inherit' ? 'SELECTED' : ''; ?> >inherit</option>
175
</select>
176
- <label>Text Decoration</label>
177
</div>
178
</div>
179
180
<div class="row">
181
<div class="col s6">
182
- <p>Text Decoration when Hover</p>
183
</div>
184
<div class="input-field col s6">
185
<select name="ccw_options_cs[s2_decoration_onhover]" class="select-2_2">
@@ -190,7 +196,7 @@ class CCW_Admin_Page_Customize_Styles {
190
<option value="initial" <?php echo $s2_decoration_onhover == 'initial' ? 'SELECTED' : ''; ?> >initial</option>
191
<option value="inherit" <?php echo $s2_decoration_onhover == 'inherit' ? 'SELECTED' : ''; ?> >inherit</option>
192
</select>
193
- <label>Text Decoration on focus</label>
194
</div>
195
</div>
196
@@ -202,8 +208,11 @@ class CCW_Admin_Page_Customize_Styles {
202
}
203
204
205
function ccw_style_3_cb() {
206
$ccw_style_3 = get_option('ccw_options_cs');
207
?>
208
<ul class="collapsible" data-collapsible="accordion">
209
<li>
@@ -212,13 +221,27 @@ class CCW_Admin_Page_Customize_Styles {
212
213
<div class="row">
214
<div class="col s6">
215
- <p>Icon size</p>
216
</div>
217
<div class="input-field col s4">
218
<input name="ccw_options_cs[s3_icon_size]" value="<?php echo esc_attr( $ccw_style_3['s3_icon_size'] ) ?>" type="text" class="" >
219
</div>
220
</div>
221
-
222
</div>
223
</div>
224
</li>
@@ -228,6 +251,7 @@ class CCW_Admin_Page_Customize_Styles {
228
}
229
230
231
function ccw_style_4_cb() {
232
$ccw_style_4 = get_option('ccw_options_cs');
233
?>
@@ -239,7 +263,7 @@ class CCW_Admin_Page_Customize_Styles {
239
240
<div class="row">
241
<div class="col s6">
242
- <p>Text Color</p>
243
</div>
244
<div class="input-field col s6">
245
<input name="ccw_options_cs[s4_text_color]" data-default-color="rgba(0, 0, 0, 0.6)" value="<?php echo esc_attr( $ccw_style_4['s4_text_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
@@ -248,7 +272,7 @@ class CCW_Admin_Page_Customize_Styles {
248
249
<div class="row">
250
<div class="col s6">
251
- <p>Background Color</p>
252
</div>
253
<div class="input-field col s6">
254
<input name="ccw_options_cs[s4_background_color]" data-default-color="#e4e4e4" value="<?php echo esc_attr( $ccw_style_4['s4_background_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
@@ -264,6 +288,7 @@ class CCW_Admin_Page_Customize_Styles {
264
}
265
266
267
function ccw_style_5_cb() {
268
$ccw_style_5 = get_option('ccw_options_cs');
269
?>
@@ -274,7 +299,7 @@ class CCW_Admin_Page_Customize_Styles {
274
275
<div class="row">
276
<div class="col s6">
277
- <p>Color of icon</p>
278
</div>
279
<div class="input-field col s6">
280
<!-- style="height: 1.375rem;" or 22px -->
@@ -284,7 +309,7 @@ class CCW_Admin_Page_Customize_Styles {
284
285
<div class="row">
286
<div class="col s6">
287
- <p>Color of icon - when hover </p>
288
</div>
289
<div class="input-field col s6">
290
<input name="ccw_options_cs[s5_hover_color]" data-default-color="#ddd" value="<?php echo esc_attr( $ccw_style_5['s5_hover_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
@@ -293,7 +318,7 @@ class CCW_Admin_Page_Customize_Styles {
293
294
<div class="row">
295
<div class="col s6">
296
- <p>Size of icon</p>
297
</div>
298
<div class="input-field col s4">
299
<input name="ccw_options_cs[s5_icon_size]" value="<?php echo esc_attr( $ccw_style_5['s5_icon_size'] ) ?>" type="text" class="" >
@@ -308,6 +333,7 @@ class CCW_Admin_Page_Customize_Styles {
308
}
309
310
311
function ccw_style_6_cb() {
312
$ccw_style_6 = get_option('ccw_options_cs');
313
?>
@@ -318,7 +344,7 @@ class CCW_Admin_Page_Customize_Styles {
318
319
<div class="row">
320
<div class="col s6">
321
- <p>Color of icon</p>
322
</div>
323
<div class="input-field col s6">
324
<!-- style="height: 1.375rem;" or 22px -->
@@ -328,7 +354,7 @@ class CCW_Admin_Page_Customize_Styles {
328
329
<div class="row">
330
<div class="col s6">
331
- <p>Color of icon - when hover </p>
332
</div>
333
<div class="input-field col s6">
334
<input name="ccw_options_cs[s6_hover_color]" data-default-color="#000" value="<?php echo esc_attr( $ccw_style_6['s6_hover_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
@@ -337,7 +363,7 @@ class CCW_Admin_Page_Customize_Styles {
337
338
<div class="row">
339
<div class="col s6">
340
- <p>Size of icon</p>
341
</div>
342
<div class="input-field col s4">
343
<input name="ccw_options_cs[s6_icon_size]" value="<?php echo esc_attr( $ccw_style_6['s6_icon_size'] ) ?>" type="text" class="" >
@@ -346,7 +372,7 @@ class CCW_Admin_Page_Customize_Styles {
346
347
<div class="row">
348
<div class="col s6">
349
- <p>Circle color </p>
350
</div>
351
<div class="input-field col s6">
352
<input name="ccw_options_cs[s6_circle_background_color]" data-default-color="#ffa500" value="<?php echo esc_attr( $ccw_style_6['s6_circle_background_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
@@ -355,7 +381,7 @@ class CCW_Admin_Page_Customize_Styles {
355
356
<div class="row">
357
<div class="col s6">
358
- <p>Circle color - when hover </p>
359
</div>
360
<div class="input-field col s6">
361
<input name="ccw_options_cs[s6_circle_background_hover_color]" data-default-color="#ffa500" value="<?php echo esc_attr( $ccw_style_6['s6_circle_background_hover_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
@@ -365,7 +391,7 @@ class CCW_Admin_Page_Customize_Styles {
365
366
<div class="row">
367
<div class="col s6">
368
- <p>Circle Height</p>
369
</div>
370
<div class="input-field col s4">
371
<input name="ccw_options_cs[s6_circle_height]" value="<?php echo esc_attr( $ccw_style_6['s6_circle_height'] ) ?>" type="text" class="" >
@@ -374,7 +400,7 @@ class CCW_Admin_Page_Customize_Styles {
374
375
<div class="row">
376
<div class="col s6">
377
- <p>Circle Width</p>
378
</div>
379
<div class="input-field col s4">
380
<input name="ccw_options_cs[s6_circle_width]" value="<?php echo esc_attr( $ccw_style_6['s6_circle_width'] ) ?>" type="text" class="" >
@@ -383,14 +409,14 @@ class CCW_Admin_Page_Customize_Styles {
383
384
<div class="row">
385
<div class="col s6">
386
- <p>Circle Line Height</p>
387
</div>
388
<div class="input-field col s4">
389
<input name="ccw_options_cs[s6_line_height]" value="<?php echo esc_attr( $ccw_style_6['s6_line_height'] ) ?>" type="text" class="" >
390
</div>
391
</div>
392
393
- <p class="description">add height, width, line-height same values - if feels like icon is not center then adjust 'Line Height' to make icon looks center of the circle</p>
394
395
</div>
396
</div>
@@ -402,6 +428,7 @@ class CCW_Admin_Page_Customize_Styles {
402
403
404
405
function ccw_style_7_cb() {
406
$ccw_style_7 = get_option('ccw_options_cs');
407
?>
@@ -413,7 +440,7 @@ class CCW_Admin_Page_Customize_Styles {
413
414
<div class="row">
415
<div class="col s6">
416
- <p>Color of icon</p>
417
</div>
418
<div class="input-field col s6">
419
<!-- style="height: 1.375rem;" or 22px -->
@@ -423,7 +450,7 @@ class CCW_Admin_Page_Customize_Styles {
423
424
<div class="row">
425
<div class="col s6">
426
- <p>Color of icon - when hover </p>
427
</div>
428
<div class="input-field col s6">
429
<input name="ccw_options_cs[s7_hover_color]" data-default-color="#000" value="<?php echo esc_attr( $ccw_style_7['s7_hover_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
@@ -432,7 +459,7 @@ class CCW_Admin_Page_Customize_Styles {
432
433
<div class="row">
434
<div class="col s6">
435
- <p>Size of icon</p>
436
</div>
437
<div class="input-field col s4">
438
<input name="ccw_options_cs[s7_icon_size]" value="<?php echo esc_attr( $ccw_style_7['s7_icon_size'] ) ?>" type="text" class="" >
@@ -441,7 +468,7 @@ class CCW_Admin_Page_Customize_Styles {
441
442
<div class="row">
443
<div class="col s6">
444
- <p>box color </p>
445
</div>
446
<div class="input-field col s6">
447
<input name="ccw_options_cs[s7_box_background_color]" data-default-color="#ffa500" value="<?php echo esc_attr( $ccw_style_7['s7_box_background_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
@@ -450,7 +477,7 @@ class CCW_Admin_Page_Customize_Styles {
450
451
<div class="row">
452
<div class="col s6">
453
- <p>box color - when hover </p>
454
</div>
455
<div class="input-field col s6">
456
<input name="ccw_options_cs[s7_box_background_hover_color]" data-default-color="#ffa500" value="<?php echo esc_attr( $ccw_style_7['s7_box_background_hover_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
@@ -460,7 +487,7 @@ class CCW_Admin_Page_Customize_Styles {
460
461
<div class="row">
462
<div class="col s6">
463
- <p>box Height</p>
464
</div>
465
<div class="input-field col s4">
466
<input name="ccw_options_cs[s7_box_height]" value="<?php echo esc_attr( $ccw_style_7['s7_box_height'] ) ?>" type="text" class="" >
@@ -469,7 +496,7 @@ class CCW_Admin_Page_Customize_Styles {
469
470
<div class="row">
471
<div class="col s6">
472
- <p>box Width</p>
473
</div>
474
<div class="input-field col s4">
475
<input name="ccw_options_cs[s7_box_width]" value="<?php echo esc_attr( $ccw_style_7['s7_box_width'] ) ?>" type="text" class="" >
@@ -478,14 +505,14 @@ class CCW_Admin_Page_Customize_Styles {
478
479
<div class="row">
480
<div class="col s6">
481
- <p>box Line Height</p>
482
</div>
483
<div class="input-field col s4">
484
<input name="ccw_options_cs[s7_line_height]" value="<?php echo esc_attr( $ccw_style_7['s7_line_height'] ) ?>" type="text" class="" >
485
</div>
486
</div>
487
488
- <p class="description">add height, width, line-height same values - if feels like icon is not center then adjust 'Line Height' to make icon looks center of the box</p>
489
490
491
</div>
@@ -497,6 +524,7 @@ class CCW_Admin_Page_Customize_Styles {
497
}
498
499
500
function ccw_style_8_cb() {
501
$ccw_style_8 = get_option('ccw_options_cs');
502
$s8_icon_float = esc_attr( $ccw_style_8['s8_icon_float'] )
@@ -509,7 +537,7 @@ class CCW_Admin_Page_Customize_Styles {
509
510
<div class="row">
511
<div class="col s6">
512
- <p>Text Color</p>
513
</div>
514
<div class="input-field col s6">
515
<input name="ccw_options_cs[s8_text_color]" data-default-color="#fff" value="<?php echo esc_attr( $ccw_style_8['s8_text_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
@@ -518,7 +546,7 @@ class CCW_Admin_Page_Customize_Styles {
518
519
<div class="row">
520
<div class="col s6">
521
- <p>Background Color</p>
522
</div>
523
<div class="input-field col s6">
524
<input name="ccw_options_cs[s8_background_color]" data-default-color="#26a69a" value="<?php echo esc_attr( $ccw_style_8['s8_background_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
@@ -527,7 +555,7 @@ class CCW_Admin_Page_Customize_Styles {
527
528
<div class="row">
529
<div class="col s6">
530
- <p>Icon color</p>
531
</div>
532
<div class="input-field col s6">
533
<input name="ccw_options_cs[s8_icon_color]" data-default-color="#fff" value="<?php echo esc_attr( $ccw_style_8['s8_icon_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
@@ -536,7 +564,7 @@ class CCW_Admin_Page_Customize_Styles {
536
537
<div class="row">
538
<div class="col s6">
539
- <p>Text Color on hover</p>
540
</div>
541
<div class="input-field col s6">
542
<input name="ccw_options_cs[s8_text_color_onhover]" data-default-color="#fff" value="<?php echo esc_attr( $ccw_style_8['s8_text_color_onhover'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
@@ -545,7 +573,7 @@ class CCW_Admin_Page_Customize_Styles {
545
546
<div class="row">
547
<div class="col s6">
548
- <p>Background Color on hover</p>
549
</div>
550
<div class="input-field col s6">
551
<input name="ccw_options_cs[s8_background_color_onhover]" data-default-color="#26a69a" value="<?php echo esc_attr( $ccw_style_8['s8_background_color_onhover'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
@@ -554,7 +582,7 @@ class CCW_Admin_Page_Customize_Styles {
554
555
<div class="row">
556
<div class="col s6">
557
- <p>Icon color on hover</p>
558
</div>
559
<div class="input-field col s6">
560
<input name="ccw_options_cs[s8_icon_color_onhover]" data-default-color="#fff" value="<?php echo esc_attr( $ccw_style_8['s8_icon_color_onhover'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
@@ -563,7 +591,7 @@ class CCW_Admin_Page_Customize_Styles {
563
564
<div class="row">
565
<div class="col s6">
566
- <p>Icon float</p>
567
</div>
568
<div class="input-field col s6">
569
<select name="ccw_options_cs[s8_icon_float]" class="select-2_2">
@@ -571,13 +599,14 @@ class CCW_Admin_Page_Customize_Styles {
571
<option value="right" <?php echo $s8_icon_float == 'right' ? 'SELECTED' : ''; ?> >right</option>
572
<option value="hide" <?php echo $s8_icon_float == 'hide' ? 'SELECTED' : ''; ?> >hide</option>
573
</select>
574
- <label>Icon flow</label>
575
</div>
576
</div>
577
578
<div class="row hide">
579
<div class="col s6">
580
- <p>Icon size</p>
581
</div>
582
<div class="input-field col s4">
583
<input name="ccw_options_cs[s8_1_width]" value="<?php echo esc_attr( $ccw_style_8['s8_1_width'] ) ?>" type="text" class="" >
@@ -593,6 +622,110 @@ class CCW_Admin_Page_Customize_Styles {
593
}
594
595
596
597
598
function ccw_options_sanitize_cs_cb( $input ) {
@@ -603,128 +736,140 @@ class CCW_Admin_Page_Customize_Styles {
603
604
$new_input = array();
605
606
- if( isset( $input['s1_text_color'] ) )
607
- $new_input['s1_text_color'] = sanitize_text_field( $input['s1_text_color'] );
608
609
- if( isset( $input['s1_text_color_onfocus'] ) )
610
- $new_input['s1_text_color_onfocus'] = sanitize_text_field( $input['s1_text_color_onfocus'] );
611
612
- if( isset( $input['s1_border_color'] ) )
613
- $new_input['s1_border_color'] = sanitize_text_field( $input['s1_border_color'] );
614
615
- if( isset( $input['s1_border_color_onfocus'] ) )
616
- $new_input['s1_border_color_onfocus'] = sanitize_text_field( $input['s1_border_color_onfocus'] );
617
618
- if( isset( $input['s1_submit_btn_color'] ) )
619
- $new_input['s1_submit_btn_color'] = sanitize_text_field( $input['s1_submit_btn_color'] );
620
621
- if( isset( $input['s1_submit_btn_text_and_icon_color'] ) )
622
- $new_input['s1_submit_btn_text_and_icon_color'] = sanitize_text_field( $input['s1_submit_btn_text_and_icon_color'] );
623
624
- if( isset( $input['s1_width'] ) )
625
- $new_input['s1_width'] = sanitize_text_field( $input['s1_width'] );
626
627
- if( isset( $input['s2_text_color'] ) )
628
- $new_input['s2_text_color'] = sanitize_text_field( $input['s2_text_color'] );
629
630
- if( isset( $input['s2_text_color_onhover'] ) )
631
- $new_input['s2_text_color_onhover'] = sanitize_text_field( $input['s2_text_color_onhover'] );
632
633
- if( isset( $input['s2_decoration'] ) )
634
- $new_input['s2_decoration'] = sanitize_text_field( $input['s2_decoration'] );
635
636
- if( isset( $input['s2_decoration_onhover'] ) )
637
- $new_input['s2_decoration_onhover'] = sanitize_text_field( $input['s2_decoration_onhover'] );
638
639
- if( isset( $input['s3_icon_size'] ) )
640
- $new_input['s3_icon_size'] = sanitize_text_field( $input['s3_icon_size'] );
641
642
- if( isset( $input['s4_text_color'] ) )
643
- $new_input['s4_text_color'] = sanitize_text_field( $input['s4_text_color'] );
644
645
- if( isset( $input['s4_background_color'] ) )
646
- $new_input['s4_background_color'] = sanitize_text_field( $input['s4_background_color'] );
647
648
- if( isset( $input['s5_color'] ) )
649
- $new_input['s5_color'] = sanitize_text_field( $input['s5_color'] );
650
651
- if( isset( $input['s5_hover_color'] ) )
652
- $new_input['s5_hover_color'] = sanitize_text_field( $input['s5_hover_color'] );
653
654
- if( isset( $input['s5_icon_size'] ) )
655
- $new_input['s5_icon_size'] = sanitize_text_field( $input['s5_icon_size'] );
656
657
- if( isset( $input['s6_color'] ) )
658
- $new_input['s6_color'] = sanitize_text_field( $input['s6_color'] );
659
660
- if( isset( $input['s6_hover_color'] ) )
661
- $new_input['s6_hover_color'] = sanitize_text_field( $input['s6_hover_color'] );
662
663
- if( isset( $input['s6_icon_size'] ) )
664
- $new_input['s6_icon_size'] = sanitize_text_field( $input['s6_icon_size'] );
665
666
- if( isset( $input['s6_circle_background_color'] ) )
667
- $new_input['s6_circle_background_color'] = sanitize_text_field( $input['s6_circle_background_color'] );
668
669
- if( isset( $input['s6_circle_background_hover_color'] ) )
670
- $new_input['s6_circle_background_hover_color'] = sanitize_text_field( $input['s6_circle_background_hover_color'] );
671
672
- if( isset( $input['s6_circle_height'] ) )
673
- $new_input['s6_circle_height'] = sanitize_text_field( $input['s6_circle_height'] );
674
675
- if( isset( $input['s6_circle_width'] ) )
676
- $new_input['s6_circle_width'] = sanitize_text_field( $input['s6_circle_width'] );
677
678
- if( isset( $input['s6_line_height'] ) )
679
- $new_input['s6_line_height'] = sanitize_text_field( $input['s6_line_height'] );
680
681
- if( isset( $input['s7_color'] ) )
682
- $new_input['s7_color'] = sanitize_text_field( $input['s7_color'] );
683
684
- if( isset( $input['s7_hover_color'] ) )
685
- $new_input['s7_hover_color'] = sanitize_text_field( $input['s7_hover_color'] );
686
687
- if( isset( $input['s7_icon_size'] ) )
688
- $new_input['s7_icon_size'] = sanitize_text_field( $input['s7_icon_size'] );
689
690
- if( isset( $input['s7_box_background_color'] ) )
691
- $new_input['s7_box_background_color'] = sanitize_text_field( $input['s7_box_background_color'] );
692
693
- if( isset( $input['s7_box_background_hover_color'] ) )
694
- $new_input['s7_box_background_hover_color'] = sanitize_text_field( $input['s7_box_background_hover_color'] );
695
696
- if( isset( $input['s7_box_height'] ) )
697
- $new_input['s7_box_height'] = sanitize_text_field( $input['s7_box_height'] );
698
699
- if( isset( $input['s7_box_width'] ) )
700
- $new_input['s7_box_width'] = sanitize_text_field( $input['s7_box_width'] );
701
702
- if( isset( $input['s7_line_height'] ) )
703
- $new_input['s7_line_height'] = sanitize_text_field( $input['s7_line_height'] );
704
705
- if( isset( $input['s8_text_color'] ) )
706
- $new_input['s8_text_color'] = sanitize_text_field( $input['s8_text_color'] );
707
708
- if( isset( $input['s8_background_color'] ) )
709
- $new_input['s8_background_color'] = sanitize_text_field( $input['s8_background_color'] );
710
711
- if( isset( $input['s8_icon_color'] ) )
712
- $new_input['s8_icon_color'] = sanitize_text_field( $input['s8_icon_color'] );
713
714
- if( isset( $input['s8_text_color_onhover'] ) )
715
- $new_input['s8_text_color_onhover'] = sanitize_text_field( $input['s8_text_color_onhover'] );
716
717
- if( isset( $input['s8_background_color_onhover'] ) )
718
- $new_input['s8_background_color_onhover'] = sanitize_text_field( $input['s8_background_color_onhover'] );
719
720
- if( isset( $input['s8_icon_color_onhover'] ) )
721
- $new_input['s8_icon_color_onhover'] = sanitize_text_field( $input['s8_icon_color_onhover'] );
722
723
- if( isset( $input['s8_icon_float'] ) )
724
- $new_input['s8_icon_float'] = sanitize_text_field( $input['s8_icon_float'] );
725
726
- if( isset( $input['s8_1_width'] ) )
727
- $new_input['s8_1_width'] = sanitize_text_field( $input['s8_1_width'] );
728
729
return $new_input;
730
}
13
14
if ( ! defined( 'ABSPATH' ) ) exit;
15
16
+ if ( ! class_exists( 'CCW_Admin_Page_Customize_Styles' ) ) :
17
18
class CCW_Admin_Page_Customize_Styles {
19
32
add_settings_field( 'ccw_style_6_cs', 'Style 6', array( $this, 'ccw_style_6_cb' ), 'ccw_options_settings_cs', 'ccw_settings_cs' );
33
add_settings_field( 'ccw_style_7_cs', 'Style 7', array( $this, 'ccw_style_7_cb' ), 'ccw_options_settings_cs', 'ccw_settings_cs' );
34
add_settings_field( 'ccw_style_8_cs', 'Style 8', array( $this, 'ccw_style_8_cb' ), 'ccw_options_settings_cs', 'ccw_settings_cs' );
35
+ add_settings_field( 'ccw_style_9_cs', 'Style 9', array( $this, 'ccw_style_9_cb' ), 'ccw_options_settings_cs', 'ccw_settings_cs' );
36
+
37
+
38
+ add_settings_field( 'ccw_animations', 'Animations', array( $this, 'ccw_animations_cb' ), 'ccw_options_settings_cs', 'ccw_settings_cs' );
39
+
40
}
41
42
45
}
46
47
48
+ // style - 1
49
function ccw_style_1_cb() {
50
$ccw_style_1 = get_option('ccw_options_cs');
51
?>
56
57
<div class="row">
58
<div class="col s6">
59
+ <p><?php _e( 'Color of text' , 'click-to-chat-for-whatsapp' ) ?></p>
60
</div>
61
<div class="input-field col s6">
62
<input name="ccw_options_cs[s1_text_color]" data-default-color="#9e9e9e" value="<?php echo esc_attr( $ccw_style_1['s1_text_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
65
66
<div class="row">
67
<div class="col s6">
68
+ <p><?php _e( 'Color of text when focus on input box' , 'click-to-chat-for-whatsapp' ) ?></p>
69
</div>
70
<div class="input-field col s6">
71
<input name="ccw_options_cs[s1_text_color_onfocus]" data-default-color="#26a69a" value="<?php echo esc_attr( $ccw_style_1['s1_text_color_onfocus'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
74
75
<div class="row">
76
<div class="col s6">
77
+ <p><?php _e( 'Color of input field bottom border' , 'click-to-chat-for-whatsapp' ) ?></p>
78
</div>
79
<div class="input-field col s6">
80
<input name="ccw_options_cs[s1_border_color]" data-default-color="#9e9e9e" value="<?php echo esc_attr( $ccw_style_1['s1_border_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
83
84
<div class="row">
85
<div class="col s6">
86
+ <p><?php _e( 'Color of input field border bottom on focus' , 'click-to-chat-for-whatsapp' ) ?></p>
87
</div>
88
<div class="input-field col s6">
89
<input name="ccw_options_cs[s1_border_color_onfocus]" data-default-color="#26a69a" value="<?php echo esc_attr( $ccw_style_1['s1_border_color_onfocus'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
92
93
<div class="row">
94
<div class="col s6">
95
+ <p><?php _e( 'Color of submit button' , 'click-to-chat-for-whatsapp' ) ?></p>
96
</div>
97
<div class="input-field col s6">
98
<input name="ccw_options_cs[s1_submit_btn_color]" data-default-color="#26a69a" value="<?php echo esc_attr( $ccw_style_1['s1_submit_btn_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
101
102
<div class="row">
103
<div class="col s6">
104
+ <p><?php _e( 'Color of submit button - text, icon' , 'click-to-chat-for-whatsapp' ) ?> </p>
105
</div>
106
<div class="input-field col s6">
107
<input name="ccw_options_cs[s1_submit_btn_text_and_icon_color]" data-default-color="#fff" value="<?php echo esc_attr( $ccw_style_1['s1_submit_btn_text_and_icon_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
110
111
<div class="row">
112
<div class="col s6">
113
+ <p><?php _e( 'Button Text' , 'click-to-chat-for-whatsapp' ) ?></p>
114
</div>
115
<div class="input-field col s4">
116
<input name="ccw_options_cs[s1_btn_text]" value="<?php echo esc_attr( $ccw_style_1['s1_btn_text'] ) ?>" type="text" class="" >
120
<!-- This is hidden row -->
121
<div class="row hide">
122
<div class="col s6">
123
+ <p><?php _e( 'Icon size' , 'click-to-chat-for-whatsapp' ) ?></p>
124
</div>
125
<div class="input-field col s4">
126
<input name="ccw_options_cs[s1_width]" value="<?php echo esc_attr( $ccw_style_1['s1_width'] ) ?>" type="text" class="" >
137
}
138
139
140
+ // style - 2
141
function ccw_style_2_cb() {
142
$ccw_style_2 = get_option('ccw_options_cs');
143
$s2_decoration_value = esc_attr( $ccw_style_2['s2_decoration'] );
150
151
<div class="row">
152
<div class="col s6">
153
+ <p><?php _e( 'Text Color' , 'click-to-chat-for-whatsapp' ) ?></p>
154
</div>
155
<div class="input-field col s6">
156
<input name="ccw_options_cs[s2_text_color]" data-default-color="inherit" value="<?php echo esc_attr( $ccw_style_2['s2_text_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
159
160
<div class="row">
161
<div class="col s6">
162
+ <p><?php _e( 'Text Color When Hover' , 'click-to-chat-for-whatsapp' ) ?> </p>
163
</div>
164
<div class="input-field col s6">
165
<input name="ccw_options_cs[s2_text_color_onhover]" data-default-color="inherit" value="<?php echo esc_attr( $ccw_style_2['s2_text_color_onhover'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
168
169
<div class="row">
170
<div class="col s6">
171
+ <p><?php _e( 'Text Decoration' , 'click-to-chat-for-whatsapp' ) ?> </p>
172
</div>
173
<div class="input-field col s6">
174
<select name="ccw_options_cs[s2_decoration]" class="select-2_2">
179
<option value="initial" <?php echo $s2_decoration_value == 'initial' ? 'SELECTED' : ''; ?> >initial</option>
180
<option value="inherit" <?php echo $s2_decoration_value == 'inherit' ? 'SELECTED' : ''; ?> >inherit</option>
181
</select>
182
+ <label><?php _e( 'Text Decoration' , 'click-to-chat-for-whatsapp' ) ?> </label>
183
</div>
184
</div>
185
186
<div class="row">
187
<div class="col s6">
188
+ <p><?php _e( 'Text Decoration when Hover' , 'click-to-chat-for-whatsapp' ) ?> </p>
189
</div>
190
<div class="input-field col s6">
191
<select name="ccw_options_cs[s2_decoration_onhover]" class="select-2_2">
196
<option value="initial" <?php echo $s2_decoration_onhover == 'initial' ? 'SELECTED' : ''; ?> >initial</option>
197
<option value="inherit" <?php echo $s2_decoration_onhover == 'inherit' ? 'SELECTED' : ''; ?> >inherit</option>
198
</select>
199
+ <label><?php _e( 'Text Decoration on focus' , 'click-to-chat-for-whatsapp' ) ?> </label>
200
</div>
201
</div>
202
208
}
209
210
211
+ // style - 3
212
function ccw_style_3_cb() {
213
$ccw_style_3 = get_option('ccw_options_cs');
214
+ $s3_icon_type = esc_attr( $ccw_style_3['s3_icon_type'] );
215
+
216
?>
217
<ul class="collapsible" data-collapsible="accordion">
218
<li>
221
222
<div class="row">
223
<div class="col s6">
224
+ <p><?php _e( 'Icon size' , 'click-to-chat-for-whatsapp' ) ?></p>
225
</div>
226
<div class="input-field col s4">
227
<input name="ccw_options_cs[s3_icon_size]" value="<?php echo esc_attr( $ccw_style_3['s3_icon_size'] ) ?>" type="text" class="" >
228
</div>
229
</div>
230
+
231
+ <div class="row">
232
+ <div class="col s6">
233
+ <p><?php _e( 'file type' , 'click-to-chat-for-whatsapp' ) ?></p>
234
+ </div>
235
+ <div class="input-field col s6">
236
+ <select name="ccw_options_cs[s3_icon_type]" class="select-2_2">
237
+ <option value="png" <?php echo $s3_icon_type == 'png' ? 'SELECTED' : ''; ?> >png</option>
238
+ <option value="svg" <?php echo $s3_icon_type == 'svg' ? 'SELECTED' : ''; ?> >svg</option>
239
+ </select>
240
+ <label><?php _e( '.svg added in v1.4' , 'click-to-chat-for-whatsapp' ) ?></label>
241
+ </div>
242
+ <p class="description"><?php _e( '.png - since v1.0 - file size ~ 20kb, .svg added in v1.4 - file size ~ 4kb' , 'click-to-chat-for-whatsapp' ) ?></p>
243
+ </div>
244
+
245
</div>
246
</div>
247
</li>
251
}
252
253
254
+ // style - 4
255
function ccw_style_4_cb() {
256
$ccw_style_4 = get_option('ccw_options_cs');
257
?>
263
264
<div class="row">
265
<div class="col s6">
266
+ <p><?php _e( 'Text Color' , 'click-to-chat-for-whatsapp' ) ?> </p>
267
</div>
268
<div class="input-field col s6">
269
<input name="ccw_options_cs[s4_text_color]" data-default-color="rgba(0, 0, 0, 0.6)" value="<?php echo esc_attr( $ccw_style_4['s4_text_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
272
273
<div class="row">
274
<div class="col s6">
275
+ <p><?php _e( 'Background Color' , 'click-to-chat-for-whatsapp' ) ?> </p>
276
</div>
277
<div class="input-field col s6">
278
<input name="ccw_options_cs[s4_background_color]" data-default-color="#e4e4e4" value="<?php echo esc_attr( $ccw_style_4['s4_background_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
288
}
289
290
291
+ // style - 5
292
function ccw_style_5_cb() {
293
$ccw_style_5 = get_option('ccw_options_cs');
294
?>
299
300
<div class="row">
301
<div class="col s6">
302
+ <p><?php _e( 'Color of icon' , 'click-to-chat-for-whatsapp' ) ?> </p>
303
</div>
304
<div class="input-field col s6">
305
<!-- style="height: 1.375rem;" or 22px -->
309
310
<div class="row">
311
<div class="col s6">
312
+ <p><?php _e( 'Color of icon - when hover' , 'click-to-chat-for-whatsapp' ) ?> </p>
313
</div>
314
<div class="input-field col s6">
315
<input name="ccw_options_cs[s5_hover_color]" data-default-color="#ddd" value="<?php echo esc_attr( $ccw_style_5['s5_hover_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
318
319
<div class="row">
320
<div class="col s6">
321
+ <p><?php _e( 'Size of icon' , 'click-to-chat-for-whatsapp' ) ?> </p>
322
</div>
323
<div class="input-field col s4">
324
<input name="ccw_options_cs[s5_icon_size]" value="<?php echo esc_attr( $ccw_style_5['s5_icon_size'] ) ?>" type="text" class="" >
333
}
334
335
336
+ // style - 6
337
function ccw_style_6_cb() {
338
$ccw_style_6 = get_option('ccw_options_cs');
339
?>
344
345
<div class="row">
346
<div class="col s6">
347
+ <p><?php _e( 'Color of icon' , 'click-to-chat-for-whatsapp' ) ?></p>
348
</div>
349
<div class="input-field col s6">
350
<!-- style="height: 1.375rem;" or 22px -->
354
355
<div class="row">
356
<div class="col s6">
357
+ <p><?php _e( 'Color of icon - when hover' , 'click-to-chat-for-whatsapp' ) ?> </p>
358
</div>
359
<div class="input-field col s6">
360
<input name="ccw_options_cs[s6_hover_color]" data-default-color="#000" value="<?php echo esc_attr( $ccw_style_6['s6_hover_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
363
364
<div class="row">
365
<div class="col s6">
366
+ <p><?php _e( 'Size of icon' , 'click-to-chat-for-whatsapp' ) ?></p>
367
</div>
368
<div class="input-field col s4">
369
<input name="ccw_options_cs[s6_icon_size]" value="<?php echo esc_attr( $ccw_style_6['s6_icon_size'] ) ?>" type="text" class="" >
372
373
<div class="row">
374
<div class="col s6">
375
+ <p><?php _e( 'Circle color' , 'click-to-chat-for-whatsapp' ) ?> </p>
376
</div>
377
<div class="input-field col s6">
378
<input name="ccw_options_cs[s6_circle_background_color]" data-default-color="#ffa500" value="<?php echo esc_attr( $ccw_style_6['s6_circle_background_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
381
382
<div class="row">
383
<div class="col s6">
384
+ <p><?php _e( 'Circle color - when hover' , 'click-to-chat-for-whatsapp' ) ?> </p>
385
</div>
386
<div class="input-field col s6">
387
<input name="ccw_options_cs[s6_circle_background_hover_color]" data-default-color="#ffa500" value="<?php echo esc_attr( $ccw_style_6['s6_circle_background_hover_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
391
392
<div class="row">
393
<div class="col s6">
394
+ <p><?php _e( 'Circle Height' , 'click-to-chat-for-whatsapp' ) ?></p>
395
</div>
396
<div class="input-field col s4">
397
<input name="ccw_options_cs[s6_circle_height]" value="<?php echo esc_attr( $ccw_style_6['s6_circle_height'] ) ?>" type="text" class="" >
400
401
<div class="row">
402
<div class="col s6">
403
+ <p><?php _e( 'Circle Width' , 'click-to-chat-for-whatsapp' ) ?></p>
404
</div>
405
<div class="input-field col s4">
406
<input name="ccw_options_cs[s6_circle_width]" value="<?php echo esc_attr( $ccw_style_6['s6_circle_width'] ) ?>" type="text" class="" >
409
410
<div class="row">
411
<div class="col s6">
412
+ <p><?php _e( 'Circle Line Height' , 'click-to-chat-for-whatsapp' ) ?></p>
413
</div>
414
<div class="input-field col s4">
415
<input name="ccw_options_cs[s6_line_height]" value="<?php echo esc_attr( $ccw_style_6['s6_line_height'] ) ?>" type="text" class="" >
416
</div>
417
</div>
418
419
+ <p class="description"><?php _e( 'add height, width, line-height same values - if feels like icon is not center then adjust \'Line Height\' to make icon looks center of the circle' , 'click-to-chat-for-whatsapp' ) ?></p>
420
421
</div>
422
</div>
428
429
430
431
+ // style - 7
432
function ccw_style_7_cb() {
433
$ccw_style_7 = get_option('ccw_options_cs');
434
?>
440
441
<div class="row">
442
<div class="col s6">
443
+ <p><?php _e( 'Color of icon' , 'click-to-chat-for-whatsapp' ) ?></p>
444
</div>
445
<div class="input-field col s6">
446
<!-- style="height: 1.375rem;" or 22px -->
450
451
<div class="row">
452
<div class="col s6">
453
+ <p><?php _e( 'Color of icon - when hover' , 'click-to-chat-for-whatsapp' ) ?> </p>
454
</div>
455
<div class="input-field col s6">
456
<input name="ccw_options_cs[s7_hover_color]" data-default-color="#000" value="<?php echo esc_attr( $ccw_style_7['s7_hover_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
459
460
<div class="row">
461
<div class="col s6">
462
+ <p><?php _e( 'Size of icon' , 'click-to-chat-for-whatsapp' ) ?></p>
463
</div>
464
<div class="input-field col s4">
465
<input name="ccw_options_cs[s7_icon_size]" value="<?php echo esc_attr( $ccw_style_7['s7_icon_size'] ) ?>" type="text" class="" >
468
469
<div class="row">
470
<div class="col s6">
471
+ <p><?php _e( 'box color' , 'click-to-chat-for-whatsapp' ) ?> </p>
472
</div>
473
<div class="input-field col s6">
474
<input name="ccw_options_cs[s7_box_background_color]" data-default-color="#ffa500" value="<?php echo esc_attr( $ccw_style_7['s7_box_background_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
477
478
<div class="row">
479
<div class="col s6">
480
+ <p><?php _e( 'box color - when hover' , 'click-to-chat-for-whatsapp' ) ?> </p>
481
</div>
482
<div class="input-field col s6">
483
<input name="ccw_options_cs[s7_box_background_hover_color]" data-default-color="#ffa500" value="<?php echo esc_attr( $ccw_style_7['s7_box_background_hover_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
487
488
<div class="row">
489
<div class="col s6">
490
+ <p><?php _e( 'box Height' , 'click-to-chat-for-whatsapp' ) ?></p>
491
</div>
492
<div class="input-field col s4">
493
<input name="ccw_options_cs[s7_box_height]" value="<?php echo esc_attr( $ccw_style_7['s7_box_height'] ) ?>" type="text" class="" >
496
497
<div class="row">
498
<div class="col s6">
499
+ <p><?php _e( 'box Width' , 'click-to-chat-for-whatsapp' ) ?></p>
500
</div>
501
<div class="input-field col s4">
502
<input name="ccw_options_cs[s7_box_width]" value="<?php echo esc_attr( $ccw_style_7['s7_box_width'] ) ?>" type="text" class="" >
505
506
<div class="row">
507
<div class="col s6">
508
+ <p><?php _e( 'box Line Height' , 'click-to-chat-for-whatsapp' ) ?></p>
509
</div>
510
<div class="input-field col s4">
511
<input name="ccw_options_cs[s7_line_height]" value="<?php echo esc_attr( $ccw_style_7['s7_line_height'] ) ?>" type="text" class="" >
512
</div>
513
</div>
514
515
+ <p class="description"><?php _e( 'add height, width, line-height same values - if feels like icon is not center then adjust \'Line Height\' to make icon looks center of the box' , 'click-to-chat-for-whatsapp' ) ?></p>
516
517
518
</div>
524
}
525
526
527
+ // style - 8
528
function ccw_style_8_cb() {
529
$ccw_style_8 = get_option('ccw_options_cs');
530
$s8_icon_float = esc_attr( $ccw_style_8['s8_icon_float'] )
537
538
<div class="row">
539
<div class="col s6">
540
+ <p><?php _e( 'Text Color' , 'click-to-chat-for-whatsapp' ) ?></p>
541
</div>
542
<div class="input-field col s6">
543
<input name="ccw_options_cs[s8_text_color]" data-default-color="#fff" value="<?php echo esc_attr( $ccw_style_8['s8_text_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
546
547
<div class="row">
548
<div class="col s6">
549
+ <p><?php _e( 'Background Color' , 'click-to-chat-for-whatsapp' ) ?></p>
550
</div>
551
<div class="input-field col s6">
552
<input name="ccw_options_cs[s8_background_color]" data-default-color="#26a69a" value="<?php echo esc_attr( $ccw_style_8['s8_background_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
555
556
<div class="row">
557
<div class="col s6">
558
+ <p><?php _e( 'Icon color' , 'click-to-chat-for-whatsapp' ) ?></p>
559
</div>
560
<div class="input-field col s6">
561
<input name="ccw_options_cs[s8_icon_color]" data-default-color="#fff" value="<?php echo esc_attr( $ccw_style_8['s8_icon_color'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
564
565
<div class="row">
566
<div class="col s6">
567
+ <p><?php _e( 'Text Color on hover' , 'click-to-chat-for-whatsapp' ) ?></p>
568
</div>
569
<div class="input-field col s6">
570
<input name="ccw_options_cs[s8_text_color_onhover]" data-default-color="#fff" value="<?php echo esc_attr( $ccw_style_8['s8_text_color_onhover'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
573
574
<div class="row">
575
<div class="col s6">
576
+ <p><?php _e( 'Background Color on hover' , 'click-to-chat-for-whatsapp' ) ?></p>
577
</div>
578
<div class="input-field col s6">
579
<input name="ccw_options_cs[s8_background_color_onhover]" data-default-color="#26a69a" value="<?php echo esc_attr( $ccw_style_8['s8_background_color_onhover'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
582
583
<div class="row">
584
<div class="col s6">
585
+ <p><?php _e( 'Icon color on hover' , 'click-to-chat-for-whatsapp' ) ?></p>
586
</div>
587
<div class="input-field col s6">
588
<input name="ccw_options_cs[s8_icon_color_onhover]" data-default-color="#fff" value="<?php echo esc_attr( $ccw_style_8['s8_icon_color_onhover'] ) ?>" type="text" class="color-wp" style="height: 1.375rem;" >
591
592
<div class="row">
593
<div class="col s6">
594
+ <p><?php _e( 'Icon float' , 'click-to-chat-for-whatsapp' ) ?></p>
595
</div>
596
<div class="input-field col s6">
597
<select name="ccw_options_cs[s8_icon_float]" class="select-2_2">
599
<option value="right" <?php echo $s8_icon_float == 'right' ? 'SELECTED' : ''; ?> >right</option>
600
<option value="hide" <?php echo $s8_icon_float == 'hide' ? 'SELECTED' : ''; ?> >hide</option>
601
</select>
602
+ <label><?php _e( 'Icon flow' , 'click-to-chat-for-whatsapp' ) ?></label>
603
</div>
604
</div>
605
606
+ <!-- hidden value - as in array empty values are not updating .. -->
607
<div class="row hide">
608
<div class="col s6">
609
+ <p><?php _e( 'Icon size' , 'click-to-chat-for-whatsapp' ) ?></p>
610
</div>
611
<div class="input-field col s4">
612
<input name="ccw_options_cs[s8_1_width]" value="<?php echo esc_attr( $ccw_style_8['s8_1_width'] ) ?>" type="text" class="" >
622
}
623
624
625
+ // style - 9
626
+ function ccw_style_9_cb() {
627
+ $ccw_style_9 = get_option('ccw_options_cs');
628
+ ?>
629
+ <ul class="collapsible" data-collapsible="accordion">
630
+ <li>
631
+ <div class="collapsible-header">Style 9</div>
632
+ <div class="collapsible-body">
633
+
634
+ <div class="row">
635
+ <div class="col s6">
636
+ <p><?php _e( 'Icon size' , 'click-to-chat-for-whatsapp' ) ?></p>
637
+ </div>
638
+ <div class="input-field col s4">
639
+ <input name="ccw_options_cs[s9_icon_size]" value="<?php echo esc_attr( $ccw_style_9['s9_icon_size'] ) ?>" type="text" class="" >
640
+ </div>
641
+ </div>
642
+
643
+ </div>
644
+ </div>
645
+ </li>
646
+ </ul>
647
+
648
+ <?php
649
+ }
650
+
651
+
652
+
653
+ // Animations
654
+ function ccw_animations_cb() {
655
+ $ccw_animations = get_option('ccw_options_cs');
656
+ // $an_enable = esc_attr( $ccw_animations['an_enable'] );
657
+ $an_on_load = esc_attr( $ccw_animations['an_on_load'] );
658
+ $an_on_hover = esc_attr( $ccw_animations['an_on_hover'] );
659
+
660
+ ?>
661
+ <ul class="collapsible" data-collapsible="accordion">
662
+ <li>
663
+ <div class="collapsible-header">Animations - alpha release </div>
664
+ <div class="collapsible-body">
665
+
666
+ <p class="description"> <?php _e( 'alpha stage, things may change, may not work as like this in next releases, </br> may need to reconfigure also ..' , 'click-to-chat-for-whatsapp' ) ?> </p>
667
+ <p class="description"> <?php _e( 'Animations for floating styles ( 3, 4, 5, 6, 7, 8, 9 ) ' , 'click-to-chat-for-whatsapp' ) ?> - <a target="_blank" href="https://holithemes.com/whatsapp-chat/animations/"><?php _e( 'more info' , 'click-to-chat-for-whatsapp' ) ?></a> </p>
668
+ <br><br>
669
+
670
+ <!-- Enable Animations -->
671
+ <!-- <div class="row">
672
+ <div class="input-field col s12">
673
+ <select name="ccw_options_cs[an_enable]" class="select-1">
674
+ <option value="1"><?php _e( 'No' , 'click-to-chat-for-whatsapp' ) ?></option>
675
+ <option value="yes" <?php echo esc_attr( $ccw_animations['an_enable'] ) == 'yes' ? 'SELECTED' : ''; ?> ><?php _e( 'Yes' , 'click-to-chat-for-whatsapp' ) ?></option>
676
+ </select>
677
+ <label><?php _e( 'Enable Animations' , 'click-to-chat-for-whatsapp' ) ?></label>
678
+ <p class="description"> <?php _e( 'Yes - to enable animations ' , 'click-to-chat-for-whatsapp' ) ?> </p>
679
+ <p class="description"> <?php _e( 'dont enable, if your are not using Animations' , 'click-to-chat-for-whatsapp' ) ?> </p>
680
+ </div>
681
+ </div> -->
682
+
683
+ <!-- animation on load -->
684
+ <div class="row">
685
+ <div class="col s6">
686
+ <p><?php _e( 'Animation on Page load' , 'click-to-chat-for-whatsapp' ) ?></p>
687
+ </div>
688
+ <div class="input-field col s6">
689
+ <select name="ccw_options_cs[an_on_load]" class="select-2_2">
690
+ <?php
691
+ $an_list = HT_CCW_Admin_lists::$animations_list;
692
+
693
+ foreach ( $an_list as $value ) {
694
+ ?>
695
+ <option value="<?php echo $value ?>" <?php echo $an_on_load == $value ? 'SELECTED' : ''; ?> ><?php echo $value ?></option>
696
+ <?php
697
+ }
698
+
699
+ ?>
700
+ </select>
701
+ <label><?php _e( 'animation on page load' , 'click-to-chat-for-whatsapp' ) ?></label>
702
+ </div>
703
+ </div>
704
+
705
+ <!-- animation on hover -->
706
+ <div class="row">
707
+ <div class="col s6">
708
+ <p><?php _e( 'Animation on hover' , 'click-to-chat-for-whatsapp' ) ?></p>
709
+ </div>
710
+ <div class="input-field col s6">
711
+ <select name="ccw_options_cs[an_on_hover]" class="select-2_2">
712
+ <option value="ccw-an" <?php echo $an_on_hover == 'ccw-an' ? 'SELECTED' : ''; ?> >Yes</option>
713
+ <option value="ccw-no-hover-an" <?php echo $an_on_hover == 'ccw-no-hover-an' ? 'SELECTED' : ''; ?> >No</option>
714
+ </select>
715
+ <label><?php _e( 'Animation on mouse hover' , 'click-to-chat-for-whatsapp' ) ?></label>
716
+ </div>
717
+ <p class="description"><?php _e( 'If Yes, Animation on hover - works based on - Animation on page load - value' , 'click-to-chat-for-whatsapp' ) ?></p>
718
+ </div>
719
+
720
+
721
+ </div>
722
+ </div>
723
+ </li>
724
+ </ul>
725
+
726
+ <?php
727
+ }
728
+
729
730
731
function ccw_options_sanitize_cs_cb( $input ) {
736
737
$new_input = array();
738
739
740
+ foreach ($input as $key => $value) {
741
+ if( isset( $input[$key] ) ) {
742
+ $new_input[$key] = sanitize_text_field( $input[$key] );
743
+ }
744
+ }
745
+
746
747
748
+ // if( isset( $input['s1_text_color'] ) )
749
+ // $new_input['s1_text_color'] = sanitize_text_field( $input['s1_text_color'] );
750
751
+ // if( isset( $input['s1_text_color_onfocus'] ) )
752
+ // $new_input['s1_text_color_onfocus'] = sanitize_text_field( $input['s1_text_color_onfocus'] );
753
754
+ // if( isset( $input['s1_border_color'] ) )
755
+ // $new_input['s1_border_color'] = sanitize_text_field( $input['s1_border_color'] );
756
757
+ // if( isset( $input['s1_border_color_onfocus'] ) )
758
+ // $new_input['s1_border_color_onfocus'] = sanitize_text_field( $input['s1_border_color_onfocus'] );
759
760
+ // if( isset( $input['s1_submit_btn_color'] ) )
761
+ // $new_input['s1_submit_btn_color'] = sanitize_text_field( $input['s1_submit_btn_color'] );
762
+
763
+ // if( isset( $input['s1_submit_btn_text_and_icon_color'] ) )
764
+ // $new_input['s1_submit_btn_text_and_icon_color'] = sanitize_text_field( $input['s1_submit_btn_text_and_icon_color'] );
765
+
766
+ // if( isset( $input['s1_width'] ) )
767
+ // $new_input['s1_width'] = sanitize_text_field( $input['s1_width'] );
768
+
769
+ // if( isset( $input['s2_text_color'] ) )
770
+ // $new_input['s2_text_color'] = sanitize_text_field( $input['s2_text_color'] );
771
772
+ // if( isset( $input['s2_text_color_onhover'] ) )
773
+ // $new_input['s2_text_color_onhover'] = sanitize_text_field( $input['s2_text_color_onhover'] );
774
775
+ // if( isset( $input['s2_decoration'] ) )
776
+ // $new_input['s2_decoration'] = sanitize_text_field( $input['s2_decoration'] );
777
778
+ // if( isset( $input['s2_decoration_onhover'] ) )
779
+ // $new_input['s2_decoration_onhover'] = sanitize_text_field( $input['s2_decoration_onhover'] );
780
781
+ // if( isset( $input['s3_icon_size'] ) )
782
+ // $new_input['s3_icon_size'] = sanitize_text_field( $input['s3_icon_size'] );
783
784
+ // if( isset( $input['s4_text_color'] ) )
785
+ // $new_input['s4_text_color'] = sanitize_text_field( $input['s4_text_color'] );
786
787
+ // if( isset( $input['s4_background_color'] ) )
788
+ // $new_input['s4_background_color'] = sanitize_text_field( $input['s4_background_color'] );
789
790
+ // if( isset( $input['s5_color'] ) )
791
+ // $new_input['s5_color'] = sanitize_text_field( $input['s5_color'] );
792
793
+ // if( isset( $input['s5_hover_color'] ) )
794
+ // $new_input['s5_hover_color'] = sanitize_text_field( $input['s5_hover_color'] );
795
796
+ // if( isset( $input['s5_icon_size'] ) )
797
+ // $new_input['s5_icon_size'] = sanitize_text_field( $input['s5_icon_size'] );
798
799
+ // if( isset( $input['s6_color'] ) )
800
+ // $new_input['s6_color'] = sanitize_text_field( $input['s6_color'] );
801
802
+ // if( isset( $input['s6_hover_color'] ) )
803
+ // $new_input['s6_hover_color'] = sanitize_text_field( $input['s6_hover_color'] );
804
805
+ // if( isset( $input['s6_icon_size'] ) )
806
+ // $new_input['s6_icon_size'] = sanitize_text_field( $input['s6_icon_size'] );
807
808
+ // if( isset( $input['s6_circle_background_color'] ) )
809
+ // $new_input['s6_circle_background_color'] = sanitize_text_field( $input['s6_circle_background_color'] );
810
811
+ // if( isset( $input['s6_circle_background_hover_color'] ) )
812
+ // $new_input['s6_circle_background_hover_color'] = sanitize_text_field( $input['s6_circle_background_hover_color'] );
813
814
+ // if( isset( $input['s6_circle_height'] ) )
815
+ // $new_input['s6_circle_height'] = sanitize_text_field( $input['s6_circle_height'] );
816
817
+ // if( isset( $input['s6_circle_width'] ) )
818
+ // $new_input['s6_circle_width'] = sanitize_text_field( $input['s6_circle_width'] );
819
820
+ // if( isset( $input['s6_line_height'] ) )
821
+ // $new_input['s6_line_height'] = sanitize_text_field( $input['s6_line_height'] );
822
823
+ // if( isset( $input['s7_color'] ) )
824
+ // $new_input['s7_color'] = sanitize_text_field( $input['s7_color'] );
825
826
+ // if( isset( $input['s7_hover_color'] ) )
827
+ // $new_input['s7_hover_color'] = sanitize_text_field( $input['s7_hover_color'] );
828
829
+ // if( isset( $input['s7_icon_size'] ) )
830
+ // $new_input['s7_icon_size'] = sanitize_text_field( $input['s7_icon_size'] );
831
832
+ // if( isset( $input['s7_box_background_color'] ) )
833
+ // $new_input['s7_box_background_color'] = sanitize_text_field( $input['s7_box_background_color'] );
834
835
+ // if( isset( $input['s7_box_background_hover_color'] ) )
836
+ // $new_input['s7_box_background_hover_color'] = sanitize_text_field( $input['s7_box_background_hover_color'] );
837
838
+ // if( isset( $input['s7_box_height'] ) )
839
+ // $new_input['s7_box_height'] = sanitize_text_field( $input['s7_box_height'] );
840
841
+ // if( isset( $input['s7_box_width'] ) )
842
+ // $new_input['s7_box_width'] = sanitize_text_field( $input['s7_box_width'] );
843
844
+ // if( isset( $input['s7_line_height'] ) )
845
+ // $new_input['s7_line_height'] = sanitize_text_field( $input['s7_line_height'] );
846
847
+ // if( isset( $input['s8_text_color'] ) )
848
+ // $new_input['s8_text_color'] = sanitize_text_field( $input['s8_text_color'] );
849
850
+ // if( isset( $input['s8_background_color'] ) )
851
+ // $new_input['s8_background_color'] = sanitize_text_field( $input['s8_background_color'] );
852
853
+ // if( isset( $input['s8_icon_color'] ) )
854
+ // $new_input['s8_icon_color'] = sanitize_text_field( $input['s8_icon_color'] );
855
856
+ // if( isset( $input['s8_text_color_onhover'] ) )
857
+ // $new_input['s8_text_color_onhover'] = sanitize_text_field( $input['s8_text_color_onhover'] );
858
859
+ // if( isset( $input['s8_background_color_onhover'] ) )
860
+ // $new_input['s8_background_color_onhover'] = sanitize_text_field( $input['s8_background_color_onhover'] );
861
862
+ // if( isset( $input['s8_icon_color_onhover'] ) )
863
+ // $new_input['s8_icon_color_onhover'] = sanitize_text_field( $input['s8_icon_color_onhover'] );
864
865
+ // if( isset( $input['s8_icon_float'] ) )
866
+ // $new_input['s8_icon_float'] = sanitize_text_field( $input['s8_icon_float'] );
867
+
868
+ // if( isset( $input['s8_1_width'] ) )
869
+ // $new_input['s8_1_width'] = sanitize_text_field( $input['s8_1_width'] );
870
871
+ // if( isset( $input['s9_icon_size'] ) )
872
+ // $new_input['s9_icon_size'] = sanitize_text_field( $input['s9_icon_size'] );
873
874
return $new_input;
875
}
admin/class-ccw-admin-page.php CHANGED
@@ -10,7 +10,7 @@
10
11
if ( ! defined( 'ABSPATH' ) ) exit;
12
13
- if ( !class_exists( 'CCW_Admin_Page' ) ) :
14
15
class CCW_Admin_Page {
16
@@ -20,23 +20,20 @@ class CCW_Admin_Page {
20
21
add_settings_section( 'ccw_settings', '', array( $this, 'ccw_settings_section' ), 'ccw_options_settings' );
22
23
- add_settings_field( 'ccw_enable', 'Enable Floating Styles', array( $this, 'ccw_enable_cb' ), 'ccw_options_settings', 'ccw_settings' );
24
- add_settings_field( 'ccw_enable_sc', 'Enable ShortCodes', array( $this, 'ccw_enable_sc_cb' ), 'ccw_options_settings', 'ccw_settings' );
25
- add_settings_field( 'ccw_return_type', 'Return Type', array( $this, 'ccw_return_type_cb' ), 'ccw_options_settings', 'ccw_settings' );
26
- add_settings_field( 'ccw_number', 'WhatsApp Number', array( $this, 'ccw_number_input_cb' ), 'ccw_options_settings', 'ccw_settings' );
27
-
28
- add_settings_field( 'ccw_pre_text', 'Initial Message', array( $this, 'ccw_prefix_message_cb' ), 'ccw_options_settings', 'ccw_settings' );
29
-
30
-
31
- add_settings_field( 'ccw_group_id', 'Group Id', array( $this, 'ccw_group_id_cb' ), 'ccw_options_settings', 'ccw_settings' );
32
- add_settings_field( 'ccw_style', 'Style for Desktops', array( $this, 'ccw_style_cb' ), 'ccw_options_settings', 'ccw_settings' );
33
- add_settings_field( 'ccw_style_mobile', 'Style for Mobile Devices', array( $this, 'ccw_style_mobile_cb' ), 'ccw_options_settings', 'ccw_settings' );
34
- add_settings_field( 'ccw_position', 'Position to Place', array( $this, 'ccw_position_input_cb' ), 'ccw_options_settings', 'ccw_settings' );
35
- add_settings_field( 'ccw_placeholder', 'Text to Display', array( $this, 'ccw_input_placeholder_cb' ), 'ccw_options_settings', 'ccw_settings' );
36
- add_settings_field( 'ccw_checkbox', 'Hide Based on post type', array( $this, 'ccw_checkbox_cb' ), 'ccw_options_settings', 'ccw_settings' );
37
- add_settings_field( 'ccw_list_id_tohide', 'Posts, Pages Id\'s to Hide', array( $this, 'ccw_list_id_tohide_cb' ), 'ccw_options_settings', 'ccw_settings' );
38
- add_settings_field( 'ccw_list_cat_tohide', 'Categorys to Hide', array( $this, 'ccw_list_cat_tohide_cb' ), 'ccw_options_settings', 'ccw_settings' );
39
- add_settings_field( 'ccw_custom_shortcode', 'Shortcode name', array( $this, 'ccw_custom_shortcode_cb' ), 'ccw_options_settings', 'ccw_settings' );
40
41
}
42
@@ -54,10 +51,10 @@ class CCW_Admin_Page {
54
<div class="row">
55
<div class="input-field col s12">
56
<select name="ccw_options[enable]" class="select-1">
57
- <option value="1">No</option>
58
- <option value="2" <?php echo esc_attr( $ccw_enable['enable'] ) == 2 ? 'SELECTED' : ''; ?> >Yes</option>
59
</select>
60
- <label>enable</label>
61
</div>
62
</div>
63
<?php
@@ -70,11 +67,11 @@ class CCW_Admin_Page {
70
<div class="row">
71
<div class="input-field col s12 select-margin">
72
<select name="ccw_options[enable_sc]" class="select-1">
73
- <option value="1">No</option>
74
- <option value="2" <?php echo esc_attr( $ccw_enable_sc['enable_sc'] ) == 2 ? 'SELECTED' : ''; ?> >Yes</option>
75
</select>
76
- <label>enable ShortCodes</label>
77
- <p class="description"> If Selected - No - then Hides Shortcodes and its syntax - <a target="_blank" href="https://holithemes.com/whatsapp-chat/enable-disable-styles/">more info</a> </p>
78
</div>
79
</div>
80
<?php
@@ -87,11 +84,11 @@ class CCW_Admin_Page {
87
<div class="row">
88
<div class="input-field col s12 select-margin">
89
<select name="ccw_options[return_type]" class="select-1">
90
- <option value="chat" <?php echo esc_attr( $ccw_return_type['return_type'] ) == 'chat' ? 'SELECTED' : ''; ?> >Chat</option>
91
- <option value="group_chat" <?php echo esc_attr( $ccw_return_type['return_type'] ) == 'group_chat' ? 'SELECTED' : ''; ?> >Group chat - Invite</option>
92
</select>
93
- <label>Default return type - Chat or Group Chat Invite</label>
94
- <p class="description">Default return type for Floating Style, shortcodes. But for shortcodes can change using shortcode attributes - <a target="_blank" href="https://holithemes.com/whatsapp-chat/return-type-chat-or-group-chat/">more info</a> </p>
95
</div>
96
</div>
97
<?php
@@ -114,11 +111,12 @@ class CCW_Admin_Page {
114
<option value="6" <?php echo $style_value == 6 ? 'SELECTED' : ''; ?> >Style-6</option>
115
<option value="7" <?php echo $style_value == 7 ? 'SELECTED' : ''; ?> >Style-7</option>
116
<option value="8" <?php echo $style_value == 8 ? 'SELECTED' : ''; ?> >Style-8</option>
117
- <option value="0" <?php echo $style_value == 0 ? 'SELECTED' : ''; ?> >Hide on Desktop Devices</option>
118
</select>
119
- <label>Select Style for Destops</label>
120
- <p class="description"> - <a target="_blank" href="https://holithemes.com/whatsapp-chat/select-styles/">List of syles with images</a> </p>
121
- <p class="description"> - <a target="_blank" href="<?php echo admin_url( 'admin.php?page=ccw-edit-styles' ); ?>">Customize Styles</a> </p>
122
123
</div>
124
</div>
@@ -141,9 +139,10 @@ class CCW_Admin_Page {
141
<option value="6" <?php echo $style_mobile_value == 6 ? 'SELECTED' : ''; ?> >Style-6</option>
142
<option value="7" <?php echo $style_mobile_value == 7 ? 'SELECTED' : ''; ?> >Style-7</option>
143
<option value="8" <?php echo $style_mobile_value == 8 ? 'SELECTED' : ''; ?> >Style-8</option>
144
- <option value="0" <?php echo $style_mobile_value == 0 ? 'SELECTED' : ''; ?> >Hide on Mobile Devices</option>
145
</select>
146
- <label>Select Style for Mobile Devices</label>
147
</div>
148
</div>
149
<?php
@@ -156,8 +155,8 @@ class CCW_Admin_Page {
156
<div class="row">
157
<div class="input-field col s12">
158
<input name="ccw_options[number]" value="<?php echo esc_attr( $ccw_number['number'] ) ?>" id="whatsapp_number" type="text" class="validate input-margin">
159
- <label for="whatsapp_number">Enter whatsapp number </label>
160
- <p class="description">Enter whatsapp number with country code ( e.g. 916123456789 ) please dont include +, ( here in e.g. 91 is country code 6123456789 is mobile number - <a target="_blank" href="https://holithemes.com/whatsapp-chat/whatsapp-number/">more info</a> ) </p>
161
</div>
162
</div>
163
<?php
@@ -165,15 +164,14 @@ class CCW_Admin_Page {
165
166
167
// prefix - message
168
- // #todo - link..
169
function ccw_prefix_message_cb() {
170
$ccw_initial = get_option('ccw_options');
171
?>
172
<div class="row">
173
<div class="input-field col s12">
174
<input name="ccw_options[initial]" value="<?php echo esc_attr( $ccw_initial['initial'] ) ?>" id="whatsapp_initial" type="text" class="validate input-margin">
175
- <label for="whatsapp_initial">Initial Message</label>
176
- <p class="description">Initial message ( pre-filled ) <a target="_blank" href="https://holithemes.com/whatsapp-chat/pre-filled-message/">more info</a> </p>
177
</div>
178
</div>
179
<?php
@@ -187,8 +185,8 @@ class CCW_Admin_Page {
187
<div class="row">
188
<div class="input-field col s12">
189
<input name="ccw_options[group_id]" value="<?php echo esc_attr( $ccw_group_id['group_id'] ) ?>" id="whatsapp_group_id" type="text" class="validate input-margin">
190
- <label for="whatsapp_group_id">whatsapp group ID Extenstion </label>
191
- <p class="description">Enter whatsapp Group Id - <a target="_blank" href="https://holithemes.com/whatsapp-chat/find-whatsapp-group-id/">more info</a> ) </p>
192
</div>
193
</div>
194
<?php
@@ -202,35 +200,35 @@ class CCW_Admin_Page {
202
<div class="row">
203
<div class="input-field col s12">
204
<select name="ccw_options[position]" class="select">
205
- <option value="1" <?php echo $ccw_position_value == 1 ? 'SELECTED' : ''; ?> >bottom right</option>
206
- <option value="2" <?php echo $ccw_position_value == 2 ? 'SELECTED' : ''; ?> >bottom left</option>
207
- <option value="3" <?php echo $ccw_position_value == 3 ? 'SELECTED' : ''; ?> >top left</option>
208
- <option value="4" <?php echo $ccw_position_value == 4 ? 'SELECTED' : ''; ?> >top right</option>
209
</select>
210
- <label>Fixed position to place</label>
211
- <p class="description"> e.g. 10px - please add css units as suffix, e.g. 10px, 10%, 10rem, 10em .. <a target="_blank" href="https://holithemes.com/whatsapp-chat/position-to-place/">more info</a> </p>
212
</div>
213
</div>
214
215
<div class="row display-none position position-1 bottom-right">
216
<div class="input-field col s6">
217
<input name="ccw_options[position-1_bottom]" value="<?php echo esc_attr( $ccw_position['position-1_bottom'] ) ?>" id="position_bottom" type="text" class="validate">
218
- <label for="position_bottom">position_bottom: </label>
219
</div>
220
<div class="input-field col s6">
221
<input name="ccw_options[position-1_right]" value="<?php echo esc_attr( $ccw_position['position-1_right'] ) ?>" id="position_right" type="text" class="validate">
222
- <label for="position_right">position_right: </label>
223
</div>
224
</div>
225
226
<div class="row display-none position position-2 bottom-left">
227
<div class="input-field col s6">
228
<input name="ccw_options[position-2_bottom]" value="<?php echo esc_attr( $ccw_position['position-2_bottom'] ) ?>" id="position_bottom" type="text" class="validate">
229
- <label for="position_bottom">position_bottom: </label>
230
</div>
231
<div class="input-field col s6">
232
<input name="ccw_options[position-2_left]" value="<?php echo esc_attr( $ccw_position['position-2_left'] ) ?>" id="position_left" type="text" class="validate">
233
- <label for="position_left">position_left: </label>
234
</div>
235
</div>
236
@@ -239,22 +237,22 @@ class CCW_Admin_Page {
239
<div class="row display-none position position-3 top-left">
240
<div class="input-field col s6">
241
<input name="ccw_options[position-3_top]" value="<?php echo esc_attr( $ccw_position['position-3_top'] ) ?>" id="position_top" type="text" class="validate">
242
- <label for="position_top">position_top: </label>
243
</div>
244
<div class="input-field col s6">
245
<input name="ccw_options[position-3_left]" value="<?php echo esc_attr( $ccw_position['position-3_left'] ) ?>" id="position_left" type="text" class="validate">
246
- <label for="position_left">position_left: </label>
247
</div>
248
</div>
249
250
<div class="row display-none position position-4 top-right">
251
<div class="input-field col s6">
252
<input name="ccw_options[position-4_top]" value="<?php echo esc_attr( $ccw_position['position-4_top'] ) ?>" id="position_top" type="text" class="validate">
253
- <label for="position_top">position_top: </label>
254
</div>
255
<div class="input-field col s6">
256
<input name="ccw_options[position-4_right]" value="<?php echo esc_attr( $ccw_position['position-4_right'] ) ?>" id="position_right" type="text" class="validate">
257
- <label for="position_right">position_right: </label>
258
</div>
259
</div>
260
@@ -268,8 +266,8 @@ class CCW_Admin_Page {
268
<div class="row">
269
<div class="input-field col s12">
270
<input name="ccw_options[input_placeholder]" value="<?php echo esc_attr( $ccw_placeholder['input_placeholder'] ) ?>" id="input_placeholder" type="text" class="validate input-margin">
271
- <label for="input_placeholder">placeholder value</label>
272
- <p class="description"> - <a target="_blank" href="https://holithemes.com/whatsapp-chat/text-to-display/">more info</a> </p>
273
</div>
274
</div>
275
<?php
@@ -285,14 +283,14 @@ class CCW_Admin_Page {
285
?>
286
<p>
287
<input name="ccw_options[hideon_posts]" type="checkbox" value="1" <?php checked( $ccw_checkbox['hideon_posts'], 1 ); ?> id="filled-in-box1" />
288
- <label for="filled-in-box1">Hide on - Posts</label>
289
</p>
290
<?php
291
} else {
292
?>
293
<p>
294
<input name="ccw_options[hideon_posts]" type="checkbox" value="1" id="filled-in-box1" />
295
- <label for="filled-in-box1">Hide on - Posts</label>
296
</p>
297
<?php
298
}
@@ -303,14 +301,14 @@ class CCW_Admin_Page {
303
?>
304
<p>
305
<input name="ccw_options[hideon_page]" type="checkbox" value="1" <?php checked( $ccw_checkbox['hideon_page'], 1 ); ?> id="filled-in-box2" />
306
- <label for="filled-in-box2">Hide on - Pages</label>
307
</p>
308
<?php
309
} else {
310
?>
311
<p>
312
<input name="ccw_options[hideon_page]" type="checkbox" value="1" id="filled-in-box2" />
313
- <label for="filled-in-box2">Hide on - Pages</label>
314
</p>
315
<?php
316
}
@@ -321,14 +319,14 @@ class CCW_Admin_Page {
321
?>
322
<p>
323
<input name="ccw_options[hideon_homepage]" type="checkbox" value="1" <?php checked( $ccw_checkbox['hideon_homepage'], 1 ); ?> id="filled-in-box3" />
324
- <label for="filled-in-box3">Hide on - Home Page</label>
325
</p>
326
<?php
327
} else {
328
?>
329
<p>
330
<input name="ccw_options[hideon_homepage]" type="checkbox" value="1" id="filled-in-box3" />
331
- <label for="filled-in-box3">Hide on - Home Page</label>
332
</p>
333
<?php
334
}
@@ -341,14 +339,14 @@ class CCW_Admin_Page {
341
?>
342
<p>
343
<input name="ccw_options[hideon_frontpage]" type="checkbox" value="1" <?php checked( $ccw_checkbox['hideon_frontpage'], 1 ); ?> id="filled-in-box4" />
344
- <label for="filled-in-box4">Hide on - Front Page</label>
345
</p>
346
<?php
347
} else {
348
?>
349
<p>
350
<input name="ccw_options[hideon_frontpage]" type="checkbox" value="1" id="filled-in-box4" />
351
- <label for="filled-in-box4">Hide on - Front Page</label>
352
</p>
353
<?php
354
}
@@ -358,14 +356,14 @@ class CCW_Admin_Page {
358
?>
359
<p>
360
<input name="ccw_options[hideon_category]" type="checkbox" value="1" <?php checked( $ccw_checkbox['hideon_category'], 1 ); ?> id="filled-in-box5" />
361
- <label for="filled-in-box5">Hide on - Category</label>
362
</p>
363
<?php
364
} else {
365
?>
366
<p>
367
<input name="ccw_options[hideon_category]" type="checkbox" value="1" id="filled-in-box5" />
368
- <label for="filled-in-box5">Hide on - Category</label>
369
</p>
370
<?php
371
}
@@ -375,14 +373,14 @@ class CCW_Admin_Page {
375
?>
376
<p>
377
<input name="ccw_options[hideon_archive]" type="checkbox" value="1" <?php checked( $ccw_checkbox['hideon_archive'], 1 ); ?> id="filled-in-box6" />
378
- <label for="filled-in-box6">Hide on - Archive</label>
379
</p>
380
<?php
381
} else {
382
?>
383
<p>
384
<input name="ccw_options[hideon_archive]" type="checkbox" value="1" id="filled-in-box6" />
385
- <label for="filled-in-box6">Hide on - Archive</label>
386
</p>
387
<?php
388
}
@@ -393,19 +391,19 @@ class CCW_Admin_Page {
393
?>
394
<p>
395
<input name="ccw_options[hideon_404]" type="checkbox" value="1" <?php checked( $ccw_checkbox['hideon_404'], 1 ); ?> id="filled-in-box7" />
396
- <label for="filled-in-box7">Hide on - 404 Page</label>
397
</p>
398
<?php
399
} else {
400
?>
401
<p>
402
<input name="ccw_options[hideon_404]" type="checkbox" value="1" id="filled-in-box7" />
403
- <label for="filled-in-box7">Hide on - 404 Page</label>
404
</p>
405
<?php
406
}
407
?>
408
- <p class="description">Check to hide - Hide - Styles - based on type of the page <a target="_blank" href="https://holithemes.com/whatsapp-chat/show-hide-styles-based-on-type-of-the-page/">more info</a> </p>
409
<?php
410
}
411
@@ -417,7 +415,7 @@ class CCW_Admin_Page {
417
<div class="input-field col s12">
418
<input name="ccw_options[list_hideon_pages]" value="<?php echo esc_attr( $ccw_list_id_tohide['list_hideon_pages'] ) ?>" id="ccw_list_id_tohide" type="text" class="validate input-margin">
419
<label for="ccw_list_id_tohide">Id's list to Hide - add ',' after each id </label>
420
- <p class="description"> Add Post, Pages, Media - ID's to hide, can add multiple id's separate with comma ( , ) - <a target="_blank" href="https://holithemes.com/whatsapp-chat/show-hide-styles-based-on-id/">more info</a> </p>
421
</div>
422
</div>
423
<?php
@@ -430,8 +428,8 @@ class CCW_Admin_Page {
430
<div class="row">
431
<div class="input-field col s12">
432
<input name="ccw_options[list_hideon_cat]" value="<?php echo esc_attr( $ccw_list_cat_tohide['list_hideon_cat'] ) ?>" id="ccw_list_cat_tohide" type="text" class="validate input-margin">
433
- <label for="ccw_list_cat_tohide">Category name's to Hide - add ',' after each category name </label>
434
- <p class="description"> Category name's to hide, can add multiple Categories separate with comma ( , ) - <a target="_blank" href="https://holithemes.com/whatsapp-chat/hide-styles-based-on-category/">more info</a> </p>
435
</div>
436
</div>
437
<?php
@@ -444,15 +442,16 @@ class CCW_Admin_Page {
444
<div class="row">
445
<div class="input-field col s12">
446
<input name="ccw_options[shortcode]" value="<?php echo esc_attr( $ccw_shortcode['shortcode'] ) ?>" id="shortcode" type="text" class="validate input-margin">
447
- <label for="shortcode">shortcode name</label>
448
<?php
449
$shorcode_list = '';
450
foreach ($GLOBALS['shortcode_tags'] AS $key => $value) {
451
$shorcode_list .= $key . ', ';
452
}
453
?>
454
- <p class="description"> Default values is 'chat', can customize shortcode name - <a target="_blank" href="https://holithemes.com/whatsapp-chat/change-shortcode-name/">more info</a> </p>
455
- <p class="description"> please dont add this already existing shorcode names - <?php echo $shorcode_list ?> </p>
456
</div>
457
</div>
458
<?php
@@ -467,91 +466,100 @@ class CCW_Admin_Page {
467
468
$new_input = array();
469
470
- if( isset( $input['enable'] ) )
471
- $new_input['enable'] = sanitize_text_field( $input['enable'] );
472
473
- if( isset( $input['enable_sc'] ) )
474
- $new_input['enable_sc'] = sanitize_text_field( $input['enable_sc'] );
475
476
- if( isset( $input['number'] ) )
477
- $new_input['number'] = sanitize_text_field( $input['number'] );
478
479
- if( isset( $input['initial'] ) )
480
- $new_input['initial'] = sanitize_text_field( $input['initial'] );
481
482
- if( isset( $input['input_placeholder'] ) )
483
- $new_input['input_placeholder'] = sanitize_text_field( $input['input_placeholder'] );
484
485
- if( isset( $input['position'] ) )
486
- $new_input['position'] = sanitize_text_field( $input['position'] );
487
488
- if( isset( $input['style'] ) )
489
- $new_input['style'] = sanitize_text_field( $input['style'] );
490
491
- if( isset( $input['stylemobile'] ) )
492
- $new_input['stylemobile'] = sanitize_text_field( $input['stylemobile'] );
493
494
- if( isset( $input['position-1_bottom'] ) )
495
- $new_input['position-1_bottom'] = sanitize_text_field( $input['position-1_bottom'] );
496
497
- if( isset( $input['position-1_right'] ) )
498
- $new_input['position-1_right'] = sanitize_text_field( $input['position-1_right'] );
499
500
- if( isset( $input['position-2_bottom'] ) )
501
- $new_input['position-2_bottom'] = sanitize_text_field( $input['position-2_bottom'] );
502
503
- if( isset( $input['position-2_left'] ) )
504
- $new_input['position-2_left'] = sanitize_text_field( $input['position-2_left'] );
505
506
- if( isset( $input['position-3_top'] ) )
507
- $new_input['position-3_top'] = sanitize_text_field( $input['position-3_top'] );
508
509
- if( isset( $input['position-3_left'] ) )
510
- $new_input['position-3_left'] = sanitize_text_field( $input['position-3_left'] );
511
512
- if( isset( $input['position-4_top'] ) )
513
- $new_input['position-4_top'] = sanitize_text_field( $input['position-4_top'] );
514
515
- if( isset( $input['position-4_right'] ) )
516
- $new_input['position-4_right'] = sanitize_text_field( $input['position-4_right'] );
517
518
- if( isset( $input['hideon_posts'] ) )
519
- $new_input['hideon_posts'] = sanitize_text_field( $input['hideon_posts'] );
520
521
- if( isset( $input['hideon_page'] ) )
522
- $new_input['hideon_page'] = sanitize_text_field( $input['hideon_page'] );
523
524
- if( isset( $input['hideon_homepage'] ) )
525
- $new_input['hideon_homepage'] = sanitize_text_field( $input['hideon_homepage'] );
526
527
- if( isset( $input['hideon_frontpage'] ) )
528
- $new_input['hideon_frontpage'] = sanitize_text_field( $input['hideon_frontpage'] );
529
530
- if( isset( $input['hideon_category'] ) )
531
- $new_input['hideon_category'] = sanitize_text_field( $input['hideon_category'] );
532
533
- if( isset( $input['hideon_archive'] ) )
534
- $new_input['hideon_archive'] = sanitize_text_field( $input['hideon_archive'] );
535
536
- if( isset( $input['hideon_404'] ) )
537
- $new_input['hideon_404'] = sanitize_text_field( $input['hideon_404'] );
538
539
- if( isset( $input['list_hideon_pages'] ) )
540
- $new_input['list_hideon_pages'] = sanitize_text_field( $input['list_hideon_pages'] );
541
542
- if( isset( $input['list_hideon_cat'] ) )
543
- $new_input['list_hideon_cat'] = sanitize_text_field( $input['list_hideon_cat'] );
544
545
- if( isset( $input['shortcode'] ) )
546
- $new_input['shortcode'] = sanitize_text_field( $input['shortcode'] );
547
548
- if( isset( $input['return_type'] ) )
549
- $new_input['return_type'] = sanitize_text_field( $input['return_type'] );
550
551
- if( isset( $input['group_id'] ) )
552
- $new_input['group_id'] = sanitize_text_field( $input['group_id'] );
553
554
- // $new_input = sanitize_text_field($input);
555
return $new_input;
556
}
557
10
11
if ( ! defined( 'ABSPATH' ) ) exit;
12
13
+ if ( ! class_exists( 'CCW_Admin_Page' ) ) :
14
15
class CCW_Admin_Page {
16
20
21
add_settings_section( 'ccw_settings', '', array( $this, 'ccw_settings_section' ), 'ccw_options_settings' );
22
23
+ add_settings_field( 'ccw_enable', __( 'Enable Floating Styles' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_enable_cb' ), 'ccw_options_settings', 'ccw_settings' );
24
+ add_settings_field( 'ccw_enable_sc', __( 'Enable ShortCodes' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_enable_sc_cb' ), 'ccw_options_settings', 'ccw_settings' );
25
+ add_settings_field( 'ccw_return_type', __( 'Return Type' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_return_type_cb' ), 'ccw_options_settings', 'ccw_settings' );
26
+ add_settings_field( 'ccw_number', __( 'WhatsApp Number' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_number_input_cb' ), 'ccw_options_settings', 'ccw_settings' );
27
+ add_settings_field( 'ccw_pre_text', __( 'Initial Message' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_prefix_message_cb' ), 'ccw_options_settings', 'ccw_settings' );
28
+ add_settings_field( 'ccw_group_id', __( 'Group Id' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_group_id_cb' ), 'ccw_options_settings', 'ccw_settings' );
29
+ add_settings_field( 'ccw_style', __( 'Style for Desktops' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_style_cb' ), 'ccw_options_settings', 'ccw_settings' );
30
+ add_settings_field( 'ccw_style_mobile', __( 'Style for Mobile Devices' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_style_mobile_cb' ), 'ccw_options_settings', 'ccw_settings' );
31
+ add_settings_field( 'ccw_position', __( 'Position to Place' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_position_input_cb' ), 'ccw_options_settings', 'ccw_settings' );
32
+ add_settings_field( 'ccw_placeholder', __( 'Text to Display' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_input_placeholder_cb' ), 'ccw_options_settings', 'ccw_settings' );
33
+ add_settings_field( 'ccw_checkbox', __( 'Hide Based on post type' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_checkbox_cb' ), 'ccw_options_settings', 'ccw_settings' );
34
+ add_settings_field( 'ccw_list_id_tohide', __( 'Posts, Pages Id\'s to Hide' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_list_id_tohide_cb' ), 'ccw_options_settings', 'ccw_settings' );
35
+ add_settings_field( 'ccw_list_cat_tohide', __( 'Categorys to Hide' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_list_cat_tohide_cb' ), 'ccw_options_settings', 'ccw_settings' );
36
+ add_settings_field( 'ccw_custom_shortcode', __( 'Shortcode name' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_custom_shortcode_cb' ), 'ccw_options_settings', 'ccw_settings' );
37
38
}
39
51
<div class="row">
52
<div class="input-field col s12">
53
<select name="ccw_options[enable]" class="select-1">
54
+ <option value="1"><?php _e( 'No' , 'click-to-chat-for-whatsapp' ) ?></option>
55
+ <option value="2" <?php echo esc_attr( $ccw_enable['enable'] ) == 2 ? 'SELECTED' : ''; ?> ><?php _e( 'Yes' , 'click-to-chat-for-whatsapp' ) ?></option>
56
</select>
57
+ <label><?php _e( 'enable' , 'click-to-chat-for-whatsapp' ) ?></label>
58
</div>
59
</div>
60
<?php
67
<div class="row">
68
<div class="input-field col s12 select-margin">
69
<select name="ccw_options[enable_sc]" class="select-1">
70
+ <option value="1"><?php _e( 'No' , 'click-to-chat-for-whatsapp' ) ?></option>
71
+ <option value="2" <?php echo esc_attr( $ccw_enable_sc['enable_sc'] ) == 2 ? 'SELECTED' : ''; ?> ><?php _e( 'Yes' , 'click-to-chat-for-whatsapp' ) ?></option>
72
</select>
73
+ <label><?php _e( 'enable ShortCodes' , 'click-to-chat-for-whatsapp' ) ?></label>
74
+ <p class="description"> <?php _e( 'If Selected - No - then Hides Shortcodes and its syntax' , 'click-to-chat-for-whatsapp' ) ?> - <a target="_blank" href="https://holithemes.com/whatsapp-chat/enable-disable-styles/"><?php _e( 'more info' , 'click-to-chat-for-whatsapp' ) ?></a> </p>
75
</div>
76
</div>
77
<?php
84
<div class="row">
85
<div class="input-field col s12 select-margin">
86
<select name="ccw_options[return_type]" class="select-1">
87
+ <option value="chat" <?php echo esc_attr( $ccw_return_type['return_type'] ) == 'chat' ? 'SELECTED' : ''; ?> ><?php _e( 'Chat' , 'click-to-chat-for-whatsapp' ) ?></option>
88
+ <option value="group_chat" <?php echo esc_attr( $ccw_return_type['return_type'] ) == 'group_chat' ? 'SELECTED' : ''; ?> ><?php _e( 'Group chat - Invite' , 'click-to-chat-for-whatsapp' ) ?></option>
89
</select>
90
+ <label><?php _e( 'Default return type - Chat or Group Chat Invite' , 'click-to-chat-for-whatsapp' ) ?></label>
91
+ <p class="description"><?php _e( 'Default return type for Floating Style, shortcodes. But for shortcodes can change using shortcode attributes' , 'click-to-chat-for-whatsapp' ) ?> - <a target="_blank" href="https://holithemes.com/whatsapp-chat/return-type-chat-or-group-chat/"><?php _e( 'more info' , 'click-to-chat-for-whatsapp' ) ?></a> </p>
92
</div>
93
</div>
94
<?php
111
<option value="6" <?php echo $style_value == 6 ? 'SELECTED' : ''; ?> >Style-6</option>
112
<option value="7" <?php echo $style_value == 7 ? 'SELECTED' : ''; ?> >Style-7</option>
113
<option value="8" <?php echo $style_value == 8 ? 'SELECTED' : ''; ?> >Style-8</option>
114
+ <option value="9" <?php echo $style_value == 9 ? 'SELECTED' : ''; ?> >Style-9</option>
115
+ <option value="0" <?php echo $style_value == 0 ? 'SELECTED' : ''; ?> ><?php _e( 'Hide on Desktop Devices' , 'click-to-chat-for-whatsapp' ) ?></option>
116
</select>
117
+ <label><?php _e( 'Select Style for Destops' , 'click-to-chat-for-whatsapp' ) ?></label>
118
+ <p class="description"> - <a target="_blank" href="https://holithemes.com/whatsapp-chat/select-styles/"><?php _e( 'List of syles with images' , 'click-to-chat-for-whatsapp' ) ?></a> </p>
119
+ <p class="description"> - <a target="_blank" href="<?php echo admin_url( 'admin.php?page=ccw-edit-styles' ); ?>"><?php _e( 'Customize Styles' , 'click-to-chat-for-whatsapp' ) ?></a> </p>
120
121
</div>
122
</div>
139
<option value="6" <?php echo $style_mobile_value == 6 ? 'SELECTED' : ''; ?> >Style-6</option>
140
<option value="7" <?php echo $style_mobile_value == 7 ? 'SELECTED' : ''; ?> >Style-7</option>
141
<option value="8" <?php echo $style_mobile_value == 8 ? 'SELECTED' : ''; ?> >Style-8</option>
142
+ <option value="9" <?php echo $style_mobile_value == 9 ? 'SELECTED' : ''; ?> >Style-9</option>
143
+ <option value="0" <?php echo $style_mobile_value == 0 ? 'SELECTED' : ''; ?> ><?php _e( 'Hide on Mobile Devices' , 'click-to-chat-for-whatsapp' ) ?></option>
144
</select>
145
+ <label><?php _e( 'Select Style for Mobile Devices' , 'click-to-chat-for-whatsapp' ) ?></label>
146
</div>
147
</div>
148
<?php
155
<div class="row">
156
<div class="input-field col s12">
157
<input name="ccw_options[number]" value="<?php echo esc_attr( $ccw_number['number'] ) ?>" id="whatsapp_number" type="text" class="validate input-margin">
158
+ <label for="whatsapp_number"><?php _e( 'Enter whatsapp number' , 'click-to-chat-for-whatsapp' ) ?> </label>
159
+ <p class="description"><?php _e( 'Enter whatsapp number with country code ( e.g. 916123456789 ) please dont include +, ( here in e.g. 91 is country code 6123456789 is mobile number' , 'click-to-chat-for-whatsapp' ) ?> - <a target="_blank" href="https://holithemes.com/whatsapp-chat/whatsapp-number/"><?php _e( 'more info' , 'click-to-chat-for-whatsapp' ) ?></a> ) </p>
160
</div>
161
</div>
162
<?php
164
165
166
// prefix - message
167
function ccw_prefix_message_cb() {
168
$ccw_initial = get_option('ccw_options');
169
?>
170
<div class="row">
171
<div class="input-field col s12">
172
<input name="ccw_options[initial]" value="<?php echo esc_attr( $ccw_initial['initial'] ) ?>" id="whatsapp_initial" type="text" class="validate input-margin">
173
+ <label for="whatsapp_initial"><?php _e( 'Initial Message' , 'click-to-chat-for-whatsapp' ) ?></label>
174
+ <p class="description"><?php _e( 'Initial message ( pre-filled )' , 'click-to-chat-for-whatsapp' ) ?> <a target="_blank" href="https://holithemes.com/whatsapp-chat/pre-filled-message/"><?php _e( 'more info' , 'click-to-chat-for-whatsapp' ) ?></a> </p>
175
</div>
176
</div>
177
<?php
185
<div class="row">
186
<div class="input-field col s12">
187
<input name="ccw_options[group_id]" value="<?php echo esc_attr( $ccw_group_id['group_id'] ) ?>" id="whatsapp_group_id" type="text" class="validate input-margin">
188
+ <label for="whatsapp_group_id"><?php _e( 'whatsapp group ID Extenstion' , 'click-to-chat-for-whatsapp' ) ?> </label>
189
+ <p class="description"><?php _e( 'Enter whatsapp Group Id' , 'click-to-chat-for-whatsapp' ) ?> - <a target="_blank" href="https://holithemes.com/whatsapp-chat/find-whatsapp-group-id/"><?php _e( 'more info' , 'click-to-chat-for-whatsapp' ) ?></a> ) </p>
190
</div>
191
</div>
192
<?php
200
<div class="row">
201
<div class="input-field col s12">
202
<select name="ccw_options[position]" class="select">
203
+ <option value="1" <?php echo $ccw_position_value == 1 ? 'SELECTED' : ''; ?> ><?php _e( 'bottom right' , 'click-to-chat-for-whatsapp' ) ?></option>
204
+ <option value="2" <?php echo $ccw_position_value == 2 ? 'SELECTED' : ''; ?> ><?php _e( 'bottom left' , 'click-to-chat-for-whatsapp' ) ?></option>
205
+ <option value="3" <?php echo $ccw_position_value == 3 ? 'SELECTED' : ''; ?> ><?php _e( 'top left' , 'click-to-chat-for-whatsapp' ) ?></option>
206
+ <option value="4" <?php echo $ccw_position_value == 4 ? 'SELECTED' : ''; ?> ><?php _e( 'top right' , 'click-to-chat-for-whatsapp' ) ?></option>
207
</select>
208
+ <label><?php _e( 'Fixed position to place' , 'click-to-chat-for-whatsapp' ) ?></label>
209
+ <p class="description"><?php _e( ' e.g. 10px - please add css units as suffix, e.g. 10px, 10%, 10rem, 10em' , 'click-to-chat-for-whatsapp' ) ?> .. <a target="_blank" href="https://holithemes.com/whatsapp-chat/position-to-place/"><?php _e( 'more info' , 'click-to-chat-for-whatsapp' ) ?></a> </p>
210
</div>
211
</div>
212
213
<div class="row display-none position position-1 bottom-right">
214
<div class="input-field col s6">
215
<input name="ccw_options[position-1_bottom]" value="<?php echo esc_attr( $ccw_position['position-1_bottom'] ) ?>" id="position_bottom" type="text" class="validate">
216
+ <label for="position_bottom"><?php _e( 'position_bottom' , 'click-to-chat-for-whatsapp' ) ?>: </label>
217
</div>
218
<div class="input-field col s6">
219
<input name="ccw_options[position-1_right]" value="<?php echo esc_attr( $ccw_position['position-1_right'] ) ?>" id="position_right" type="text" class="validate">
220
+ <label for="position_right"><?php _e( 'position_right' , 'click-to-chat-for-whatsapp' ) ?>: </label>
221
</div>
222
</div>
223
224
<div class="row display-none position position-2 bottom-left">
225
<div class="input-field col s6">
226
<input name="ccw_options[position-2_bottom]" value="<?php echo esc_attr( $ccw_position['position-2_bottom'] ) ?>" id="position_bottom" type="text" class="validate">
227
+ <label for="position_bottom"><?php _e( 'position_bottom' , 'click-to-chat-for-whatsapp' ) ?>: </label>
228
</div>
229
<div class="input-field col s6">
230
<input name="ccw_options[position-2_left]" value="<?php echo esc_attr( $ccw_position['position-2_left'] ) ?>" id="position_left" type="text" class="validate">
231
+ <label for="position_left"><?php _e( 'position_left' , 'click-to-chat-for-whatsapp' ) ?>: </label>
232
</div>
233
</div>
234
237
<div class="row display-none position position-3 top-left">
238
<div class="input-field col s6">
239
<input name="ccw_options[position-3_top]" value="<?php echo esc_attr( $ccw_position['position-3_top'] ) ?>" id="position_top" type="text" class="validate">
240
+ <label for="position_top"><?php _e( 'position_top' , 'click-to-chat-for-whatsapp' ) ?>: </label>
241
</div>
242
<div class="input-field col s6">
243
<input name="ccw_options[position-3_left]" value="<?php echo esc_attr( $ccw_position['position-3_left'] ) ?>" id="position_left" type="text" class="validate">
244
+ <label for="position_left"><?php _e( 'position_left' , 'click-to-chat-for-whatsapp' ) ?>: </label>
245
</div>
246
</div>
247
248
<div class="row display-none position position-4 top-right">
249
<div class="input-field col s6">
250
<input name="ccw_options[position-4_top]" value="<?php echo esc_attr( $ccw_position['position-4_top'] ) ?>" id="position_top" type="text" class="validate">
251
+ <label for="position_top"><?php _e( 'position_top' , 'click-to-chat-for-whatsapp' ) ?>: </label>
252
</div>
253
<div class="input-field col s6">
254
<input name="ccw_options[position-4_right]" value="<?php echo esc_attr( $ccw_position['position-4_right'] ) ?>" id="position_right" type="text" class="validate">
255
+ <label for="position_right"><?php _e( 'position_right' , 'click-to-chat-for-whatsapp' ) ?>: </label>
256
</div>
257
</div>
258
266
<div class="row">
267
<div class="input-field col s12">
268
<input name="ccw_options[input_placeholder]" value="<?php echo esc_attr( $ccw_placeholder['input_placeholder'] ) ?>" id="input_placeholder" type="text" class="validate input-margin">
269
+ <label for="input_placeholder"><?php _e( 'placeholder value' , 'click-to-chat-for-whatsapp' ) ?></label>
270
+ <p class="description"> - <a target="_blank" href="https://holithemes.com/whatsapp-chat/text-to-display/"><?php _e( 'more info' , 'click-to-chat-for-whatsapp' ) ?></a> </p>
271
</div>
272
</div>
273
<?php
283
?>
284
<p>
285
<input name="ccw_options[hideon_posts]" type="checkbox" value="1" <?php checked( $ccw_checkbox['hideon_posts'], 1 ); ?> id="filled-in-box1" />
286
+ <label for="filled-in-box1"><?php _e( 'Hide on - Posts' , 'click-to-chat-for-whatsapp' ) ?></label>
287
</p>
288
<?php
289
} else {
290
?>
291
<p>
292
<input name="ccw_options[hideon_posts]" type="checkbox" value="1" id="filled-in-box1" />
293
+ <label for="filled-in-box1"><?php _e( 'Hide on - Posts' , 'click-to-chat-for-whatsapp' ) ?></label>
294
</p>
295
<?php
296
}
301
?>
302
<p>
303
<input name="ccw_options[hideon_page]" type="checkbox" value="1" <?php checked( $ccw_checkbox['hideon_page'], 1 ); ?> id="filled-in-box2" />
304
+ <label for="filled-in-box2"><?php _e( 'Hide on - Pages' , 'click-to-chat-for-whatsapp' ) ?></label>
305
</p>
306
<?php
307
} else {
308
?>
309
<p>
310
<input name="ccw_options[hideon_page]" type="checkbox" value="1" id="filled-in-box2" />
311
+ <label for="filled-in-box2"><?php _e( 'Hide on - Pages' , 'click-to-chat-for-whatsapp' ) ?></label>
312
</p>
313
<?php
314
}
319
?>
320
<p>
321
<input name="ccw_options[hideon_homepage]" type="checkbox" value="1" <?php checked( $ccw_checkbox['hideon_homepage'], 1 ); ?> id="filled-in-box3" />
322
+ <label for="filled-in-box3"><?php _e( 'Hide on - Home Page' , 'click-to-chat-for-whatsapp' ) ?> </label>
323
</p>
324
<?php
325
} else {
326
?>
327
<p>
328
<input name="ccw_options[hideon_homepage]" type="checkbox" value="1" id="filled-in-box3" />
329
+ <label for="filled-in-box3"><?php _e( 'Hide on - Home Page' , 'click-to-chat-for-whatsapp' ) ?> </label>
330
</p>
331
<?php
332
}
339
?>
340
<p>
341
<input name="ccw_options[hideon_frontpage]" type="checkbox" value="1" <?php checked( $ccw_checkbox['hideon_frontpage'], 1 ); ?> id="filled-in-box4" />
342
+ <label for="filled-in-box4"><?php _e( 'Hide on - Front Page' , 'click-to-chat-for-whatsapp' ) ?> </label>
343
</p>
344
<?php
345
} else {
346
?>
347
<p>
348
<input name="ccw_options[hideon_frontpage]" type="checkbox" value="1" id="filled-in-box4" />
349
+ <label for="filled-in-box4"><?php _e( 'Hide on - Front Page' , 'click-to-chat-for-whatsapp' ) ?> </label>
350
</p>
351
<?php
352
}
356
?>
357
<p>
358
<input name="ccw_options[hideon_category]" type="checkbox" value="1" <?php checked( $ccw_checkbox['hideon_category'], 1 ); ?> id="filled-in-box5" />
359
+ <label for="filled-in-box5"><?php _e( 'Hide on - Category' , 'click-to-chat-for-whatsapp' ) ?></label>
360
</p>
361
<?php
362
} else {
363
?>
364
<p>
365
<input name="ccw_options[hideon_category]" type="checkbox" value="1" id="filled-in-box5" />
366
+ <label for="filled-in-box5"><?php _e( 'Hide on - Category' , 'click-to-chat-for-whatsapp' ) ?></label>
367
</p>
368
<?php
369
}
373
?>
374
<p>
375
<input name="ccw_options[hideon_archive]" type="checkbox" value="1" <?php checked( $ccw_checkbox['hideon_archive'], 1 ); ?> id="filled-in-box6" />
376
+ <label for="filled-in-box6"><?php _e( 'Hide on - Archive' , 'click-to-chat-for-whatsapp' ) ?></label>
377
</p>
378
<?php
379
} else {
380
?>
381
<p>
382
<input name="ccw_options[hideon_archive]" type="checkbox" value="1" id="filled-in-box6" />
383
+ <label for="filled-in-box6"><?php _e( 'Hide on - Archive' , 'click-to-chat-for-whatsapp' ) ?></label>
384
</p>
385
<?php
386
}
391
?>
392
<p>
393
<input name="ccw_options[hideon_404]" type="checkbox" value="1" <?php checked( $ccw_checkbox['hideon_404'], 1 ); ?> id="filled-in-box7" />
394
+ <label for="filled-in-box7"><?php _e( 'Hide on - 404 Page' , 'click-to-chat-for-whatsapp' ) ?></label>
395
</p>
396
<?php
397
} else {
398
?>
399
<p>
400
<input name="ccw_options[hideon_404]" type="checkbox" value="1" id="filled-in-box7" />
401
+ <label for="filled-in-box7"><?php _e( 'Hide on - 404 Page' , 'click-to-chat-for-whatsapp' ) ?></label>
402
</p>
403
<?php
404
}
405
?>
406
+ <p class="description"><?php _e( 'Check to hide - Hide - Styles - based on type of the page' , 'click-to-chat-for-whatsapp' ) ?> <a target="_blank" href="https://holithemes.com/whatsapp-chat/show-hide-styles-based-on-type-of-the-page/"><?php _e( 'more info' , 'click-to-chat-for-whatsapp' ) ?></a> </p>
407
<?php
408
}
409
415
<div class="input-field col s12">
416
<input name="ccw_options[list_hideon_pages]" value="<?php echo esc_attr( $ccw_list_id_tohide['list_hideon_pages'] ) ?>" id="ccw_list_id_tohide" type="text" class="validate input-margin">
417
<label for="ccw_list_id_tohide">Id's list to Hide - add ',' after each id </label>
418
+ <p class="description"> Add Post, Pages, Media - ID's to hide, can add multiple id's separate with comma ( , ) - <a target="_blank" href="https://holithemes.com/whatsapp-chat/show-hide-styles-based-on-id/"><?php _e( 'more info' , 'click-to-chat-for-whatsapp' ) ?></a> </p>
419
</div>
420
</div>
421
<?php
428
<div class="row">
429
<div class="input-field col s12">
430
<input name="ccw_options[list_hideon_cat]" value="<?php echo esc_attr( $ccw_list_cat_tohide['list_hideon_cat'] ) ?>" id="ccw_list_cat_tohide" type="text" class="validate input-margin">
431
+ <label for="ccw_list_cat_tohide"><?php _e( 'Category name\'s to Hide - add \',\' after each category name' , 'click-to-chat-for-whatsapp' ) ?> </label>
432
+ <p class="description"><?php _e( 'Category name\'s to hide, can add multiple Categories separate with comma ( , )' , 'click-to-chat-for-whatsapp' ) ?> - <a target="_blank" href="https://holithemes.com/whatsapp-chat/hide-styles-based-on-category/"><?php _e( 'more info' , 'click-to-chat-for-whatsapp' ) ?></a> </p>
433
</div>
434
</div>
435
<?php
442
<div class="row">
443
<div class="input-field col s12">
444
<input name="ccw_options[shortcode]" value="<?php echo esc_attr( $ccw_shortcode['shortcode'] ) ?>" id="shortcode" type="text" class="validate input-margin">
445
+ <label for="shortcode"><?php _e( 'shortcode name' , 'click-to-chat-for-whatsapp' ) ?></label>
446
<?php
447
$shorcode_list = '';
448
+ // global used here is defined by wordpress
449
foreach ($GLOBALS['shortcode_tags'] AS $key => $value) {
450
$shorcode_list .= $key . ', ';
451
}
452
?>
453
+ <p class="description"> <?php _e( 'Default values is \'chat\', can customize shortcode name' , 'click-to-chat-for-whatsapp' ) ?> - <a target="_blank" href="https://holithemes.com/whatsapp-chat/change-shortcode-name/"><?php _e( 'more info' , 'click-to-chat-for-whatsapp' ) ?></a> </p>
454
+ <p class="description"> <?php _e( 'please dont add this already existing shorcode names' , 'click-to-chat-for-whatsapp' ) ?> - <?php echo $shorcode_list ?> </p>
455
</div>
456
</div>
457
<?php
466
467
$new_input = array();
468
469
+ foreach ($input as $key => $value) {
470
+ if( isset( $input[$key] ) ) {
471
+ $new_input[$key] = sanitize_text_field( $input[$key] );
472
+ }
473
+ }
474
+
475
+ // if( isset( $input['enable'] ) )
476
+ // $new_input['enable'] = sanitize_text_field( $input['enable'] );
477
478
+ // if( isset( $input['enable_sc'] ) )
479
+ // $new_input['enable_sc'] = sanitize_text_field( $input['enable_sc'] );
480
481
+ // if( isset( $input['number'] ) )
482
+ // $new_input['number'] = sanitize_text_field( $input['number'] );
483
484
+ // if( isset( $input['initial'] ) )
485
+ // $new_input['initial'] = sanitize_text_field( $input['initial'] );
486
487
+ // if( isset( $input['input_placeholder'] ) )
488
+ // $new_input['input_placeholder'] = sanitize_text_field( $input['input_placeholder'] );
489
490
+ // if( isset( $input['position'] ) )
491
+ // $new_input['position'] = sanitize_text_field( $input['position'] );
492
493
+ // if( isset( $input['style'] ) )
494
+ // $new_input['style'] = sanitize_text_field( $input['style'] );
495
496
+ // if( isset( $input['stylemobile'] ) )
497
+ // $new_input['stylemobile'] = sanitize_text_field( $input['stylemobile'] );
498
499
+ // if( isset( $input['position-1_bottom'] ) )
500
+ // $new_input['position-1_bottom'] = sanitize_text_field( $input['position-1_bottom'] );
501
502
+ // if( isset( $input['position-1_right'] ) )
503
+ // $new_input['position-1_right'] = sanitize_text_field( $input['position-1_right'] );
504
505
+ // if( isset( $input['position-2_bottom'] ) )
506
+ // $new_input['position-2_bottom'] = sanitize_text_field( $input['position-2_bottom'] );
507
508
+ // if( isset( $input['position-2_left'] ) )
509
+ // $new_input['position-2_left'] = sanitize_text_field( $input['position-2_left'] );
510
511
+ // if( isset( $input['position-3_top'] ) )
512
+ // $new_input['position-3_top'] = sanitize_text_field( $input['position-3_top'] );
513
514
+ // if( isset( $input['position-3_left'] ) )
515
+ // $new_input['position-3_left'] = sanitize_text_field( $input['position-3_left'] );
516
517
+ // if( isset( $input['position-4_top'] ) )
518
+ // $new_input['position-4_top'] = sanitize_text_field( $input['position-4_top'] );
519
520
+ // if( isset( $input['position-4_right'] ) )
521
+ // $new_input['position-4_right'] = sanitize_text_field( $input['position-4_right'] );
522
523
+ // if( isset( $input['hideon_posts'] ) )
524
+ // $new_input['hideon_posts'] = sanitize_text_field( $input['hideon_posts'] );
525
526
+ // if( isset( $input['hideon_page'] ) )
527
+ // $new_input['hideon_page'] = sanitize_text_field( $input['hideon_page'] );
528
529
+ // if( isset( $input['hideon_homepage'] ) )
530
+ // $new_input['hideon_homepage'] = sanitize_text_field( $input['hideon_homepage'] );
531
532
+ // if( isset( $input['hideon_frontpage'] ) )
533
+ // $new_input['hideon_frontpage'] = sanitize_text_field( $input['hideon_frontpage'] );
534
535
+ // if( isset( $input['hideon_category'] ) )
536
+ // $new_input['hideon_category'] = sanitize_text_field( $input['hideon_category'] );
537
+
538
+ // if( isset( $input['hideon_archive'] ) )
539
+ // $new_input['hideon_archive'] = sanitize_text_field( $input['hideon_archive'] );
540
+
541
+ // if( isset( $input['hideon_404'] ) )
542
+ // $new_input['hideon_404'] = sanitize_text_field( $input['hideon_404'] );
543
+
544
+ // if( isset( $input['list_hideon_pages'] ) )
545
+ // $new_input['list_hideon_pages'] = sanitize_text_field( $input['list_hideon_pages'] );
546
547
+ // if( isset( $input['list_hideon_cat'] ) )
548
+ // $new_input['list_hideon_cat'] = sanitize_text_field( $input['list_hideon_cat'] );
549
550
+ // if( isset( $input['shortcode'] ) )
551
+ // $new_input['shortcode'] = sanitize_text_field( $input['shortcode'] );
552
553
+ // if( isset( $input['return_type'] ) )
554
+ // $new_input['return_type'] = sanitize_text_field( $input['return_type'] );
555
556
+ // if( isset( $input['group_id'] ) )
557
+ // $new_input['group_id'] = sanitize_text_field( $input['group_id'] );
558
559
560
561
562
+ // // $new_input = sanitize_text_field($input);
563
return $new_input;
564
}
565
admin/commons/class-ht-ccw-admin-lists.php ADDED
@@ -0,0 +1,28 @@
1
+ <?php
2
+ /**
3
+ * Added Languages - Messenger ..
4
+ *
5
+ */
6
+
7
+ if ( ! defined( 'ABSPATH' ) ) exit;
8
+
9
+ if ( ! class_exists( 'HT_CCW_Admin_lists' ) ) :
10
+
11
+ class HT_CCW_Admin_lists {
12
+
13
+
14
+ /**
15
+ * If new animation have to add - add the animation name here
16
+ * and then add related css - anstyles.scss ( in dev environment, and run webpack )
17
+ */
18
+ public static $animations_list = array(
19
+ 'no-animation',
20
+ 'bounce',
21
+ 'tada',
22
+ );
23
+
24
+
25
+
26
+ }
27
+
28
+ endif; // END class_exists check
admin/default-values.php CHANGED
@@ -15,11 +15,13 @@ if ( ! defined( 'ABSPATH' ) ) exit;
15
16
17
/**
18
- * table name: ccw_options
19
*
20
* top level options page - values
21
*
22
* initial - default / inital text
23
*/
24
$values = array(
25
'enable' => '2',
@@ -28,7 +30,7 @@ $values = array(
28
'initial' => '',
29
'input_placeholder' => 'WhatsApp us',
30
'position' => '1',
31
- 'style' => '1',
32
'stylemobile' => '3',
33
'position-1_bottom' => '10px',
34
'position-1_right' => '10px',
@@ -43,6 +45,7 @@ $values = array(
43
'shortcode' => 'chat',
44
'return_type' => 'chat', // chat or group_chat
45
'group_id' => 'DuEZlyOo94A1QirOX42zKr',
46
);
47
48
/**
@@ -54,7 +57,7 @@ $values = array(
54
$showon = get_option( 'ccw_options' );
55
$p_ver = get_option('ccw_plugin_details');
56
57
- if ( $p_ver['version'] < '1.3' ) {
58
59
if( !isset( $showon['showon_posts'] ) ) {
60
$values[hideon_posts] = '1';
@@ -98,9 +101,13 @@ update_option('ccw_options', $update_values);
98
99
100
/**
101
- * table name - ccw_options_cs
102
*
103
- * customize styles - options page
104
*/
105
$values_cs = array(
106
's1_text_color' => '#9e9e9e',
@@ -117,19 +124,20 @@ $values_cs = array(
117
's2_decoration' => 'initial',
118
's2_decoration_onhover' => 'initial',
119
120
- 's3_icon_size' => '48px',
121
122
's4_text_color' => 'rgba(0, 0, 0, 0.6)',
123
's4_background_color' => '#e4e4e4',
124
125
- 's5_color' => '#000',
126
- 's5_hover_color' => '#ddd',
127
's5_icon_size' => '24px',
128
129
's6_color' => '#fff',
130
's6_hover_color' => '#000',
131
's6_icon_size' => '24px',
132
- 's6_circle_background_color' => '#ffa500',
133
's6_circle_background_hover_color' => '#00e51e',
134
's6_circle_height' => '48px',
135
's6_circle_width' => '48px',
@@ -138,7 +146,7 @@ $values_cs = array(
138
's7_color' => '#fff',
139
's7_hover_color' => '#000',
140
's7_icon_size' => '24px',
141
- 's7_box_background_color' => '#ffa500',
142
's7_box_background_hover_color' => '#00e51e',
143
's7_box_height' => '48px',
144
's7_box_width' => '48px',
@@ -147,12 +155,18 @@ $values_cs = array(
147
's8_text_color' => '#fff',
148
's8_background_color' => '#26a69a',
149
's8_icon_color' => '#fff',
150
-
151
's8_text_color_onhover' => '#fff',
152
's8_background_color_onhover' => '#26a69a',
153
's8_icon_color_onhover' => '#fff',
154
's8_icon_float' => 'right',
155
's8_1_width' => '',
156
);
157
158
$db_values_cs = get_option( 'ccw_options_cs', array() );
@@ -162,7 +176,7 @@ update_option('ccw_options_cs', $update_values_cs);
162
163
// plugin details
164
$plugin_details = array(
165
- 'version' => CCW_VERSION,
166
);
167
168
// Always use update_option - override new values .. don't preseve already existing values
15
16
17
/**
18
+ * table name: "ccw_options"
19
*
20
* top level options page - values
21
*
22
* initial - default / inital text
23
+ *
24
+ * enable, enable_sc - 2 - enable, 1 - disable ..
25
*/
26
$values = array(
27
'enable' => '2',
30
'initial' => '',
31
'input_placeholder' => 'WhatsApp us',
32
'position' => '1',
33
+ 'style' => '9',
34
'stylemobile' => '3',
35
'position-1_bottom' => '10px',
36
'position-1_right' => '10px',
45
'shortcode' => 'chat',
46
'return_type' => 'chat', // chat or group_chat
47
'group_id' => 'DuEZlyOo94A1QirOX42zKr',
48
+
49
);
50
51
/**
57
$showon = get_option( 'ccw_options' );
58
$p_ver = get_option('ccw_plugin_details');
59
60
+ if ( '1.1' == $p_ver['version'] || '1.2' == $p_ver['version'] ) {
61
62
if( !isset( $showon['showon_posts'] ) ) {
63
$values[hideon_posts] = '1';
101
102
103
/**
104
+ * table name - "ccw_options_cs"
105
*
106
+ * customize styles - options page
107
+ *
108
+ * @var string an_on_hover
109
+ * - if yes - adds 'ccw-an' to styles
110
+ * - added animations based on ccw-an at javascript
111
*/
112
$values_cs = array(
113
's1_text_color' => '#9e9e9e',
124
's2_decoration' => 'initial',
125
's2_decoration_onhover' => 'initial',
126
127
+ 's3_icon_size' => '34px',
128
+ 's3_icon_type' => 'png',
129
130
's4_text_color' => 'rgba(0, 0, 0, 0.6)',
131
's4_background_color' => '#e4e4e4',
132
133
+ 's5_color' => '#25D366',
134
+ 's5_hover_color' => '#00e51e',
135
's5_icon_size' => '24px',
136
137
's6_color' => '#fff',
138
's6_hover_color' => '#000',
139
's6_icon_size' => '24px',
140
+ 's6_circle_background_color' => '#25D366',
141
's6_circle_background_hover_color' => '#00e51e',
142
's6_circle_height' => '48px',
143
's6_circle_width' => '48px',
146
's7_color' => '#fff',
147
's7_hover_color' => '#000',
148
's7_icon_size' => '24px',
149
+ 's7_box_background_color' => '#25D366',
150
's7_box_background_hover_color' => '#00e51e',
151
's7_box_height' => '48px',
152
's7_box_width' => '48px',
155
's8_text_color' => '#fff',
156
's8_background_color' => '#26a69a',
157
's8_icon_color' => '#fff',
158
's8_text_color_onhover' => '#fff',
159
's8_background_color_onhover' => '#26a69a',
160
's8_icon_color_onhover' => '#fff',
161
's8_icon_float' => 'right',
162
's8_1_width' => '',
163
+
164
+ 's9_icon_size' => '48px',
165
+
166
+ // 'an_enable' => 'no',
167
+ 'an_on_load' => 'no-animation',
168
+ 'an_on_hover' => 'ccw-no-hover-an',
169
+
170
);
171
172
$db_values_cs = get_option( 'ccw_options_cs', array() );
176
177
// plugin details
178
$plugin_details = array(
179
+ 'version' => HT_CCW_VERSION,
180
);
181
182
// Always use update_option - override new values .. don't preseve already existing values
admin/settings_page.php CHANGED
@@ -40,15 +40,15 @@ if ( ! defined( 'ABSPATH' ) ) exit;
40
<div class="col s12 m6">
41
<div class="card blue-grey darken-1">
42
<div class="card-content white-text">
43
- <span class="card-title">Issues / Support</span>
44
<br>
45
- <p>In case any issue, please rise a ticket </p>
46
<br>
47
- <p>WordPress Support forum is Recommend</p>
48
</div>
49
<div class="card-action">
50
- <a target="_blank" href="https://wordpress.org/support/plugin/click-to-chat-for-whatsapp">@WordPress</a>
51
- <a target="_blank" href="https://www.messenger.com/t/holithemes">Private</a>
52
</div>
53
</div>
54
</div>
@@ -56,14 +56,14 @@ if ( ! defined( 'ABSPATH' ) ) exit;
56
<div class="col s12 m6">
57
<div class="card blue-grey darken-1">
58
<div class="card-content white-text">
59
- <span class="card-title">Plugin Review</span>
60
<br>
61
- <p>If you like the plugin, and have time to write review</p>
62
<br>
63
- <p>please write an awesome review</p>
64
</div>
65
<div class="card-action">
66
- <a target="_blank" href="https://wordpress.org/support/plugin/click-to-chat-for-whatsapp/reviews/#new-post">Plugin Review</a>
67
</div>
68
</div>
69
</div>
@@ -75,14 +75,14 @@ if ( ! defined( 'ABSPATH' ) ) exit;
75
<div class="col s12 m6">
76
<div class="card blue-grey darken-1">
77
<div class="card-content white-text">
78
- <span class="card-title">Pay Donation</span>
79
<br>
80
- <p>This is free plugin, no need to pay any thing.</p>
81
<br>
82
- <p>Support on other sites is much appreciate</p>
83
</div>
84
<div class="card-action">
85
- <a target="_blank" href="https://holithemes.com/whatsapp-chat/pay/">is that ok</a>
86
</div>
87
</div>
88
</div>
@@ -90,15 +90,15 @@ if ( ! defined( 'ABSPATH' ) ) exit;
90
<div class="col s12 m6">
91
<div class="card blue-grey darken-1">
92
<div class="card-content white-text">
93
- <span class="card-title">Web / Social</span>
94
<br>
95
- <p>HoliThemes on Web</p>
96
<br>
97
- <p>Post new relases, tips, tricks, much more</p>
98
</div>
99
<div class="card-action">
100
<a target="_blank" href="https://holithemes.com/">HoliThemes</a>
101
- <a target="_blank" href="https://www.facebook.com/holithemes/">Facebook</a>
102
<!-- <a target="_blank" href="#">Twitter</a> -->
103
</div>
104
</div>
40
<div class="col s12 m6">
41
<div class="card blue-grey darken-1">
42
<div class="card-content white-text">
43
+ <span class="card-title"><?php _e( 'Issues / Support' , 'click-to-chat-for-whatsapp' ) ?></span>
44
<br>
45
+ <p><?php _e( 'In case any issue, please rise a ticket' , 'click-to-chat-for-whatsapp' ) ?> </p>
46
<br>
47
+ <p><?php _e( 'WordPress Support forum is Recommend' , 'click-to-chat-for-whatsapp' ) ?></p>
48
</div>
49
<div class="card-action">
50
+ <a target="_blank" href="https://wordpress.org/support/plugin/click-to-chat-for-whatsapp"><?php _e( '@WordPress' , 'click-to-chat-for-whatsapp' ) ?></a>
51
+ <a target="_blank" href="https://www.messenger.com/t/holithemes"><?php _e( '' , 'click-to-chat-for-whatsapp' ) ?><?php _e( 'Private' , 'click-to-chat-for-whatsapp' ) ?></a>
52
</div>
53
</div>
54
</div>
56
<div class="col s12 m6">
57
<div class="card blue-grey darken-1">
58
<div class="card-content white-text">
59
+ <span class="card-title"><?php _e( 'Plugin Review' , 'click-to-chat-for-whatsapp' ) ?></span>
60
<br>
61
+ <p><?php _e( 'If you like the plugin, and have time to write review' , 'click-to-chat-for-whatsapp' ) ?></p>
62
<br>
63
+ <p><?php _e( 'please write an awesome review' , 'click-to-chat-for-whatsapp' ) ?></p>
64
</div>
65
<div class="card-action">
66
+ <a target="_blank" href="https://wordpress.org/support/plugin/click-to-chat-for-whatsapp/reviews/#new-post"><?php _e( '' , 'click-to-chat-for-whatsapp' ) ?>Plugin Review</a>
67
</div>
68
</div>
69
</div>
75
<div class="col s12 m6">
76
<div class="card blue-grey darken-1">
77
<div class="card-content white-text">
78
+ <span class="card-title"><?php _e( 'Pay Donation' , 'click-to-chat-for-whatsapp' ) ?></span>
79
<br>
80
+ <p><?php _e( 'This is free plugin, no need to pay any thing.' , 'click-to-chat-for-whatsapp' ) ?></p>
81
<br>
82
+ <p><?php _e( 'Support on other sites is much appreciate' , 'click-to-chat-for-whatsapp' ) ?></p>
83
</div>
84
<div class="card-action">
85
+ <a target="_blank" href="https://holithemes.com/whatsapp-chat/pay/"><?php _e( '' , 'click-to-chat-for-whatsapp' ) ?>support</a>
86
</div>
87
</div>
88
</div>
90
<div class="col s12 m6">
91
<div class="card blue-grey darken-1">
92
<div class="card-content white-text">
93
+ <span class="card-title"><?php _e( 'Web / Social' , 'click-to-chat-for-whatsapp' ) ?></span>
94
<br>
95
+ <p><?php _e( 'HoliThemes on Web' , 'click-to-chat-for-whatsapp' ) ?></p>
96
<br>
97
+ <p><?php _e( 'Post new relases, tips, tricks, much more' , 'click-to-chat-for-whatsapp' ) ?></p>
98
</div>
99
<div class="card-action">
100
<a target="_blank" href="https://holithemes.com/">HoliThemes</a>
101
+ <a target="_blank" href="https://www.facebook.com/holithemes/"><?php _e( 'Facebook' , 'click-to-chat-for-whatsapp' ) ?></a>
102
<!-- <a target="_blank" href="#">Twitter</a> -->
103
</div>
104
</div>
assets/css/{admin_main.css → admin_mainstyles.css} RENAMED
@@ -1,4884 +1,4453 @@
1
- /* Materializecss */
2
- .materialize-red {
3
- background-color: #e51c23 !important; }
4
-
5
- .materialize-red-text {
6
- color: #e51c23 !important; }
7
-
8
- .materialize-red.lighten-5 {
9
- background-color: #fdeaeb !important; }
10
-
11
- .materialize-red-text.text-lighten-5 {
12
- color: #fdeaeb !important; }
13
-
14
- .materialize-red.lighten-4 {
15
- background-color: #f8c1c3 !important; }
16
-
17
- .materialize-red-text.text-lighten-4 {
18
- color: #f8c1c3 !important; }
19
-
20
- .materialize-red.lighten-3 {
21
- background-color: #f3989b !important; }
22
-
23
- .materialize-red-text.text-lighten-3 {
24
- color: #f3989b !important; }
25
-
26
- .materialize-red.lighten-2 {
27
- background-color: #ee6e73 !important; }
28
-
29
- .materialize-red-text.text-lighten-2 {
30
- color: #ee6e73 !important; }
31
-
32
- .materialize-red.lighten-1 {
33
- background-color: #ea454b !important; }
34
-
35
- .materialize-red-text.text-lighten-1 {
36
- color: #ea454b !important; }
37
-
38
- .materialize-red.darken-1 {
39
- background-color: #d0181e !important; }
40
-
41
- .materialize-red-text.text-darken-1 {
42
- color: #d0181e !important; }
43
-
44
- .materialize-red.darken-2 {
45
- background-color: #b9151b !important; }
46
-
47
- .materialize-red-text.text-darken-2 {
48
- color: #b9151b !important; }
49
-
50
- .materialize-red.darken-3 {
51
- background-color: #a21318 !important; }
52
-
53
- .materialize-red-text.text-darken-3 {
54
- color: #a21318 !important; }
55
-
56
- .materialize-red.darken-4 {
57
- background-color: #8b1014 !important; }
58
-
59
- .materialize-red-text.text-darken-4 {
60
- color: #8b1014 !important; }
61
-
62
- .red {
63
- background-color: #F44336 !important; }
64
-
65
- .red-text {
66
- color: #F44336 !important; }
67
-
68
- .red.lighten-5 {
69
- background-color: #FFEBEE !important; }
70
-
71
- .red-text.text-lighten-5 {
72
- color: #FFEBEE !important; }
73
-
74
- .red.lighten-4 {
75
- background-color: #FFCDD2 !important; }
76
-
77
- .red-text.text-lighten-4 {
78
- color: #FFCDD2 !important; }
79
-
80
- .red.lighten-3 {
81
- background-color: #EF9A9A !important; }
82
-
83
- .red-text.text-lighten-3 {
84
- color: #EF9A9A !important; }
85
-
86
- .red.lighten-2 {
87
- background-color: #E57373 !important; }
88
-
89
- .red-text.text-lighten-2 {
90
- color: #E57373 !important; }
91
-
92
- .red.lighten-1 {
93
- background-color: #EF5350 !important; }
94
-
95
- .red-text.text-lighten-1 {
96
- color: #EF5350 !important; }
97
-
98
- .red.darken-1 {
99
- background-color: #E53935 !important; }
100
-
101
- .red-text.text-darken-1 {
102
- color: #E53935 !important; }
103
-
104
- .red.darken-2 {
105
- background-color: #D32F2F !important; }
106
-
107
- .red-text.text-darken-2 {
108
- color: #D32F2F !important; }
109
-
110
- .red.darken-3 {
111
- background-color: #C62828 !important; }
112
-
113
- .red-text.text-darken-3 {
114
- color: #C62828 !important; }
115
-
116
- .red.darken-4 {
117
- background-color: #B71C1C !important; }
118
-
119
- .red-text.text-darken-4 {
120
- color: #B71C1C !important; }
121
-
122
- .red.accent-1 {
123
- background-color: #FF8A80 !important; }
124
-
125
- .red-text.text-accent-1 {
126
- color: #FF8A80 !important; }
127
-
128
- .red.accent-2 {
129
- background-color: #FF5252 !important; }
130
-
131
- .red-text.text-accent-2 {
132
- color: #FF5252 !important; }
133
-
134
- .red.accent-3 {
135
- background-color: #FF1744 !important; }
136
-
137
- .red-text.text-accent-3 {
138
- color: #FF1744 !important; }
139
-
140
- .red.accent-4 {
141
- background-color: #D50000 !important; }
142
-
143
- .red-text.text-accent-4 {
144
- color: #D50000 !important; }
145
-
146
- .pink {
147
- background-color: #e91e63 !important; }
148
-
149
- .pink-text {
150
- color: #e91e63 !important; }
151
-
152
- .pink.lighten-5 {
153
- background-color: #fce4ec !important; }
154
-
155
- .pink-text.text-lighten-5 {<