Click to Chat for WhatsApp Chat - Version 2.0

Version Description

New interface

Download this release

Release Info

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

Code changes from version 1.7.2 to 2.0

Files changed (63) hide show
  1. class-ht-ctc-switch.php +107 -0
  2. click-to-chat.php +15 -13
  3. new/admin/admin.php +47 -0
  4. new/admin/admin_assets/css/admin.css +17 -0
  5. new/admin/admin_assets/js/admin.js +146 -0
  6. new/admin/class-ht-ctc-admin-chat-page.php +821 -0
  7. new/admin/class-ht-ctc-admin-customize-styles.php +910 -0
  8. new/admin/class-ht-ctc-admin-group-page.php +747 -0
  9. new/admin/class-ht-ctc-admin-main-page.php +375 -0
  10. new/admin/class-ht-ctc-admin-scripts.php +45 -0
  11. new/admin/class-ht-ctc-admin-share-page.php +748 -0
  12. new/admin/class-ht-ctc-db.php +563 -0
  13. new/admin/class-ht-ctc-metabox.php +141 -0
  14. new/class-ht-ctc.php +218 -0
  15. new/inc/assets/css/main.css +35 -0
  16. new/inc/assets/fonts/ccw.eot +0 -0
  17. new/inc/assets/fonts/ccw.svg +14 -0
  18. new/inc/assets/fonts/ccw.ttf +0 -0
  19. new/inc/assets/fonts/ccw.woff +0 -0
  20. new/inc/assets/js/app.js +227 -0
  21. new/inc/chat/chat-position.php +17 -0
  22. new/inc/chat/chat-show-hide.php +200 -0
  23. new/inc/chat/class-ht-ctc-chat-shortcode.php +194 -0
  24. new/inc/chat/class-ht-ctc-chat.php +80 -0
  25. new/inc/class-ht-ctc-main.php +69 -0
  26. new/inc/class-ht-ctc-register.php +64 -0
  27. new/inc/commons/class-ht-ctc-ismobile.php +70 -0
  28. new/inc/commons/class-ht-ctc-scripts.php +42 -0
  29. new/inc/commons/class-ht-ctc-values.php +56 -0
  30. new/inc/commons/ht-ctc-variables.php +149 -0
  31. new/inc/group/class-ht-ctc-group-shortcode.php +177 -0
  32. new/inc/group/class-ht-ctc-group.php +72 -0
  33. new/inc/group/group-position.php +17 -0
  34. new/inc/group/group-show-hide.php +212 -0
  35. new/inc/share/class-ht-ctc-share-shortcode.php +191 -0
  36. new/inc/share/class-ht-ctc-share.php +72 -0
  37. new/inc/share/share-position.php +17 -0
  38. new/inc/share/share-show-hide.php +211 -0
  39. new/inc/styles-shortcode/sc-style-1.php +20 -0
  40. new/inc/styles-shortcode/sc-style-2.php +26 -0
  41. new/inc/styles-shortcode/sc-style-3.php +26 -0
  42. new/inc/styles-shortcode/sc-style-4.php +62 -0
  43. new/inc/styles-shortcode/sc-style-5.php +134 -0
  44. new/inc/styles-shortcode/sc-style-6.php +31 -0
  45. new/inc/styles-shortcode/sc-style-7.php +33 -0
  46. new/inc/styles-shortcode/sc-style-8.php +57 -0
  47. new/inc/styles-shortcode/sc-style-99.php +68 -0
  48. new/inc/styles/style-1.php +18 -0
  49. new/inc/styles/style-2.php +26 -0
  50. new/inc/styles/style-3.php +27 -0
  51. new/inc/styles/style-4.php +61 -0
  52. new/inc/styles/style-5.php +125 -0
  53. new/inc/styles/style-6.php +29 -0
  54. new/inc/styles/style-7.php +27 -0
  55. new/inc/styles/style-8.php +57 -0
  56. new/inc/styles/style-99.php +74 -0
  57. prev/admin/class-ccw-admin-page.php +99 -4
  58. prev/admin/commons/admin-sidebar.php +0 -1
  59. prev/admin/default-values.php +37 -1
  60. prev/admin/settings_page.php +16 -2
  61. prev/assets/css/mdstyle8.css +18 -0
  62. prev/assets/img/new_style8.jpg +0 -0
  63. readme.txt +34 -53
class-ht-ctc-switch.php ADDED
@@ -0,0 +1,107 @@
1
+ <?php
2
+ /**
3
+ * Switch .. new or previous - user inerface
4
+ * new user default to new interface
5
+ * prev user - default to prev interface if not switched.
6
+ *
7
+ * @since 2.0
8
+ */
9
+
10
+ if ( ! defined( 'ABSPATH' ) ) exit;
11
+
12
+ if ( ! class_exists( 'HT_CTC_Swift' ) ) :
13
+
14
+ class HT_CTC_Swift {
15
+
16
+ public function __construct() {
17
+ $this->to_switch();
18
+ }
19
+
20
+ public function to_switch() {
21
+
22
+ // new interface yes/no
23
+ $is_new = '';
24
+
25
+ // user new/prev
26
+ $user = '';
27
+
28
+
29
+ // if first time user - new interface .. $is_new = 'yes';
30
+ // if user swifted to new interface .. $is_new = 'yes';
31
+
32
+ // if user swifted to prev interface .. $is_new = 'no';
33
+ // if prev user / update .. $is_new = 'no';
34
+
35
+ $ccw_options = get_option('ccw_options');
36
+
37
+ if ( isset( $ccw_options['number'] ) ) {
38
+ $user = 'prev';
39
+ $is_new = 'no';
40
+ } else {
41
+ // new user - new interface
42
+ $user = 'new';
43
+ $is_new = 'yes';
44
+ }
45
+
46
+ // prev user and if switched ( checkbox option at admin )
47
+ if ( 'prev' == $user ) {
48
+
49
+ $ht_ctc_switch = get_option('ht_ctc_switch');
50
+
51
+ if ( 'yes' == $ht_ctc_switch['interface'] ) {
52
+ $is_new = 'yes';
53
+ }
54
+ }
55
+
56
+
57
+ // todo
58
+ // $is_new = 'yes';
59
+
60
+ // define HT_CTC_IS_NEW
61
+ if ( ! defined( 'HT_CTC_IS_NEW' ) ) {
62
+ define( 'HT_CTC_IS_NEW', $is_new );
63
+ }
64
+
65
+
66
+ // include related files ..
67
+ if ( 'yes' == HT_CTC_IS_NEW ) {
68
+ // new interface
69
+
70
+ // include main file - prev
71
+ include_once 'new/class-ht-ctc.php';
72
+
73
+ // create instance for the main file - HT_CTC
74
+ function ht_ctc() {
75
+ return HT_CTC::instance();
76
+ }
77
+
78
+ ht_ctc();
79
+
80
+ } else {
81
+ // prev interface
82
+
83
+ // include main file - prev
84
+ include_once 'prev/inc/class-ht-ccw.php';
85
+
86
+ // create instance for the main file - HT_CCW
87
+ function ht_ccw() {
88
+ return HT_CCW::instance();
89
+ }
90
+
91
+ ht_ccw();
92
+ }
93
+
94
+
95
+ }
96
+
97
+
98
+
99
+
100
+
101
+ }
102
+
103
+ new HT_CTC_Swift();
104
+
105
+ endif; // END class_exists check
106
+
107
+
click-to-chat.php CHANGED
@@ -3,7 +3,7 @@
3
Plugin Name: Click to Chat
4
Plugin URI: https://wordpress.org/plugins/click-to-chat-for-whatsapp/
5
Description: Lets make your Web page visitor contact you through WhatsApp with a single click/tap
6
- Version: 1.7.2
7
Author: HoliThemes
8
Author URI: https://holithemes.com/whatsapp-chat/
9
License: GPL2
@@ -15,22 +15,24 @@ if ( ! defined( 'WPINC' ) ) {
15
die('dont try to call this directly');
16
}
17
18
- // define HT_CCW_VERSION
19
- if ( ! defined( 'HT_CCW_VERSION' ) ) {
20
- define( 'HT_CCW_VERSION', '1.7.2' );
21
}
22
23
- // define HT_CCW_PLUGIN_FILE
24
- if ( ! defined( 'HT_CCW_PLUGIN_FILE' ) ) {
25
- define( 'HT_CCW_PLUGIN_FILE', __FILE__ );
26
}
27
28
- // include main file
29
- require_once 'prev/inc/class-ht-ccw.php';
30
31
- // create instance for the main file - HT_CCW
32
- function ht_ccw() {
33
- return HT_CCW::instance();
34
}
35
36
- ht_ccw();
3
Plugin Name: Click to Chat
4
Plugin URI: https://wordpress.org/plugins/click-to-chat-for-whatsapp/
5
Description: Lets make your Web page visitor contact you through WhatsApp with a single click/tap
6
+ Version: 2.0
7
Author: HoliThemes
8
Author URI: https://holithemes.com/whatsapp-chat/
9
License: GPL2
15
die('dont try to call this directly');
16
}
17
18
+ // new interface - ctc - Version
19
+ if ( ! defined( 'HT_CTC_VERSION' ) ) {
20
+ define( 'HT_CTC_VERSION', '2.0' );
21
}
22
23
+ // for previous interface - define HT_CCW_VERSION
24
+ if ( ! defined( 'HT_CCW_VERSION' ) ) {
25
+ define( 'HT_CCW_VERSION', '1.7.4' );
26
}
27
28
+ // define HT_CTC_PLUGIN_FILE
29
+ if ( ! defined( 'HT_CTC_PLUGIN_FILE' ) ) {
30
+ define( 'HT_CTC_PLUGIN_FILE', __FILE__ );
31
+ }
32
33
+ // prev compatibility - define HT_CCW_PLUGIN_FILE
34
+ if ( ! defined( 'HT_CCW_PLUGIN_FILE' ) ) {
35
+ define( 'HT_CCW_PLUGIN_FILE', __FILE__ );
36
}
37
38
+ include_once 'class-ht-ctc-switch.php';
new/admin/admin.php ADDED
@@ -0,0 +1,47 @@
1
+ <?php
2
+ /**
3
+ * starting point for the admin side of this plugin.
4
+ *
5
+ * include other file here .. which need in admin side.
6
+ *
7
+ * In click-to-chat.php this file will be loaded as is_admin
8
+ *
9
+ * @package ctc
10
+ * @subpackage Administration
11
+ * @since 1.0
12
+ */
13
+
14
+ if ( ! defined( 'ABSPATH' ) ) exit;
15
+
16
+
17
+ $ht_ctc_main_options = get_option('ht_ctc_main_options');
18
+
19
+
20
+ /*************** includes ***********/
21
+
22
+ // add scripts
23
+ include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-scripts.php';
24
+
25
+ // Main admin page - enable options ..
26
+ include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-main-page.php';
27
+
28
+ // Chat admin page
29
+ if ( isset ( $ht_ctc_main_options['enable_chat'] ) ) {
30
+ include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-chat-page.php';
31
+ }
32
+
33
+ // group admin page
34
+ if ( isset ( $ht_ctc_main_options['enable_group'] ) ) {
35
+ include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-group-page.php';
36
+ }
37
+
38
+ // share admin page
39
+ if ( isset ( $ht_ctc_main_options['enable_share'] ) ) {
40
+ include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-share-page.php';
41
+ }
42
+
43
+ // customize styles
44
+ include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-customize-styles.php';
45
+
46
+ // meta boxes - change values at page level
47
+ include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-metabox.php';
new/admin/admin_assets/css/admin.css ADDED
@@ -0,0 +1,17 @@
1
+ /* Admin CSS */
2
+
3
+ .show-hide_display-none {
4
+ display: none;
5
+ }
6
+
7
+ .show-hide_display-block {
8
+ display: block;
9
+ }
10
+
11
+
12
+
13
+ .options .submit {
14
+ position: sticky !important;
15
+ bottom: 1px;
16
+ float: right;
17
+ }
new/admin/admin_assets/js/admin.js ADDED
@@ -0,0 +1,146 @@
1
+
2
+
3
+
4
+
5
+
6
+ // custom code
7
+
8
+
9
+
10
+
11
+ // select option ..
12
+
13
+ // initialize materialize function ..
14
+ document.addEventListener('DOMContentLoaded', function() {
15
+
16
+ // select
17
+ var elems = document.querySelectorAll('select');
18
+ var instances = M.FormSelect.init(elems, {});
19
+
20
+ // Collapsible
21
+ var elems = document.querySelectorAll('.collapsible');
22
+ var instances = M.Collapsible.init(elems, {});
23
+
24
+ });
25
+
26
+
27
+ // // $(document).ready(function(){
28
+ // jQuery(document).ready(function($){
29
+ // $('select').formSelect();
30
+ // });
31
+
32
+ // $(document).ready(function(){
33
+ // // jQuery(document).ready(function($){
34
+ // $('select').formSelect();
35
+ // });
36
+
37
+ // console.log(typeof $);
38
+ // if (typeof $ == 'undefined' ) {
39
+ // console.log('exist..');
40
+ // }
41
+
42
+
43
+ jQuery(document).ready(function ($) {
44
+
45
+ $('select').formSelect();
46
+ $('.collapsible').collapsible();
47
+
48
+ });
49
+
50
+
51
+
52
+
53
+
54
+ jQuery(document).ready(function ($) {
55
+
56
+
57
+ // $('.color-wp').wpColorPicker();
58
+ $('.ht-ctc-color').wpColorPicker();
59
+
60
+
61
+ // ##### show/Hide - chat option #####
62
+
63
+ // show_hide option - other settings page
64
+ var ctc_show_hide_display = document.querySelectorAll('.ctc_show_hide_display');
65
+
66
+ // var hidebased = document.querySelector('.hidebased');
67
+ var hidebased = document.querySelectorAll('.hidebased');
68
+ var showbased = document.querySelectorAll('.showbased');
69
+
70
+ // default display
71
+ function ctc_show_hide_default_display() {
72
+
73
+ var val = $('.select_show_or_hide').find(":selected").val();
74
+
75
+ if (val == 'show') {
76
+ // showbased.classList.add('show-hide_display-block');
77
+ showbased.forEach(function (e) {
78
+ e.classList.add('show-hide_display-block');
79
+ });
80
+ } else if (val == 'hide') {
81
+ // hidebased.classList.add('show-hide_display-block');
82
+ hidebased.forEach(function (e) {
83
+ e.classList.add('show-hide_display-block');
84
+ });
85
+ }
86
+ };
87
+
88
+ ctc_show_hide_default_display();
89
+
90
+
91
+ // incase display-block is added remove it .. onchange
92
+ function ctc_show_hide_display_remove() {
93
+ ctc_show_hide_display.forEach(function (e) {
94
+ e.classList.remove('show-hide_display-block');
95
+ });
96
+ };
97
+
98
+
99
+ $(".select_show_or_hide").on("change", function (e) {
100
+
101
+ // var x = e.target;
102
+ var val = e.target.value;
103
+
104
+ if (val == 'show') {
105
+ ctc_show_hide_display_remove();
106
+
107
+ // showbased.classList.add('show-hide_display-block');
108
+ showbased.forEach(function (e) {
109
+ e.classList.add('show-hide_display-block');
110
+ });
111
+
112
+ } else if (val == 'hide') {
113
+ ctc_show_hide_display_remove();
114
+
115
+ // hidebased.classList.add('show-hide_display-block');
116
+ hidebased.forEach(function (e) {
117
+ e.classList.add('show-hide_display-block');
118
+ });
119
+ }
120
+ });
121
+
122
+ // ##### show/Hide - chat option #####
123
+
124
+
125
+
126
+
127
+ // color ..
128
+
129
+ if ( $(".ht-ctc-color") ) {
130
+ if ( $(".ht-ctc-color").spectrum ) {
131
+ $(".ht-ctc-color").spectrum({
132
+ preferredFormat: "hex",
133
+ showInput: true,
134
+ allowEmpty:true,
135
+ chooseText:'Select',
136
+ // showPalette: true,
137
+ // showSelectionPalette: true,
138
+ // palette: [ 'red', 'green', 'blue' ],
139
+ // localStorageKey: "spectrum.homepage",
140
+ });
141
+ }
142
+ }
143
+
144
+
145
+
146
+ });
new/admin/class-ht-ctc-admin-chat-page.php ADDED
@@ -0,0 +1,821 @@
1
+ <?php
2
+ /**
3
+ * Chat settings page - admin
4
+ *
5
+ * chat options ..
6
+ *
7
+ * @package ctc
8
+ * @subpackage admin
9
+ * @since 2.0
10
+ */
11
+
12
+ if ( ! defined( 'ABSPATH' ) ) exit;
13
+
14
+ if ( ! class_exists( 'HT_CTC_Admin_Chat_Page' ) ) :
15
+
16
+ class HT_CTC_Admin_Chat_Page {
17
+
18
+ public function menu() {
19
+
20
+ add_submenu_page(
21
+ 'click-to-chat',
22
+ 'WhatsApp Chat',
23
+ 'WhatsApp Chat',
24
+ 'manage_options',
25
+ 'click-to-chat-chat-feature',
26
+ array( $this, 'settings_page' )
27
+ );
28
+ }
29
+
30
+ public function settings_page() {
31
+
32
+ if ( ! current_user_can('manage_options') ) {
33
+ return;
34
+ }
35
+
36
+ ?>
37
+
38
+ <div class="wrap">
39
+
40
+ <?php settings_errors(); ?>
41
+
42
+ <div class="row">
43
+ <div class="col s12 m12 xl7 options">
44
+ <form action="options.php" method="post" class="">
45
+ <?php settings_fields( 'ht_ctc_chat_page_settings_fields' ); ?>
46
+ <?php do_settings_sections( 'ht_ctc_chat_page_settings_sections_do' ) ?>
47
+ <?php submit_button() ?>
48
+ </form>
49
+ </div>
50
+ <!-- sidebar content -->
51
+ <div class="col s12 m12 xl4 ht-cc-admin-sidebar">
52
+ <div style="margin-top: 100px; margin-left: 40px;">
53
+ <p>
54
+ Please let us know if you have any suggestions or feedback!! <br>
55
+ <a href="http://api.whatsapp.com/send?phone=919494429789&text=Hi HoliThemes, I have a Suggestion/Feedback:" target="_blank">WhatsApp</a> <br>
56
+ mail: wp@holithemes.com
57
+ </p>
58
+
59
+ </div>
60
+ </div>
61
+ </div>
62
+
63
+ <!-- social links -->
64
+ <div class="row">
65
+ <div class="col s12 m12 l12 xl9">
66
+ <div class="row">
67
+
68
+ <div class="col s12 m6">
69
+ <div class="collection with-header">
70
+ <div class="collection-header"><bold>HoliThemes On</bold></div>
71
+ <a target="_blank" href="https://www.facebook.com/holithemes/" class="collection-item">Facebook</a>
72
+ <a target="_blank" href="https://twitter.com/holithemes" class="collection-item">Twitter</a>
73
+ <a target="_blank" href="https://www.instagram.com/holithemes/" class="collection-item">Instagram</a>
74
+ <a target="_blank" href="https://www.youtube.com/channel/UC2Tf_WB9PWffO2B3tswWCGw" class="collection-item">YouTube</a>
75
+ <a target="_blank" href="https://www.linkedin.com/company/holithemes" class="collection-item">LinkedIn</a>
76
+ </div>
77
+ </div>
78
+
79
+ </div>
80
+ </div>
81
+ </div>
82
+
83
+ </div>
84
+
85
+ <?php
86
+
87
+ }
88
+
89
+
90
+ public function settings() {
91
+
92
+ // chat options
93
+ // register_setting( 'ht_ctc_chat_page_settings_fields', 'ht_ctc_options' , array( $this, 'options_sanitize' ) );
94
+ register_setting( 'ht_ctc_chat_page_settings_fields', 'ht_ctc_chat_options' , array( $this, 'options_sanitize' ) );
95
+
96
+ add_settings_section( 'ht_ctc_chat_page_settings_sections_add', '', array( $this, 'chat_settings_section_cb' ), 'ht_ctc_chat_page_settings_sections_do' );
97
+
98
+ add_settings_field( 'number', 'WhatsApp Number', array( $this, 'number_cb' ), 'ht_ctc_chat_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
99
+ add_settings_field( 'prefilled', 'Pre-Filled Message', array( $this, 'prefilled_cb' ), 'ht_ctc_chat_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
100
+ add_settings_field( 'cta', 'Call to Action', array( $this, 'cta_cb' ), 'ht_ctc_chat_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
101
+ add_settings_field( 'ctc_desktop_style', 'Style for Desktop', array( $this, 'ctc_desktop_style_cb' ), 'ht_ctc_chat_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
102
+ add_settings_field( 'ctc_mobile_style', 'Style for Mobile', array( $this, 'ctc_mobile_style_cb' ), 'ht_ctc_chat_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
103
+ add_settings_field( 'ctc_position', 'Position to place', array( $this, 'ctc_position_cb' ), 'ht_ctc_chat_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
104
+ add_settings_field( 'ctc_webandapi', 'Web WhatsApp', array( $this, 'ctc_webandapi_cb' ), 'ht_ctc_chat_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
105
+ add_settings_field( 'ctc_show_hide', 'Show/Hide', array( $this, 'ctc_show_hide_cb' ), 'ht_ctc_chat_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
106
+ add_settings_field( 'chat_shortcode', '', array( $this, 'chat_shortcode_cb' ), 'ht_ctc_chat_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
107
+
108
+ }
109
+
110
+ public function chat_settings_section_cb() {
111
+ ?>
112
+ <h1>Chat</h1>
113
+ <?php
114
+ }
115
+
116
+
117
+ // WhatsApp number
118
+ function number_cb() {
119
+ $options = get_option('ht_ctc_chat_options');
120
+ ?>
121
+ <div class="row">
122
+ <div class="input-field col s12">
123
+ <input name="ht_ctc_chat_options[number]" value="<?php echo esc_attr( $options['number'] ) ?>" id="whatsapp_number" type="text" class="input-margin">
124
+ <label for="whatsapp_number">Enter WhatsApp number </label>
125
+ <p class="description">Enter 'WhatsApp' or 'WhatsApp business' number with country code ( No need to add any prefix "+" )
126
+ <br> ( e.g. 916123456789 - herein e.g. 91 is country code, 6123456789 is the mobile number ) - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/whatsapp-number/">more info</a> ) </p>
127
+ </div>
128
+ </div>
129
+ <?php
130
+ }
131
+
132
+ // pre-filled - message
133
+ function prefilled_cb() {
134
+ $options = get_option('ht_ctc_chat_options');
135
+ ?>
136
+ <div class="row">
137
+ <div class="input-field col s12">
138
+ <input name="ht_ctc_chat_options[pre_filled]" value="<?php echo esc_attr( $options['pre_filled'] ) ?>" id="pre_filled" type="text" class="input-margin">
139
+ <label for="pre_filled">Pre-filled message</label>
140
+ <p class="description">Text that appears in the WhatsApp Chat window. Add placeholders {{url}}, {{title}} to replace current webpage URL, Post title - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/pre-filled-message/">more info</a> </p>
141
+ </div>
142
+ </div>
143
+ <?php
144
+ }
145
+
146
+ // call to action
147
+ function cta_cb() {
148
+ $options = get_option('ht_ctc_chat_options');
149
+ ?>
150
+ <div class="row">
151
+ <div class="input-field col s12">
152
+ <input name="ht_ctc_chat_options[call_to_action]" value="<?php echo esc_attr( $options['call_to_action'] ) ?>" id="call_to_action" type="text" class="input-margin">
153
+ <label for="call_to_action">Call to Action</label>
154
+ <p class="description"> Text that appears along with WhatsApp icon/button - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/call-to-action/">more info</a> </p>
155
+ </div>
156
+ </div>
157
+ <?php
158
+ }
159
+
160
+
161
+ // Desktop - select style
162
+ function ctc_desktop_style_cb() {
163
+ $options = get_option('ht_ctc_chat_options');
164
+ $style_value = esc_attr( $options['style_desktop'] );
165
+ ?>
166
+ <div class="row">
167
+ <div class="input-field col s12" style="margin-bottom: 0px;">
168
+ <select name="ht_ctc_chat_options[style_desktop]" class="select-2">
169
+ <option value="1" <?php echo $style_value == 1 ? 'SELECTED' : ''; ?> >Style-1</option>
170
+ <option value="2" <?php echo $style_value == 2 ? 'SELECTED' : ''; ?> >Style-2</option>
171
+ <option value="3" <?php echo $style_value == 3 ? 'SELECTED' : ''; ?> >Style-3</option>
172
+ <option value="4" <?php echo $style_value == 4 ? 'SELECTED' : ''; ?> >Style-4</option>
173
+ <option value="5" <?php echo $style_value == 5 ? 'SELECTED' : ''; ?> >Style-5</option>
174
+ <option value="6" <?php echo $style_value == 6 ? 'SELECTED' : ''; ?> >Style-6</option>
175
+ <option value="7" <?php echo $style_value == 7 ? 'SELECTED' : ''; ?> >Style-7</option>
176
+ <option value="8" <?php echo $style_value == 8 ? 'SELECTED' : ''; ?> >Style-8</option>
177
+ <option value="99" <?php echo $style_value == 99 ? 'SELECTED' : ''; ?> >Style-99 (Add your own image / GIF)</option>
178
+ </select>
179
+ <label>Select Style for Desktop</label>
180
+ </div>
181
+ </div>
182
+
183
+ <p class="description"> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/list-of-styles/">List of syles</a> </p>
184
+ <p class="description"> Can customize each style - <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">Customize Styles</a> </p>
185
+ <?php
186
+ }
187
+
188
+
189
+ // Mobile - select style
190
+ function ctc_mobile_style_cb() {
191
+ $options = get_option('ht_ctc_chat_options');
192
+ $style_value = esc_attr( $options['style_mobile'] );
193
+ ?>
194
+ <div class="row" style="margin-bottom: 0px;">
195
+ <div class="input-field col s12">
196
+ <select name="ht_ctc_chat_options[style_mobile]" class="select-2">
197
+ <option value="1" <?php echo $style_value == 1 ? 'SELECTED' : ''; ?> >Style-1</option>
198
+ <option value="2" <?php echo $style_value == 2 ? 'SELECTED' : ''; ?> >Style-2</option>
199
+ <option value="3" <?php echo $style_value == 3 ? 'SELECTED' : ''; ?> >Style-3</option>
200
+ <option value="4" <?php echo $style_value == 4 ? 'SELECTED' : ''; ?> >Style-4</option>
201
+ <option value="5" <?php echo $style_value == 5 ? 'SELECTED' : ''; ?> >Style-5</option>
202
+ <option value="6" <?php echo $style_value == 6 ? 'SELECTED' : ''; ?> >Style-6</option>
203
+ <option value="7" <?php echo $style_value == 7 ? 'SELECTED' : ''; ?> >Style-7</option>
204
+ <option value="8" <?php echo $style_value == 8 ? 'SELECTED' : ''; ?> >Style-8</option>
205
+ <option value="99" <?php echo $style_value == 99 ? 'SELECTED' : ''; ?> >Style-99 (Add your own image / GIF)</option>
206
+ </select>
207
+ <label>Select Style for Mobile</label>
208
+ </div>
209
+ </div>
210
+
211
+ <!-- <p class="description"> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/list-of-styles/">List of syles</a> </p>
212
+ <p class="description"> Can customize each style - <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">Customize Styles</a> </p> -->
213
+ <?php
214
+ }
215
+
216
+
217
+ // position to place
218
+ function ctc_position_cb() {
219
+ $options = get_option('ht_ctc_chat_options');
220
+
221
+ $side_1 = esc_attr( $options['side_1'] );
222
+ $side_1_value = esc_attr( $options['side_1_value'] );
223
+ $side_2 = esc_attr( $options['side_2'] );
224
+ ?>
225
+ <!-- side - 1 -->
226
+ <div class="row">
227
+ <div class="input-field col s6">
228
+ <select name="ht_ctc_chat_options[side_1]" class="select-2">
229
+ <option value="bottom" <?php echo $side_1 == 'bottom' ? 'SELECTED' : ''; ?> >bottom</option>
230
+ <option value="top" <?php echo $side_1 == 'top' ? 'SELECTED' : ''; ?> >top</option>
231
+ </select>
232
+ <label>top / bottom </label>
233
+ </div>
234
+ <div class="input-field col s6">
235
+ <input name="ht_ctc_chat_options[side_1_value]" value="<?php echo esc_attr( $options['side_1_value'] ) ?>" id="side_1_value" type="text" class="input-margin">
236
+ <label for="side_1_value">e.g. 10px</label>
237
+ </div>
238
+ </div>
239
+
240
+
241
+ <!-- side - 2 -->
242
+ <div class="row">
243
+ <div class="input-field col s6">
244
+ <select name="ht_ctc_chat_options[side_2]" class="select-2">
245
+ <option value="right" <?php echo $side_2 == 'right' ? 'SELECTED' : ''; ?> >right</option>
246
+ <option value="left" <?php echo $side_2 == 'left' ? 'SELECTED' : ''; ?> >left</option>
247
+ </select>
248
+ <label>right / left</label>
249
+ </div>
250
+
251
+ <div class="input-field col s6">
252
+ <input name="ht_ctc_chat_options[side_2_value]" value="<?php echo esc_attr( $options['side_2_value'] ) ?>" id="side_2_value" type="text" class="input-margin">
253
+ <label for="side_2_value">e.g. 10px</label>
254
+ </div>
255
+ </div>
256
+
257
+ <p class="description">Add css units as suffix - e.g. 10px, 50% - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/position-to-place/">more info</a> </p>
258
+ <?php
259
+ }
260
+
261
+
262
+ // If checked web / api whatsapp link. If unchecked wa.me links
263
+ function ctc_webandapi_cb() {
264
+ $options = get_option('ht_ctc_chat_options');
265
+
266
+
267
+ if ( isset( $options['webandapi'] ) ) {
268
+ ?>
269
+ <p>
270
+ <label>
271
+ <input name="ht_ctc_chat_options[webandapi]" type="checkbox" value="1" <?php checked( $options['webandapi'], 1 ); ?> id="webandapi" />
272
+ <span>Web WhatsApp on Desktop</span>
273
+ </label>
274
+ </p>
275
+ <?php
276
+ } else {
277
+ ?>
278
+ <p>
279
+ <label>
280
+ <input name="ht_ctc_chat_options[webandapi]" type="checkbox" value="1" id="webandapi" />
281
+ <span>Web WhatsApp on Desktop</span>
282
+ </label>
283
+ </p>
284
+ <?php
285
+ }
286
+ ?>
287
+ <p class="description">Open Web.WhatsApp directly on Desktop - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/web-whatsapp/">more info</a> </p>
288
+ <p class="description">if cache plugins, not detecting the device uncheck this option</p>
289
+ <p class="description"></p>
290
+ <?php
291
+ }
292
+
293
+
294
+ // show/hide
295
+ function ctc_show_hide_cb() {
296
+
297
+
298
+ $options = get_option('ht_ctc_chat_options');
299
+
300
+ $show_or_hide = esc_attr( $options['show_or_hide'] );
301
+ ?>
302
+
303
+ <ul class="collapsible">
304
+ <li>
305
+ <div class="collapsible-header">Show/Hide</div>
306
+ <div class="collapsible-body">
307
+
308
+ <?php
309
+
310
+
311
+ // Hide on Mobile Devices
312
+ if ( isset( $options['hideon_mobile'] ) ) {
313
+ ?>
314
+ <p>
315
+ <label>
316
+ <input name="ht_ctc_chat_options[hideon_mobile]" type="checkbox" value="1" <?php checked( $options['hideon_mobile'], 1 ); ?> id="hideon_mobile" />
317
+ <span>Hide on - Mobile Devices</span>
318
+ </label>
319
+ </p>
320
+ <?php
321
+ } else {
322
+ ?>
323
+ <p>
324
+ <label>
325
+ <input name="ht_ctc_chat_options[hideon_mobile]" type="checkbox" value="1" id="hideon_mobile" />
326
+ <span>Hide on - Mobile Devices</span>
327
+ </label>
328
+ </p>
329
+ <?php
330
+ }
331
+
332
+ // Hide on Desktop Devices
333
+ if ( isset( $options['hideon_desktop'] ) ) {
334
+ ?>
335
+ <p>
336
+ <label>
337
+ <input name="ht_ctc_chat_options[hideon_desktop]" type="checkbox" value="1" <?php checked( $options['hideon_desktop'], 1 ); ?> id="hideon_desktop" />
338
+ <span>Hide on - Desktop Devices</span>
339
+ </label>
340
+ </p>
341
+ <?php
342
+ } else {
343
+ ?>
344
+ <p>
345
+ <label>
346
+ <input name="ht_ctc_chat_options[hideon_desktop]" type="checkbox" value="1" id="hideon_desktop" />
347
+ <span>Hide on - Desktop Devices</span>
348
+ </label>
349
+ </p>
350
+ <?php
351
+ }
352
+ ?>
353
+ <!-- <p class="description">plugin detects device based on HTTP User agent </p> -->
354
+ <p class="description">If working in reverse it might be the cache plugin not detecting the devices - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/hide-based-on-device/">more info</a> </p>
355
+
356
+
357
+ <div class="row" style="margin-bottom: 0px;">
358
+ <div class="input-field col s12">
359
+ <select name="ht_ctc_chat_options[show_or_hide]" class="select_show_or_hide">
360
+ <option value="hide" <?php echo $show_or_hide == "hide" ? 'SELECTED' : ''; ?> >Hide on selected pages</option>
361
+ <option value="show" <?php echo $show_or_hide == "show" ? 'SELECTED' : ''; ?> >Show on selected pages</option>
362
+ </select>
363
+ <!-- <label><?php _e( 'enable' , 'click-to-chat-for-whatsapp' ) ?></label> -->
364
+ </div>
365
+ </div>
366
+ <?php
367
+
368
+ // ######### Hide #########
369
+
370
+ ?>
371
+ <p class="description ctc_show_hide_display show-hide_display-none hidebased" style="margin-bottom: 15px">
372
+ <?php echo 'Select pages to Hide styles <span style="color: green;"> ( Default Shows on all page ) ' ?>
373
+ </p>
374
+ <!-- <br><br> -->
375
+ <?php
376
+
377
+ // checkboxes - Hide based on Type of posts
378
+
379
+ // Single Posts
380
+ if ( isset( $options['hideon_posts'] ) ) {
381
+ ?>
382
+ <p class="ctc_show_hide_display show-hide_display-none hidebased">
383
+ <label>
384
+ <input name="ht_ctc_chat_options[hideon_posts]" type="checkbox" value="1" <?php checked( $options['hideon_posts'], 1 ); ?> id="filled-in-box1" />
385
+ <span>Hide on - Posts</span>
386
+ </label>
387
+ </p>
388
+ <?php
389
+ } else {
390
+ ?>
391
+ <p class="ctc_show_hide_display show-hide_display-none hidebased">
392
+ <label>
393
+ <input name="ht_ctc_chat_options[hideon_posts]" type="checkbox" value="1" id="filled-in-box1" />
394
+ <span>Hide on - Posts</span>
395
+ </label>
396
+ </p>
397
+ <?php
398
+ }
399
+
400
+
401
+ // Page
402
+ if ( isset( $options['hideon_page'] ) ) {
403
+ ?>
404
+ <p class="ctc_show_hide_display show-hide_display-none hidebased">
405
+ <label>
406
+ <input name="ht_ctc_chat_options[hideon_page]" type="checkbox" value="1" <?php checked( $options['hideon_page'], 1 ); ?> id="filled-in-box2" />
407
+ <span>Hide on - Pages</span>
408
+ </label>
409
+ </p>
410
+ <?php
411
+ } else {
412
+ ?>
413
+ <p class="ctc_show_hide_display show-hide_display-none hidebased">
414
+ <label>
415
+ <input name="ht_ctc_chat_options[hideon_page]" type="checkbox" value="1" id="filled-in-box2" />
416
+ <span>Hide on - Pages</span>
417
+ </label>
418
+ </p>
419
+ <?php
420
+ }
421
+
422
+
423
+
424
+
425
+ // Home Page
426
+ // is_home and is_front_page - combined. calling as home/front page
427
+ if ( isset( $options['hideon_homepage'] ) ) {
428
+ ?>
429
+ <p class="ctc_show_hide_display show-hide_display-none hidebased">
430
+ <label>
431
+ <input name="ht_ctc_chat_options[hideon_homepage]" type="checkbox" value="1" <?php checked( $options['hideon_homepage'], 1 ); ?> id="filled-in-box3" />
432
+ <span>Hide on - Home/Front Page</span>
433
+ </label>
434
+ </p>
435
+ <?php
436
+ } else {
437
+ ?>
438
+ <p class="ctc_show_hide_display show-hide_display-none hidebased">
439
+ <label>
440
+ <input name="ht_ctc_chat_options[hideon_homepage]" type="checkbox" value="1" id="filled-in-box3" />
441
+ <span>Hide on - Home/Front Page</span>
442
+ </label>
443
+ </p>
444
+ <?php
445
+ }
446
+
447
+
448
+ // Category
449
+ if ( isset( $options['hideon_category'] ) ) {
450
+ ?>
451
+ <p class="ctc_show_hide_display show-hide_display-none hidebased">
452
+ <label>
453
+ <input name="ht_ctc_chat_options[hideon_category]" type="checkbox" value="1" <?php checked( $options['hideon_category'], 1 ); ?> id="filled-in-box5" />
454
+ <span>Hide on - Category</span>
455
+ </label>
456
+ </p>
457
+ <?php
458
+ } else {
459
+ ?>
460
+ <p class="ctc_show_hide_display show-hide_display-none hidebased">
461
+ <label>
462
+ <input name="ht_ctc_chat_options[hideon_category]" type="checkbox" value="1" id="filled-in-box5" />
463
+ <span>Hide on - Category</span>
464
+ </label>
465
+ </p>
466
+ <?php
467
+ }
468
+
469
+
470
+
471
+ // Archive
472
+ if ( isset( $options['hideon_archive'] ) ) {
473
+ ?>
474
+ <p class="ctc_show_hide_display show-hide_display-none hidebased">
475
+ <label>
476
+ <input name="ht_ctc_chat_options[hideon_archive]" type="checkbox" value="1" <?php checked( $options['hideon_archive'], 1 ); ?> id="filled-in-box6" />
477
+ <span>Hide on - Archive</span>
478
+ </label>
479
+ </p>
480
+ <?php
481
+ } else {
482
+ ?>
483
+ <p class="ctc_show_hide_display show-hide_display-none hidebased">
484
+ <label>
485
+ <input name="ht_ctc_chat_options[hideon_archive]" type="checkbox" value="1" id="filled-in-box6" />
486
+ <span>Hide on - Archive</span>
487
+ </label>
488
+ </p>
489
+ <?php
490
+ }
491
+
492
+
493
+ // 404 Page
494
+ if ( isset( $options['hideon_404'] ) ) {
495
+ ?>
496
+ <p class="ctc_show_hide_display show-hide_display-none hidebased">
497
+ <label>
498
+ <input name="ht_ctc_chat_options[hideon_404]" type="checkbox" value="1" <?php checked( $options['hideon_404'], 1 ); ?> id="filled-in-box7" />
499
+ <span>Hide on - 404 Page</span>
500
+ </label>
501
+ </p>
502
+ <?php
503
+ } else {
504
+ ?>
505
+ <p class="ctc_show_hide_display show-hide_display-none hidebased">
506
+ <label>
507
+ <input name="ht_ctc_chat_options[hideon_404]" type="checkbox" value="1" id="filled-in-box7" />
508
+ <span>Hide on - 404 Page</span>
509
+ </label>
510
+ </p>
511
+ <?php
512
+ }
513
+
514
+
515
+ // WooCommerce single product pages
516
+ if ( isset( $options['hideon_wooproduct'] ) ) {
517
+ ?>
518
+ <p class="ctc_show_hide_display show-hide_display-none hidebased">
519
+ <label>
520
+ <input name="ht_ctc_chat_options[hideon_wooproduct]" type="checkbox" value="1" <?php checked( $options['hideon_wooproduct'], 1 ); ?> id="filled-in-box7" />
521
+ <span>Hide on - WooCommerce single product pages</span>
522
+ </label>
523
+ </p>
524
+ <?php
525
+ } else {
526
+ ?>
527
+ <p class="ctc_show_hide_display show-hide_display-none hidebased">
528
+ <label>
529
+ <input name="ht_ctc_chat_options[hideon_wooproduct]" type="checkbox" value="1" id="filled-in-box7" />
530
+ <span>Hide on - WooCommerce single product pages</span>
531
+ </label>
532
+ </p>
533
+ <?php
534
+ }
535
+
536
+
537
+ ?>
538
+ <p class="description ctc_show_hide_display show-hide_display-none hidebased">Check to hide Styles based on the type of pages</p>
539
+ <?php
540
+
541
+
542
+
543
+
544
+ // ID's list to hide styles
545
+
546
+ ?>
547
+ <div class="row ctc_show_hide_display show-hide_display-none hidebased">
548
+ <div class="input-field col s12">
549
+ <input name="ht_ctc_chat_options[list_hideon_pages]" value="<?php echo esc_attr( $options['list_hideon_pages'] ) ?>" id="ccw_list_id_tohide" type="text" class="input-margin">
550
+ <label for="ccw_list_id_tohide">Id's list to Hide - add ',' after each id </label>
551
+ <p class="description"> Add Post, Page, Media - ID's to hide, can add multiple id's by separating with a comma ( , ) </p>
552
+ </div>
553
+ </div>
554
+ <?php
555
+
556
+
557
+ // Categorys list - to hide
558
+
559
+ ?>
560
+ <div class="row ctc_show_hide_display show-hide_display-none hidebased">
561
+ <div class="input-field col s12">
562
+ <input name="ht_ctc_chat_options[list_hideon_cat]" value="<?php echo esc_attr( $options['list_hideon_cat'] ) ?>" id="ccw_list_cat_tohide" type="text" class="input-margin">
563
+ <label for="ccw_list_cat_tohide"><?php _e( 'Category name\'s to Hide - add \',\' after each category name' , 'click-to-chat-for-whatsapp' ) ?> </label>
564
+ <p class="description">Add Categories name to hide, can add multiple Categories by separating with a comma ( , ) </p>
565
+ </div>
566
+ </div>
567
+ <?php
568
+
569
+
570
+ // ######### Show #########
571
+
572
+
573
+ ?>
574
+ <p class="description ctc_show_hide_display show-hide_display-none showbased" style="margin-bottom: 15px">
575
+ <?php echo 'Select pages to display styles <span style="background-color: #dddddd; color: red;"> ( Default hides on all page ) ' ?>
576
+ </p>
577
+ <?php
578
+
579
+ // checkboxes - Show based on Type of posts
580
+
581
+ // Single Posts
582
+ if ( isset( $options['showon_posts'] ) ) {
583
+ ?>
584
+ <p class="ctc_show_hide_display show-hide_display-none showbased">
585
+ <label>
586
+ <input name="ht_ctc_chat_options[showon_posts]" type="checkbox" value="1" <?php checked( $options['showon_posts'], 1 ); ?> id="show_filled-in-box1" />
587
+ <span>Show on - Posts</span>
588
+ </label>
589
+ </p>
590
+ <?php
591
+ } else {
592
+ ?>
593
+ <p class="ctc_show_hide_display show-hide_display-none showbased">
594
+ <label>
595
+ <input name="ht_ctc_chat_options[showon_posts]" type="checkbox" value="1" id="show_filled-in-box1" />
596
+ <span>Show on - Posts</span>
597
+ </label>
598
+ </p>
599
+ <?php
600
+ }
601
+
602
+
603
+ // Page
604
+ if ( isset( $options['showon_page'] ) ) {
605
+ ?>
606
+ <p class="ctc_show_hide_display show-hide_display-none showbased">
607
+ <label>
608
+ <input name="ht_ctc_chat_options[showon_page]" type="checkbox" value="1" <?php checked( $options['showon_page'], 1 ); ?> id="show_filled-in-box2" />
609
+ <span>Show on - Pages</span>
610
+ </label>
611
+ </p>
612
+ <?php
613
+ } else {
614
+ ?>
615
+ <p class="ctc_show_hide_display show-hide_display-none showbased">
616
+ <label>
617
+ <input name="ht_ctc_chat_options[showon_page]" type="checkbox" value="1" id="show_filled-in-box2" />
618
+ <span>Show on - Pages</span>
619
+ </label>
620
+ </p>
621
+ <?php
622
+ }
623
+
624
+
625
+ // Home Page
626
+ // is_home and is_front_page - combined. calling as home/front page
627
+ if ( isset( $options['showon_homepage'] ) ) {
628
+ ?>
629
+ <p class="ctc_show_hide_display show-hide_display-none showbased">
630
+ <label>
631
+ <input name="ht_ctc_chat_options[showon_homepage]" type="checkbox" value="1" <?php checked( $options['showon_homepage'], 1 ); ?> id="show_filled-in-box3" />
632
+ <span>Show on - Home/Front Page</span>
633
+ </label>
634
+ </p>
635
+ <?php
636
+ } else {
637
+ ?>
638
+ <p class="ctc_show_hide_display show-hide_display-none showbased">
639
+ <label>
640
+ <input name="ht_ctc_chat_options[showon_homepage]" type="checkbox" value="1" id="show_filled-in-box3" />
641
+ <span>Show on - Home/Front Page</span>
642
+ </label>
643
+ </p>
644
+ <?php
645
+ }
646
+
647
+
648
+ // Category
649
+ if ( isset( $options['showon_category'] ) ) {
650
+ ?>
651
+ <p class="ctc_show_hide_display show-hide_display-none showbased">
652
+ <label>
653
+ <input name="ht_ctc_chat_options[showon_category]" type="checkbox" value="1" <?php checked( $options['showon_category'], 1 ); ?> id="show_filled-in-box5" />
654
+ <span>Show on - Category</span>
655
+ </label>
656
+ </p>
657
+ <?php
658
+ } else {
659
+ ?>
660
+ <p class="ctc_show_hide_display show-hide_display-none showbased">
661
+ <label>
662
+ <input name="ht_ctc_chat_options[showon_category]" type="checkbox" value="1" id="show_filled-in-box5" />
663
+ <span>Show on - Category</span>
664
+ </label>
665
+ </p>
666
+ <?php
667
+ }
668
+
669
+ // Archive
670
+ if ( isset( $options['showon_archive'] ) ) {
671
+ ?>
672
+ <p class="ctc_show_hide_display show-hide_display-none showbased">
673
+ <label>
674
+ <input name="ht_ctc_chat_options[showon_archive]" type="checkbox" value="1" <?php checked( $options['showon_archive'], 1 ); ?> id="show_filled-in-box6" />
675
+ <span>Show on - Archive</span>
676
+ </label>
677
+ </p>
678
+ <?php
679
+ } else {
680
+ ?>
681
+ <p class="ctc_show_hide_display show-hide_display-none showbased">
682
+ <label>
683
+ <input name="ht_ctc_chat_options[showon_archive]" type="checkbox" value="1" id="show_filled-in-box6" />
684
+ <span>Show on - Archive</span>
685
+ </label>
686
+ </p>
687
+ <?php
688
+ }
689
+
690
+
691
+ // 404 Page
692
+ if ( isset( $options['showon_404'] ) ) {
693
+ ?>
694
+ <p class="ctc_show_hide_display show-hide_display-none showbased">
695
+ <label>
696
+ <input name="ht_ctc_chat_options[showon_404]" type="checkbox" value="1" <?php checked( $options['showon_404'], 1 ); ?> id="show_filled-in-box7" />
697
+ <span>Show on - 404 Page</span>
698
+ </label>
699
+ </p>
700
+ <?php
701
+ } else {
702
+ ?>
703
+ <p class="ctc_show_hide_display show-hide_display-none showbased">
704
+ <label>
705
+ <input name="ht_ctc_chat_options[showon_404]" type="checkbox" value="1" id="show_filled-in-box7" />
706
+ <span>Show on - 404 Page</span>
707
+ </label>
708
+ </p>
709
+ <?php
710
+ }
711
+
712
+
713
+ // WooCommerce single product pages
714
+ if ( isset( $options['showon_wooproduct'] ) ) {
715
+ ?>
716
+ <p class="ctc_show_hide_display show-hide_display-none showbased">
717
+ <label>
718
+ <input name="ht_ctc_chat_options[showon_wooproduct]" type="checkbox" value="1" <?php checked( $options['showon_wooproduct'], 1 ); ?> id="show_filled-in-box7" />
719
+ <span>Show on - WooCommerce Single product pages</span>
720
+ </label>
721
+ </p>
722
+ <?php
723
+ } else {
724
+ ?>
725
+ <p class="ctc_show_hide_display show-hide_display-none showbased">
726
+ <label>
727
+ <input name="ht_ctc_chat_options[showon_wooproduct]" type="checkbox" value="1" id="show_filled-in-box7" />
728
+ <span>Show on - WooCommerce Single product pages</span>
729
+ </label>
730
+ </p>
731
+ <?php
732
+ }
733
+
734
+
735
+ ?>
736
+ <p class="description ctc_show_hide_display show-hide_display-none showbased">Check to display Styles based on type of the page</p>
737
+ <?php
738
+
739
+
740
+ // ID's list to show styles
741
+
742
+ ?>
743
+ <div class="row ctc_show_hide_display show-hide_display-none showbased">
744
+ <div class="input-field col s12">
745
+ <input name="ht_ctc_chat_options[list_showon_pages]" value="<?php echo esc_attr( $options['list_showon_pages'] ) ?>" id="ccw_list_id_toshow" type="text" class="input-margin">
746
+ <label for="ccw_list_id_toshow">Id's list to show - add ',' after each id </label>
747
+ <p class="description"> Add Post, Page, Media - ID's to show styles, can add multiple id's by separating with a comma ( , ) </p>
748
+ </div>
749
+ </div>
750
+ <?php
751
+
752
+
753
+ // Categorys list - to show
754
+
755
+ // $ccw_list_cat_toshow = get_option('ht_ctc_chat_options');
756
+
757
+ ?>
758
+ <div class="row ctc_show_hide_display show-hide_display-none showbased">
759
+ <div class="input-field col s12">
760
+ <input name="ht_ctc_chat_options[list_showon_cat]" value="<?php echo esc_attr( $options['list_showon_cat'] ) ?>" id="ccw_list_cat_toshow" type="text" class="input-margin">
761
+ <label for="ccw_list_cat_toshow"><?php _e( 'Category name\'s to Show - add \',\' after each category name' , 'click-to-chat-for-whatsapp' ) ?> </label>
762
+ <p class="description">Add Categories name to show styles, can add multiple Categories by separating with a comma ( , ) </p>
763
+ </div>
764
+ </div>
765
+
766
+
767
+ <p class="description"><a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/show-hide-styles/">more info</a> </p>
768
+
769
+
770
+
771
+ </div>
772
+ </li>
773
+ <ul>
774
+
775
+
776
+ <?php
777
+
778
+ }
779
+
780
+
781
+
782
+ function chat_shortcode_cb() {
783
+ ?>
784
+ <p class="description">Shorcodes for Chat: [ht-ctc-chat] - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/shortcodes-chat">more info</a></p>
785
+ <?php
786
+ }
787
+
788
+
789
+ /**
790
+ * Sanitize each setting field as needed
791
+ *
792
+ * @since 2.0
793
+ * @param array $input Contains all settings fields as array keys
794
+ */
795
+ public function options_sanitize( $input ) {
796
+
797
+ if ( ! current_user_can( 'manage_options' ) ) {
798
+ wp_die( 'not allowed to modify - please contact admin ' );
799
+ }
800
+
801
+ $new_input = array();
802
+
803
+ foreach ($input as $key => $value) {
804
+ if( isset( $input[$key] ) ) {
805
+ $new_input[$key] = sanitize_text_field( $input[$key] );
806
+ }
807
+ }
808
+
809
+
810
+ return $new_input;
811
+ }
812
+
813
+
814
+ }
815
+
816
+ $ht_ctc_admin_chat_page = new HT_CTC_Admin_Chat_Page();
817
+
818
+ add_action('admin_menu', array($ht_ctc_admin_chat_page, 'menu') );
819
+ add_action('admin_init', array($ht_ctc_admin_chat_page, 'settings') );
820
+
821
+ endif; // END class_exists check
new/admin/class-ht-ctc-admin-customize-styles.php ADDED
@@ -0,0 +1,910 @@
1
+ <?php
2
+ /**
3
+ * Customize Styles ( cs )
4
+ *
5
+ * @package Admin
6
+ * @since 2.0
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) exit;
10
+
11
+ if ( ! class_exists( 'HT_CTC_Admin_Customize_Styles' ) ) :
12
+
13
+ class HT_CTC_Admin_Customize_Styles {
14
+
15
+ public function menu() {
16
+
17
+ add_submenu_page(
18
+ 'click-to-chat',
19
+ 'Customize Styles',
20
+ 'Customize Styles',
21
+ 'manage_options',
22
+ 'click-to-chat-customize-styles',
23
+ array( $this, 'settings_page' )
24
+ );
25
+ }
26
+
27
+ public function settings_page() {
28
+
29
+ if ( ! current_user_can('manage_options') ) {
30
+ return;
31
+ }
32
+
33
+ ?>
34
+
35
+ <div class="wrap">
36
+
37
+ <?php settings_errors(); ?>
38
+
39
+ <div class="row">
40
+ <div class="col s12 m12 xl8 options">
41
+ <form action="options.php" method="post" class="">
42
+ <?php settings_fields( 'ht_ctc_cs_page_settings_fields' ); ?>
43
+ <?php do_settings_sections( 'ht_ctc_cs_page_settings_sections_do' ) ?>
44
+ <?php submit_button() ?>
45
+ </form>
46
+ </div>
47
+ <!-- <div class="col s12 m12 xl6 ht-cc-admin-sidebar">
48
+ </div> -->
49
+ </div>
50
+
51
+ </div>
52
+
53
+ <?php
54
+
55
+ }
56
+
57
+
58
+
59
+ public function settings() {
60
+
61
+ register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s1' , array( $this, 'options_sanitize' ) );
62
+ register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s2' , array( $this, 'options_sanitize' ) );
63
+ register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s3' , array( $this, 'options_sanitize' ) );
64
+ register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s4' , array( $this, 'options_sanitize' ) );
65
+ register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s5' , array( $this, 'options_sanitize' ) );
66
+ register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s6' , array( $this, 'options_sanitize' ) );
67
+ register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s7' , array( $this, 'options_sanitize' ) );
68
+ register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s8' , array( $this, 'options_sanitize' ) );
69
+ register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s99' , array( $this, 'options_sanitize' ) );
70
+
71
+ add_settings_section( 'ht_ctc_cs_settings_sections_add', '', array( $this, 'main_settings_section_cb' ), 'ht_ctc_cs_page_settings_sections_do' );
72
+
73
+ add_settings_field( 'ht_ctc_s1', 'Style-1', array( $this, 'ht_ctc_s1_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add' );
74
+ add_settings_field( 'ht_ctc_s2', 'Style-2', array( $this, 'ht_ctc_s2_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add' );
75
+ add_settings_field( 'ht_ctc_s3', 'Style-3', array( $this, 'ht_ctc_s3_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add' );
76
+ add_settings_field( 'ht_ctc_s4', 'Style-4', array( $this, 'ht_ctc_s4_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add' );
77
+ add_settings_field( 'ht_ctc_s5', 'Style-5', array( $this, 'ht_ctc_s5_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add' );
78
+ add_settings_field( 'ht_ctc_s6', 'Style-6', array( $this, 'ht_ctc_s6_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add' );
79
+ add_settings_field( 'ht_ctc_s7', 'Style-7', array( $this, 'ht_ctc_s7_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add' );
80
+ add_settings_field( 'ht_ctc_s8', 'Style-8', array( $this, 'ht_ctc_s8_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add' );
81
+ add_settings_field( 'ht_ctc_s99', 'Style-99', array( $this, 'ht_ctc_s99_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add' );
82
+
83
+
84
+ }
85
+
86
+ public function main_settings_section_cb() {
87
+ ?>
88
+ <h1>Customize Styles</h1>
89
+ <?php
90
+ }
91
+
92
+
93
+ // style-1 - default theme button
94
+ function ht_ctc_s1_cb() {
95
+
96
+ $options = get_option('ht_ctc_s1');
97
+ ?>
98
+ <ul class="collapsible" data-collapsible="accordion">
99
+ <li>
100
+ <div class="collapsible-header">Style 1</div>
101
+ <div class="collapsible-body">
102
+
103
+ <p class="description">Style-1 is a button that appears like themes button</p>
104
+
105
+ </div>
106
+ </div>
107
+ </li>
108
+ </ul>
109
+
110
+ <?php
111
+ }
112
+
113
+
114
+
115
+ // style-2 - ht_ctc_s2 - whatsapp ios style icon
116
+ function ht_ctc_s2_cb() {
117
+
118
+ $options = get_option('ht_ctc_s2');
119
+ ?>
120
+ <ul class="collapsible" data-collapsible="accordion">
121
+ <li>
122
+ <div class="collapsible-header">Style 2</div>
123
+ <div class="collapsible-body">
124
+
125
+
126
+ <!-- img size -->
127
+ <div class="row">
128
+ <div class="col s6">
129
+ <p>Image Size</p>
130
+ </div>
131
+ <div class="input-field col s6">
132
+ <input name="ht_ctc_s2[s2_img_size]" value="<?php echo esc_attr( $options['s2_img_size'] ) ?>" id="s2_img_size" type="text" class="" >
133
+ <label for="s2_img_size">Image Size</label>
134
+ </div>
135
+ </div>
136
+
137
+ <!-- call to action on hover - title -->
138
+ <div class="row">
139
+ <div class="col s6">
140
+ <p>Call to action on hover</p>
141
+ </div>
142
+ <div class="input-field col s6">
143
+ <?php
144
+ if ( isset( $options['cta_on_hover'] ) ) {
145
+ ?>
146
+ <p>
147
+ <label>
148
+ <input name="ht_ctc_s2[cta_on_hover]" type="checkbox" value="1" <?php checked( $options['cta_on_hover'], 1 ); ?> id="cta_on_hover_s2" />
149
+ <span>Display Call to action on hover</span>
150
+ </label>
151
+ </p>
152
+ <?php
153
+ } else {
154
+ ?>
155
+ <p>
156
+ <label>
157
+ <input name="ht_ctc_s2[cta_on_hover]" type="checkbox" value="1" id="cta_on_hover_s2" />
158
+ <span>Display Call to action on hover</span>
159
+ </label>
160
+ </p>
161
+ <?php
162
+ }
163
+ ?>
164
+ </div>
165
+ </div>
166
+
167
+
168
+ </div>
169
+ </div>
170
+ </li>
171
+ </ul>
172
+
173
+ <?php
174
+ }
175
+
176
+
177
+
178
+ // style-3 - ht_ctc_s3 - whatsapp andriod style icon
179
+ function ht_ctc_s3_cb() {
180
+
181
+ $options = get_option('ht_ctc_s3');
182
+ ?>
183
+ <ul class="collapsible" data-collapsible="accordion">
184
+ <li>
185
+ <div class="collapsible-header">Style 3</div>
186
+ <div class="collapsible-body">
187
+
188
+ <!-- img size -->
189
+ <div class="row">
190
+ <div class="col s6">
191
+ <p>Image Size</p>
192
+ </div>
193
+ <div class="input-field col s6">
194
+ <input name="ht_ctc_s3[s3_img_size]" value="<?php echo esc_attr( $options['s3_img_size'] ) ?>" id="s3_img_size" type="text" class="" >
195
+ <label for="s3_img_size">Image Size</label>
196
+ </div>
197
+ </div>
198
+
199
+ <!-- call to action on hover - title -->
200
+ <div class="row">
201
+ <div class="col s6">
202
+ <p>Call to action on hover</p>
203
+ </div>
204
+ <div class="input-field col s6">
205
+ <?php
206
+ if ( isset( $options['cta_on_hover'] ) ) {
207
+ ?>
208
+ <p>
209
+ <label>
210
+ <input name="ht_ctc_s3[cta_on_hover]" type="checkbox" value="1" <?php checked( $options['cta_on_hover'], 1 ); ?> id="cta_on_hover_s3" />
211
+ <span>Display Call to action on hover</span>
212
+ </label>
213
+ </p>
214
+ <?php
215
+ } else {
216
+ ?>
217
+ <p>
218
+ <label>
219
+ <input name="ht_ctc_s3[cta_on_hover]" type="checkbox" value="1" id="cta_on_hover_s3" />
220
+ <span>Display Call to action on hover</span>
221
+ </label>
222
+ </p>
223
+ <?php
224
+ }
225
+ ?>
226
+ </div>
227
+ </div>
228
+
229
+ </div>
230
+ </div>
231
+ </li>
232
+ </ul>
233
+
234
+ <?php
235
+ }
236
+
237
+
238
+
239
+ // style-4 - ht_ctc_s4 - chip
240
+ function ht_ctc_s4_cb() {
241
+
242
+ $options = get_option('ht_ctc_s4');
243
+ ?>
244
+ <ul class="collapsible" data-collapsible="accordion">
245
+ <li>
246
+ <div class="collapsible-header">Style 4</div>
247
+ <div class="collapsible-body">
248
+
249
+ <!-- text color -->
250
+ <div class="row">
251
+ <div class="col s6">
252
+ <p>Text Color</p>
253
+ </div>
254
+ <div class="input-field col s6">
255
+ <input class="ht-ctc-color" name="ht_ctc_s4[s4_text_color]" data-default-color="#7f7d7d" value="<?php echo esc_attr( $options['s4_text_color'] ) ?>" id="s4_text_color" type="text">
256
+ </div>
257
+ </div>
258
+
259
+ <!-- background color -->
260
+ <div class="row">
261
+ <div class="col s6">
262
+ <p>Background Color</p>
263
+ </div>
264
+ <div class="input-field col s6">
265
+ <input id="s4_bg_color" class="ht-ctc-color" data-default-color="#e4e4e4" name="ht_ctc_s4[s4_bg_color]" value="<?php echo esc_attr( $options['s4_bg_color'] ) ?>" type="text" style="height: 1.375rem;" >
266
+ </div>
267
+ </div>
268
+
269
+ <!-- image url -->
270
+ <div class="row">
271
+ <div class="col s6">
272
+ <p>Image URL</p>
273
+ </div>
274
+ <div class="input-field col s6">
275
+ <input name="ht_ctc_s4[s4_img_url]" value="<?php echo esc_attr( $options['s4_img_url'] ) ?>" id="s4_img_url" type="text" class="" >
276
+ <label for="s4_img_url">Image URL</label>
277
+ </div>
278
+ </div>
279
+
280
+
281
+
282
+ </div>
283
+ </div>
284
+ </li>
285
+ </ul>
286
+
287
+ <?php
288
+ }
289
+
290
+
291
+
292
+ // style-5 - ht_ctc_s5 - chip
293
+ function ht_ctc_s5_cb() {
294
+
295
+ $options = get_option('ht_ctc_s5');
296
+ ?>
297
+ <ul class="collapsible" data-collapsible="accordion">
298
+ <li>
299
+ <div class="collapsible-header">Style 5 ( Beta )</div>
300
+ <div class="collapsible-body">
301
+
302
+ <!-- s5_line_1 -->
303
+ <div class="row">
304
+ <div class="col s6">
305
+ <p>Line 1</p>
306
+ </div>
307
+ <div class="input-field col s6">
308
+ <input name="ht_ctc_s5[s5_line_1]" value="<?php echo esc_attr( $options['s5_line_1'] ) ?>" id="s5_line_1" type="text" class="" >
309
+ <label for="s5_line_1">Line 1</label>
310
+ </div>
311
+ </div>
312
+
313
+ <!-- s5_line_2 -->
314
+ <div class="row">
315
+ <div class="col s6">
316
+ <p>Line 2</p>
317
+ </div>
318
+ <div class="input-field col s6">
319
+ <input name="ht_ctc_s5[s5_line_2]" value="<?php echo esc_attr( $options['s5_line_2'] ) ?>" id="s5_line_2" type="text" class="" >
320
+ <label for="s5_line_2">Line 2</label>
321
+ </div>
322
+ </div>
323
+
324
+ <!-- s5_line_1_color -->
325
+ <div class="row">
326
+ <div class="col s6">
327
+ <p>Line 1 - Text Color</p>
328
+ </div>
329
+ <div class="input-field col s6">
330
+ <input class="ht-ctc-color" name="ht_ctc_s5[s5_line_1_color]" data-default-color="#000000" value="<?php echo esc_attr( $options['s5_line_1_color'] ) ?>" id="s5_line_1_color" type="text">
331
+ </div>
332
+ </div>
333
+
334
+ <!-- s5_line_2_color -->
335
+ <div class="row">
336
+ <div class="col s6">
337
+ <p>Line 2 - Text Color</p>
338
+ </div>
339
+ <div class="input-field col s6">
340
+ <input class="ht-ctc-color" name="ht_ctc_s5[s5_line_2_color]" data-default-color="#000000" value="<?php echo esc_attr( $options['s5_line_2_color'] ) ?>" id="s5_line_2_color" type="text">
341
+ </div>
342
+ </div>
343
+
344
+ <!-- s5_background_color -->
345
+ <div class="row">
346
+ <div class="col s6">
347
+ <p>Content Box Background Color</p>
348
+ </div>
349
+ <div class="input-field col s6">
350
+ <input class="ht-ctc-color" name="ht_ctc_s5[s5_background_color]" data-default-color="#ffffff" value="<?php echo esc_attr( $options['s5_background_color'] ) ?>" id="s5_background_color" type="text">
351
+ </div>
352
+ </div>
353
+
354
+ <!-- s5_border_color -->
355
+ <div class="row">
356
+ <div class="col s6">
357
+ <p>Content Box Border Color</p>
358
+ </div>
359
+ <div class="input-field col s6">
360
+ <input class="ht-ctc-color" name="ht_ctc_s5[s5_border_color]" data-default-color="#dddddd" value="<?php echo esc_attr( $options['s5_border_color'] ) ?>" id="s5_border_color" type="text">
361
+ </div>
362
+ </div>
363
+
364
+ <!-- s5_img -->
365
+ <div class="row">
366
+ <div class="col s6">
367
+ <p>Image URL</p>
368
+ </div>
369
+ <div class="input-field col s6">
370
+ <input name="ht_ctc_s5[s5_img]" value="<?php echo esc_attr( $options['s5_img'] ) ?>" id="s5_img" type="text" class="" >
371
+ <label for="s5_img">Leave blank for default image</label>
372
+ </div>
373
+ </div>
374
+
375
+ <!-- s5_img_height -->
376
+ <div class="row">
377
+ <div class="col s6">
378
+ <p>Image Height</p>
379
+ </div>
380
+ <div class="input-field col s6">
381
+ <input name="ht_ctc_s5[s5_img_height]" value="<?php echo esc_attr( $options['s5_img_height'] ) ?>" id="s5_img_height" type="text" class="" >
382
+ <label for="s5_img_height">Image Height</label>
383
+ </div>
384
+ </div>
385
+
386
+ <!-- s5_img_width -->
387
+ <div class="row">
388
+ <div class="col s6">
389
+ <p>Image Width</p>
390
+ </div>
391
+ <div class="input-field col s6">
392
+ <input name="ht_ctc_s5[s5_img_width]" value="<?php echo esc_attr( $options['s5_img_width'] ) ?>" id="s5_img_width" type="text" class="" >
393
+ <label for="s5_img_width">Image Width</label>
394
+ </div>
395
+ </div>
396
+
397
+ <!-- s5_content_height -->
398
+ <div class="row">
399
+ <div class="col s6">
400
+ <p>Content Box Height</p>
401
+ </div>
402
+ <div class="input-field col s6">
403
+ <input name="ht_ctc_s5[s5_content_height]" value="<?php echo esc_attr( $options['s5_content_height'] ) ?>" id="s5_content_height" type="text" class="" >
404
+ <label for="s5_content_height">Content Box Height</label>
405
+ </div>
406
+ </div>
407
+
408
+ <!-- s5_content_width -->
409
+ <div class="row">
410
+ <div class="col s6">
411
+ <p>Content Box Width</p>
412
+ </div>
413
+ <div class="input-field col s6">
414
+ <input name="ht_ctc_s5[s5_content_width]" value="<?php echo esc_attr( $options['s5_content_width'] ) ?>" id="s5_content_width" type="text" class="" >
415
+ <label for="s5_content_width">Content Box Width</label>
416
+ </div>
417
+ </div>
418
+
419
+ <!-- s5_img_position -->
420
+ <?php
421
+ $select_s5_img_position = esc_attr( $options['s5_img_position'] );
422
+ ?>
423
+
424
+ <div class="row">
425
+ <div class="col s6">
426
+ <p>Image Position</p>
427
+ </div>
428
+ <div class="input-field col s6">
429
+ <select name="ht_ctc_s5[s5_img_position]" class="select-2">
430
+ <option value="right" <?php echo $select_s5_img_position == 'right' ? 'SELECTED' : ''; ?> >Right</option>
431
+ <option value="left" <?php echo $select_s5_img_position == 'left' ? 'SELECTED' : ''; ?> >Left</option>
432
+ </select>
433
+ <p class="description">If style position/located: Right to screen then select Right, if Left to screen then select Left</p>
434
+ </div>
435
+ </div>
436
+
437
+
438
+
439
+
440
+ </div>
441
+ </div>
442
+ </li>
443
+ </ul>
444
+
445
+ <?php
446
+ }
447
+
448
+
449
+
450
+
451
+ // style-6 - ht_ctc_s6 - plain link
452
+ function ht_ctc_s6_cb() {
453
+
454
+ $options = get_option('ht_ctc_s6');
455
+ ?>
456
+ <ul class="collapsible" data-collapsible="accordion">
457
+ <li>
458
+ <div class="collapsible-header">Style 6</div>
459
+ <div class="collapsible-body">
460
+
461
+ <!-- text color -->
462
+ <div class="row">
463
+ <div class="col s6">
464
+ <p>Text Color</p>
465
+ </div>
466
+ <div class="input-field col s6">
467
+ <!-- <input id="s6_txt_color" class="ht-ctc-color" data-default-color="#006ccc" name="ht_ctc_s6[s6_txt_color]" value="<?php echo esc_attr( $options['s6_txt_color'] ) ?>" type="text" style="height: 1.375rem;" > -->
468
+ <input id="s6_txt_color" class="ht-ctc-color" name="ht_ctc_s6[s6_txt_color]" value="<?php echo esc_attr( $options['s6_txt_color'] ) ?>" type="text" style="height: 1.375rem;" >
469
+ </div>
470
+ </div>
471
+
472
+
473
+ <!-- text color on hover -->
474
+ <div class="row">
475
+ <div class="col s6">
476
+ <p>Text Color on Hover</p>
477
+ </div>
478
+ <div class="input-field col s6">
479
+ <!-- <input id="s6_txt_color_on_hover" class="ht-ctc-color" data-default-color="#006ccc" name="ht_ctc_s6[s6_txt_color_on_hover]" value="<?php echo esc_attr( $options['s6_txt_color_on_hover'] ) ?>" type="text" style="height: 1.375rem;" > -->
480
+ <input id="s6_txt_color_on_hover" class="ht-ctc-color" name="ht_ctc_s6[s6_txt_color_on_hover]" value="<?php echo esc_attr( $options['s6_txt_color_on_hover'] ) ?>" type="text" style="height: 1.375rem;" >
481
+ </div>
482
+ </div>
483
+
484
+ <!-- Text Decoration - none/initial/underline/overline/... -->
485
+ <?php
486
+ $text_decoration_value = esc_attr( $options['s6_txt_decoration'] );
487
+ ?>
488
+
489
+ <div class="row">
490
+ <div class="col s6">
491
+ <p>Text Decoration</p>
492
+ </div>
493
+ <div class="input-field col s6">
494
+ <select name="ht_ctc_s6[s6_txt_decoration]" class="select-2">
495
+ <option value="initial" <?php echo $text_decoration_value == 'initial' ? 'SELECTED' : ''; ?> >initial</option>
496
+ <option value="underline" <?php echo $text_decoration_value == 'underline' ? 'SELECTED' : ''; ?> >underline</option>
497
+ <option value="overline" <?php echo $text_decoration_value == 'overline' ? 'SELECTED' : ''; ?> >overline</option>
498
+ <option value="line-through" <?php echo $text_decoration_value == 'line-through' ? 'SELECTED' : ''; ?> >line-through</option>
499
+ <option value="inherit" <?php echo $text_decoration_value == 'inherit' ? 'SELECTED' : ''; ?> >inherit</option>
500
+ </select>
501
+ <!-- <label>Text Decoration</label> -->
502
+ </div>
503
+ </div>
504
+
505
+ <!-- Text Decoration when hover - none/initial/underline/overline/... -->
506
+ <?php
507
+ $text_decoration_hover_value = $options['s6_txt_decoration_on_hover'];
508
+ ?>
509
+
510
+ <div class="row">
511
+ <div class="col s6">
512
+ <p>Text Decoration when Hover</p>
513
+ </div>
514
+ <div class="input-field col s6">
515
+ <select name="ht_ctc_s6[s6_txt_decoration_on_hover]" class="select-2">
516
+ <option value="initial" <?php echo $text_decoration_hover_value == 'initial' ? 'SELECTED' : ''; ?> >initial</option>
517
+ <option value="underline" <?php echo $text_decoration_hover_value == 'underline' ? 'SELECTED' : ''; ?> >underline</option>
518
+ <option value="overline" <?php echo $text_decoration_hover_value == 'overline' ? 'SELECTED' : ''; ?> >overline</option>
519
+ <option value="line-through" <?php echo $text_decoration_hover_value == 'line-through' ? 'SELECTED' : ''; ?> >line-through</option>
520
+ <option value="inherit" <?php echo $text_decoration_hover_value == 'inherit' ? 'SELECTED' : ''; ?> >inherit</option>
521
+ </select>
522
+ <!-- <label>Text Decoration when Hover</label> -->
523
+ </div>
524
+ </div>
525
+
526
+
527
+
528
+ </div>
529
+ </div>
530
+ </li>
531
+ </ul>
532
+
533
+ <?php
534
+ }
535
+
536
+
537
+ // style-7 - ht_ctc_s7 - plain link
538
+ function ht_ctc_s7_cb() {
539
+
540
+ $options = get_option('ht_ctc_s7');
541
+ ?>
542
+ <ul class="collapsible" data-collapsible="accordion">
543
+ <li>
544
+ <div class="collapsible-header">Style 7</div>
545
+ <div class="collapsible-body">
546
+
547
+
548
+ <!-- call to action on hover - title -->
549
+ <div class="row">
550
+ <div class="col s6">
551
+ <p>Call to action on hover</p>
552
+ </div>
553
+ <div class="input-field col s6">
554
+ <?php
555
+ if ( isset( $options['cta_on_hover'] ) ) {
556
+ ?>
557
+ <p>
558
+ <label>
559
+ <input name="ht_ctc_s7[cta_on_hover]" type="checkbox" value="1" <?php checked( $options['cta_on_hover'], 1 ); ?> id="cta_on_hover_s99" />
560
+ <span>Display Call to action on hover</span>
561
+ </label>
562
+ </p>
563
+ <?php
564
+ } else {
565
+ ?>
566
+ <p>
567
+ <label>
568
+ <input name="ht_ctc_s7[cta_on_hover]" type="checkbox" value="1" id="cta_on_hover_s99" />
569
+ <span>Display Call to action on hover</span>
570
+ </label>
571
+ </p>
572
+ <?php
573
+ }
574
+ ?>
575
+ </div>
576
+ </div>
577
+
578
+
579
+ <!-- s7_icon_size -->
580
+ <div class="row">
581
+ <div class="col s6">
582
+ <p>Icon Size</p>
583
+ </div>
584
+ <div class="input-field col s6">
585
+ <input name="ht_ctc_s7[s7_icon_size]" value="<?php echo esc_attr( $options['s7_icon_size'] ) ?>" id="s7_icon_size" type="text" class="" >
586
+ <label for="s7_icon_size">Icon Size</label>
587
+ </div>
588
+ </div>
589
+
590
+ <!-- s7_icon_color -->
591
+ <div class="row">
592
+ <div class="col s6">
593
+ <p>Icon Color</p>
594
+ </div>
595
+ <div class="input-field col s6">
596
+ <input id="s7_icon_color" class="ht-ctc-color" data-default-color="#ffffff" name="ht_ctc_s7[s7_icon_color]" value="<?php echo esc_attr( $options['s7_icon_color'] ) ?>" type="text" style="height: 1.375rem;" >
597
+ </div>
598
+ </div>
599
+
600
+ <!-- s7_icon_color_hover -->
601
+ <div class="row">
602
+ <div class="col s6">
603
+ <p>Icon Color on Hover</p>
604
+ </div>
605
+ <div class="input-field col s6">
606
+ <input id="s7_icon_color_hover" class="ht-ctc-color" data-default-color="#6b6b6b" name="ht_ctc_s7[s7_icon_color_hover]" value="<?php echo esc_attr( $options['s7_icon_color_hover'] ) ?>" type="text" style="height: 1.375rem;" >
607
+ </div>
608
+ </div>
609
+
610
+ <!-- s7_border_size -->
611
+ <div class="row">
612
+ <div class="col s6">
613
+ <p>Border Padding Size</p>
614
+ </div>
615
+ <div class="input-field col s6">
616
+ <input name="ht_ctc_s7[s7_border_size]" value="<?php echo esc_attr( $options['s7_border_size'] ) ?>" id="s7_border_size" type="text" class="" >
617
+ <label for="s7_border_size">Border Padding Size</label>
618
+ <p class="description">E.g. 12px</p>
619
+ </div>
620
+ </div>
621
+
622
+ <!-- s7_border_color -->
623
+ <div class="row">
624
+ <div class="col s6">
625
+ <p>Border Padding Color</p>
626
+ </div>
627
+ <div class="input-field col s6">
628
+ <input id="s7_border_color" class="ht-ctc-color" data-default-color="#25D366" name="ht_ctc_s7[s7_border_color]" value="<?php echo esc_attr( $options['s7_border_color'] ) ?>" type="text" style="height: 1.375rem;" >
629
+ </div>
630
+ </div>
631
+
632
+ <!-- s7_border_color_hover -->
633
+ <div class="row">
634
+ <div class="col s6">
635
+ <p>Border Padding Color on Hover</p>
636
+ </div>
637
+ <div class="input-field col s6">
638
+ <input id="s7_border_color_hover" class="ht-ctc-color" data-default-color="#25D366" name="ht_ctc_s7[s7_border_color_hover]" value="<?php echo esc_attr( $options['s7_border_color_hover'] ) ?>" type="text" style="height: 1.375rem;" >
639
+ </div>
640
+