Version Description
- Fix: Style-4 img position issue.
- Updated: admin page
Download this release
Release Info
Developer | bhvreddy |
Plugin | Click to Chat for WhatsApp Chat |
Version | 2.12.1 |
Comparing to | |
See all releases |
Code changes from version 2.8.3 to 2.12.1
- click-to-chat.php +12 -10
- common/class-ht-ctc-switch.php +28 -8
- new/admin/admin.php +9 -14
- new/admin/admin_assets/css/admin.css +13 -2
- new/admin/admin_assets/js/admin.js +88 -60
- new/admin/admin_commons/admin-after-settings-page.php +38 -22
- new/admin/admin_commons/admin-desktop.php +116 -0
- new/admin/admin_commons/admin-mobile.php +115 -0
- new/admin/admin_commons/admin-show-hide.php +48 -82
- new/admin/admin_commons/admin-sidebar-content.php +88 -0
- new/admin/admin_commons/class-ht-ctc-admin-others.php +100 -15
- new/admin/admin_commons/class-ht-ctc-metabox.php +54 -61
- new/admin/class-ht-ctc-admin-customize-styles.php +461 -135
- new/admin/class-ht-ctc-admin-group-page.php +35 -124
- new/admin/class-ht-ctc-admin-main-page.php +84 -345
- new/admin/class-ht-ctc-admin-scripts.php +1 -1
- new/admin/class-ht-ctc-admin-share-page.php +48 -151
- new/admin/class-ht-ctc-db.php +73 -60
- new/class-ht-ctc.php +13 -80
- new/inc/assets/css/font.css +1 -35
- new/inc/assets/css/mdstyle8.css +1 -161
- new/inc/assets/img/svg-style-2.php +5 -9
- new/inc/assets/img/svg-style-3.php +33 -8
- new/inc/assets/js/app.dev.js +234 -0
- new/inc/assets/js/app.js +1 -230
- new/inc/assets/js/app.test.js +112 -0
- new/inc/chat/chat-position.php +0 -17
- new/inc/chat/class-ht-ctc-chat-shortcode.php +17 -13
- new/inc/chat/class-ht-ctc-chat.php +83 -61
- new/inc/class-ht-ctc-main.php +9 -14
- new/inc/class-ht-ctc-register.php +24 -26
- new/inc/commons/class-ht-ctc-hooks.php +93 -3
- new/inc/commons/class-ht-ctc-scripts.php +9 -1
- new/inc/commons/class-ht-ctc-values.php +0 -17
- new/inc/commons/position-to-place.php +31 -0
- new/inc/commons/show-hide.php +1 -18
- new/inc/group/class-ht-ctc-group-shortcode.php +5 -20
- new/inc/group/class-ht-ctc-group.php +42 -27
- new/inc/group/group-position.php +0 -17
- new/inc/share/class-ht-ctc-share-shortcode.php +5 -6
- new/inc/share/class-ht-ctc-share.php +40 -19
- new/inc/share/share-position.php +0 -17
- new/inc/styles-shortcode/sc-style-1.php +1 -3
- new/inc/styles-shortcode/sc-style-2.php +1 -3
- new/inc/styles-shortcode/sc-style-3.php +65 -4
- new/inc/styles-shortcode/sc-style-4.php +34 -32
- new/inc/styles-shortcode/sc-style-5.php +4 -48
- new/inc/styles-shortcode/sc-style-6.php +1 -3
- new/inc/styles-shortcode/sc-style-8.php +3 -5
- new/inc/styles-shortcode/sc-style-99.php +1 -3
- new/inc/styles/style-1.php +3 -1
- new/inc/styles/style-2.php +9 -6
- new/inc/styles/style-3.php +49 -6
- new/inc/styles/style-4.php +38 -30
- new/inc/styles/style-5.php +47 -47
- new/inc/styles/style-6.php +0 -2
- new/inc/styles/style-7.php +0 -1
- new/inc/styles/style-8.php +2 -13
- new/inc/styles/style-99.php +1 -4
- new/tools/woo/class-ht-ctc-admin-woo.php +84 -0
- new/tools/woo/class-ht-ctc-woo.php +77 -0
- new/tools/woo/ht-ctc-woo.php +21 -0
- prev/admin/admin.php +1 -1
- prev/admin/class-ccw-add-styles-scripts-admin.php +5 -11
- prev/admin/class-ccw-admin-others.php +2 -2
- prev/admin/class-ccw-admin-page-customize-styles.php +75 -75
- prev/admin/class-ccw-admin-page.php +20 -20
- prev/admin/default-values.php +9 -76
- prev/admin/settings_page.php +25 -47
- prev/assets/js/admin_app.js +3 -32
- prev/assets/js/app.js +1 -4
- prev/inc/class-ccw-add-styles-scripts.php +3 -3
- prev/inc/class-ccw-shortcode.php +7 -19
- prev/inc/class-ht-ccw-chat.php +1 -3
- prev/inc/class-ht-ccw-register.php +2 -2
- prev/inc/class-ht-ccw.php +12 -82
- prev/inc/commons/styles-list-sc/sc-style-3.php +1 -1
- prev/inc/commons/styles-list-sc/sc-style-4.php +1 -1
- prev/inc/commons/styles-list-sc/sc-style-99.php +1 -1
- prev/inc/commons/styles-list/style-2.php +3 -1
- prev/inc/commons/styles-list/style-3.php +4 -2
- prev/inc/commons/styles-list/style-4.php +4 -2
- prev/inc/commons/styles-list/style-5.php +3 -2
- prev/inc/commons/styles-list/style-6.php +4 -3
- prev/inc/commons/styles-list/style-7.php +3 -2
- prev/inc/commons/styles-list/style-8.php +3 -1
- prev/inc/commons/styles-list/style-9.php +4 -3
- prev/inc/commons/styles-list/style-99.php +1 -2
- prev/inc/commons/styles.php +16 -23
- readme.txt +166 -24
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 visitors contact you through WhatsApp with a single click/tap
|
6 |
-
Version: 2.
|
7 |
Author: HoliThemes
|
8 |
Author URI: https://holithemes.com/plugins/click-to-chat/
|
9 |
License: GPL2
|
@@ -15,14 +15,16 @@ if ( ! defined( 'WPINC' ) ) {
|
|
15 |
die('dont try to call this directly');
|
16 |
}
|
17 |
|
18 |
-
//
|
19 |
if ( ! defined( 'HT_CTC_VERSION' ) ) {
|
20 |
-
define( 'HT_CTC_VERSION', '2.
|
21 |
}
|
22 |
|
23 |
-
//
|
24 |
-
|
25 |
-
|
|
|
|
|
26 |
}
|
27 |
|
28 |
// define HT_CTC_PLUGIN_FILE
|
@@ -35,9 +37,9 @@ if ( ! defined( 'HT_CTC_PLUGIN_DIR' ) ) {
|
|
35 |
define( 'HT_CTC_PLUGIN_DIR', plugin_dir_path( HT_CTC_PLUGIN_FILE ) );
|
36 |
}
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
|
43 |
include_once 'common/class-ht-ctc-switch.php';
|
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 visitors contact you through WhatsApp with a single click/tap
|
6 |
+
Version: 2.12.1
|
7 |
Author: HoliThemes
|
8 |
Author URI: https://holithemes.com/plugins/click-to-chat/
|
9 |
License: GPL2
|
15 |
die('dont try to call this directly');
|
16 |
}
|
17 |
|
18 |
+
// ctc - Version
|
19 |
if ( ! defined( 'HT_CTC_VERSION' ) ) {
|
20 |
+
define( 'HT_CTC_VERSION', '2.12.1' );
|
21 |
}
|
22 |
|
23 |
+
// environment - production, staging, development, test
|
24 |
+
// define( 'HT_CTC_ENVIRONMENT', 'development' ); //todo
|
25 |
+
if ( ! defined( 'HT_CTC_ENVIRONMENT' ) ) {
|
26 |
+
define( 'HT_CTC_ENVIRONMENT', 'production' );
|
27 |
+
// define( 'WP_ENVIRONMENT_TYPE', 'production' );
|
28 |
}
|
29 |
|
30 |
// define HT_CTC_PLUGIN_FILE
|
37 |
define( 'HT_CTC_PLUGIN_DIR', plugin_dir_path( HT_CTC_PLUGIN_FILE ) );
|
38 |
}
|
39 |
|
40 |
+
include_once HT_CTC_PLUGIN_DIR .'new/inc/class-ht-ctc-register.php';
|
41 |
+
register_activation_hook( __FILE__, array( 'HT_CTC_Register', 'activate' ) );
|
42 |
+
register_deactivation_hook( __FILE__, array( 'HT_CTC_Register', 'deactivate' ) );
|
43 |
+
register_uninstall_hook(__FILE__, array( 'HT_CTC_Register', 'uninstall' ) );
|
44 |
|
45 |
include_once 'common/class-ht-ctc-switch.php';
|
common/class-ht-ctc-switch.php
CHANGED
@@ -14,8 +14,34 @@ if ( ! class_exists( 'HT_CTC_Swift' ) ) :
|
|
14 |
class HT_CTC_Swift {
|
15 |
|
16 |
public function __construct() {
|
|
|
17 |
$this->to_switch();
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
public function to_switch() {
|
21 |
|
@@ -91,18 +117,12 @@ class HT_CTC_Swift {
|
|
91 |
|
92 |
ht_ccw();
|
93 |
}
|
94 |
-
|
95 |
|
96 |
}
|
97 |
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
|
102 |
}
|
103 |
|
104 |
new HT_CTC_Swift();
|
105 |
|
106 |
-
endif; // END class_exists check
|
107 |
-
|
108 |
-
|
14 |
class HT_CTC_Swift {
|
15 |
|
16 |
public function __construct() {
|
17 |
+
$this->define_constants();
|
18 |
$this->to_switch();
|
19 |
+
}
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Define Constants
|
23 |
+
*/
|
24 |
+
private function define_constants() {
|
25 |
+
|
26 |
+
$this->define( 'HT_CTC_WP_MIN_VERSION', '4.6' );
|
27 |
+
$this->define( 'HT_CTC_PLUGIN_BASENAME', plugin_basename( HT_CTC_PLUGIN_FILE ) );
|
28 |
+
$this->define( 'HT_CTC_BLOG_NAME', get_bloginfo('name') );
|
29 |
+
|
30 |
+
do_action('ht_ctc_ah_define_constants');
|
31 |
+
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* @uses this->define_constants
|
36 |
+
* @param string $name Constant name
|
37 |
+
* @param string.. $value Constant value
|
38 |
+
*/
|
39 |
+
private function define( $name, $value ) {
|
40 |
+
if ( ! defined( $name ) ) {
|
41 |
+
define( $name, $value );
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
|
46 |
public function to_switch() {
|
47 |
|
117 |
|
118 |
ht_ccw();
|
119 |
}
|
|
|
120 |
|
121 |
}
|
122 |
|
|
|
|
|
|
|
123 |
|
124 |
}
|
125 |
|
126 |
new HT_CTC_Swift();
|
127 |
|
128 |
+
endif; // END class_exists check
|
|
|
|
new/admin/admin.php
CHANGED
@@ -14,37 +14,32 @@
|
|
14 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
15 |
|
16 |
|
17 |
-
$
|
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 ( $
|
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 ( $
|
40 |
include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-share-page.php';
|
41 |
}
|
42 |
|
43 |
-
// customize
|
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/admin_commons/class-ht-ctc-metabox.php';
|
48 |
-
|
49 |
-
// others - hooks ....
|
50 |
-
include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/class-ht-ctc-admin-others.php';
|
14 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
15 |
|
16 |
|
17 |
+
$ht_ctc_othersettings = get_option('ht_ctc_othersettings');
|
18 |
|
19 |
|
20 |
/*************** includes ***********/
|
21 |
|
22 |
+
// others - hooks ....
|
23 |
+
include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/class-ht-ctc-admin-others.php';
|
24 |
+
|
25 |
// add scripts
|
26 |
include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-scripts.php';
|
27 |
|
28 |
+
// Main, Chat admin page - enable options ..
|
29 |
include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-main-page.php';
|
30 |
|
|
|
|
|
|
|
|
|
|
|
31 |
// group admin page
|
32 |
+
if ( isset ( $ht_ctc_othersettings['enable_group'] ) ) {
|
33 |
include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-group-page.php';
|
34 |
}
|
35 |
|
36 |
// share admin page
|
37 |
+
if ( isset ( $ht_ctc_othersettings['enable_share'] ) ) {
|
38 |
include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-share-page.php';
|
39 |
}
|
40 |
|
41 |
+
// customize
|
42 |
include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-customize-styles.php';
|
43 |
|
44 |
// meta boxes - change values at page level
|
45 |
+
include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/class-ht-ctc-metabox.php';
|
|
|
|
|
|
new/admin/admin_assets/css/admin.css
CHANGED
@@ -8,8 +8,6 @@
|
|
8 |
display: block;
|
9 |
}
|
10 |
|
11 |
-
|
12 |
-
|
13 |
.options .submit {
|
14 |
position: sticky !important;
|
15 |
bottom: 1px;
|
@@ -22,6 +20,19 @@
|
|
22 |
padding: 2px 11px;
|
23 |
}
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
@media only screen and (min-width: 1201px) {
|
27 |
.sticky-sidebar {
|
8 |
display: block;
|
9 |
}
|
10 |
|
|
|
|
|
11 |
.options .submit {
|
12 |
position: sticky !important;
|
13 |
bottom: 1px;
|
20 |
padding: 2px 11px;
|
21 |
}
|
22 |
|
23 |
+
.description.ht_ctc_pro_description {
|
24 |
+
/* border-left: 5px solid yellowgreen; */
|
25 |
+
border-left: 5px solid lightseagreen;
|
26 |
+
padding: 5px 5px 5px 14px;
|
27 |
+
margin: 19px 0;
|
28 |
+
}
|
29 |
+
|
30 |
+
.description.ht_ctc_subtitle {
|
31 |
+
border-left: 5px solid lightseagreen;
|
32 |
+
/* padding: 5px 5px 5px 14px; */
|
33 |
+
padding-left: 0.9rem;
|
34 |
+
margin: 5px 0;
|
35 |
+
}
|
36 |
|
37 |
@media only screen and (min-width: 1201px) {
|
38 |
.sticky-sidebar {
|
new/admin/admin_assets/js/admin.js
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
// Click to Chat
|
2 |
document.addEventListener('DOMContentLoaded', function() {
|
3 |
|
|
|
|
|
4 |
var elems = document.querySelectorAll('select');
|
5 |
M.FormSelect.init(elems, {});
|
6 |
|
@@ -13,6 +15,9 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
13 |
var elems = document.querySelectorAll('.tooltipped');
|
14 |
M.Tooltip.init(elems, {});
|
15 |
|
|
|
|
|
|
|
16 |
});
|
17 |
|
18 |
|
@@ -25,65 +30,88 @@ jQuery(document).ready(function ($) {
|
|
25 |
|
26 |
$('.ht-ctc-color').wpColorPicker();
|
27 |
|
28 |
-
//
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
|
89 |
});
|
1 |
// Click to Chat
|
2 |
document.addEventListener('DOMContentLoaded', function() {
|
3 |
|
4 |
+
// M.AutoInit();
|
5 |
+
|
6 |
var elems = document.querySelectorAll('select');
|
7 |
M.FormSelect.init(elems, {});
|
8 |
|
15 |
var elems = document.querySelectorAll('.tooltipped');
|
16 |
M.Tooltip.init(elems, {});
|
17 |
|
18 |
+
// var elems = document.querySelectorAll('.tabs');
|
19 |
+
// M.Tabs.getInstance(elems, {});
|
20 |
+
|
21 |
});
|
22 |
|
23 |
|
30 |
|
31 |
$('.ht-ctc-color').wpColorPicker();
|
32 |
|
33 |
+
// show/hide settings
|
34 |
+
function ht_ctc_show_hide_options () {
|
35 |
+
|
36 |
+
// default display
|
37 |
+
var val = $('.select_show_or_hide').find(":selected").val();
|
38 |
+
if (val == 'show') {
|
39 |
+
$(".showbased").show();
|
40 |
+
} else if (val == 'hide') {
|
41 |
+
$(".hidebased").show();
|
42 |
+
}
|
43 |
+
|
44 |
+
// on change
|
45 |
+
$(".select_show_or_hide").on("change", function (e) {
|
46 |
+
|
47 |
+
var change_val = e.target.value;
|
48 |
+
$(".showbased").hide();
|
49 |
+
$(".hidebased").hide();
|
50 |
+
|
51 |
+
if (change_val == 'show') {
|
52 |
+
$(".showbased").show(500);
|
53 |
+
} else if (change_val == 'hide') {
|
54 |
+
$(".hidebased").show(500);
|
55 |
+
}
|
56 |
+
});
|
57 |
+
|
58 |
+
}
|
59 |
+
ht_ctc_show_hide_options();
|
60 |
+
|
61 |
+
// style-3 type
|
62 |
+
function ht_ctc_customize_s3() {
|
63 |
+
|
64 |
+
var s3_type_val = $('.select_style_3_type').find(":selected").val();
|
65 |
+
if (s3_type_val == 'extend') {
|
66 |
+
$(".s3_type_extend").show();
|
67 |
+
} else {
|
68 |
+
$(".s3_type_extend").hide();
|
69 |
+
}
|
70 |
+
|
71 |
+
// on change
|
72 |
+
$(".select_style_3_type").on("change", function (e) {
|
73 |
+
var s3_type_change_val = e.target.value;
|
74 |
+
if (s3_type_change_val == 'extend') {
|
75 |
+
$(".s3_type_extend").show(500);
|
76 |
+
} else {
|
77 |
+
$(".s3_type_extend").hide();
|
78 |
+
}
|
79 |
+
});
|
80 |
+
}
|
81 |
+
ht_ctc_customize_s3();
|
82 |
+
|
83 |
+
|
84 |
+
// on change - styles
|
85 |
+
$(".chat_select_style").on("change", function (e) {
|
86 |
+
$(".customize_styles_link").animate({ fontSize: '1.2em' }, "slow");
|
87 |
+
});
|
88 |
+
|
89 |
+
// Deskop, Mobile
|
90 |
+
if ($('#hideon_desktop').is(':checked')) {
|
91 |
+
$(".ht_ctc_admin_desktop").hide();
|
92 |
+
}
|
93 |
+
|
94 |
+
if ($('#hideon_mobile').is(':checked')) {
|
95 |
+
$(".ht_ctc_admin_mobile").hide();
|
96 |
+
}
|
97 |
+
|
98 |
+
$(".hidebasedondevice").on("change", function (e) {
|
99 |
+
if ($('#hideon_desktop').is(':checked')) {
|
100 |
+
$(".ht_ctc_admin_desktop").hide();
|
101 |
+
} else {
|
102 |
+
$(".ht_ctc_admin_desktop").show();
|
103 |
+
}
|
104 |
+
|
105 |
+
if ($('#hideon_mobile').is(':checked')) {
|
106 |
+
$(".ht_ctc_admin_mobile").hide();
|
107 |
+
} else {
|
108 |
+
$(".ht_ctc_admin_mobile").show();
|
109 |
+
}
|
110 |
+
});
|
111 |
+
|
112 |
+
// hide nothing or hide only on one device.
|
113 |
+
$(document).on('click', '.hidebasedondevice', function () {
|
114 |
+
$('.hidebasedondevice').not(this).prop('checked', false);
|
115 |
+
});
|
116 |
|
117 |
});
|
new/admin/admin_commons/admin-after-settings-page.php
CHANGED
@@ -11,52 +11,68 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
|
11 |
?>
|
12 |
|
13 |
<ul class="collapsible popout">
|
14 |
-
<p class="description" style="text-align: center"
|
15 |
|
16 |
<li>
|
17 |
-
<div class="collapsible-header"
|
18 |
<div class="collapsible-body">
|
19 |
-
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/show-only-on-selected-pages/"
|
20 |
-
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/hide-only-on-selected-pages/"
|
21 |
-
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/show-hide-on-mobile-desktop/"
|
22 |
</div>
|
23 |
</li>
|
24 |
|
25 |
<li>
|
26 |
-
<div class="collapsible-header"
|
27 |
<div class="collapsible-body">
|
28 |
-
<p class="description"
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
</p>
|
33 |
</div>
|
34 |
</li>
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
<!-- <li>
|
37 |
<div class="collapsible-header">Positon to place</div>
|
38 |
<div class="collapsible-body">
|
39 |
<p class="description">Center to the Screen</p>
|
40 |
-
<p class="description">Different
|
41 |
</div>
|
42 |
</li> -->
|
43 |
|
44 |
-
|
45 |
-
<div class="collapsible-header"
|
46 |
<div class="collapsible-body">
|
47 |
-
<p class="description"><a href="http://api.whatsapp.com/send?phone=919494429789&text=<?php echo get_bloginfo('url'); ?>%0AHi%20HoliThemes!!" target="_blank"
|
48 |
-
<p class="description"
|
49 |
</div>
|
50 |
-
</li>
|
51 |
|
52 |
<li>
|
53 |
-
<div class="collapsible-header"
|
54 |
<div class="collapsible-body">
|
55 |
-
<p class="description"><a href="https://www.facebook.com/holithemes/" target="_blank"
|
56 |
-
<p class="description"><a href="https://www.youtube.com/channel/UC2Tf_WB9PWffO2B3tswWCGw" target="_blank"
|
57 |
-
<p class="description"><a href="https://twitter.com/holithemes" target="_blank"
|
58 |
-
<p class="description"><a href="https://www.instagram.com/holithemes/" target="_blank"
|
59 |
-
<p class="description"><a href="https://www.linkedin.com/company/holithemes" target="_blank"
|
60 |
</div>
|
61 |
</li>
|
62 |
|
11 |
?>
|
12 |
|
13 |
<ul class="collapsible popout">
|
14 |
+
<p class="description" style="text-align: center"><?php _e( 'Frequently Asked Questions', 'click-to-chat-for-whatsapp' ); ?></p>
|
15 |
|
16 |
<li>
|
17 |
+
<div class="collapsible-header"><?php _e( 'Show/Hide on Selected pages, devices', 'click-to-chat-for-whatsapp' ); ?></div>
|
18 |
<div class="collapsible-body">
|
19 |
+
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/show-only-on-selected-pages/"><?php _e( 'Show only on selected pages' ) ?></a></p>
|
20 |
+
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/hide-only-on-selected-pages/"><?php _e( 'Hide only on selected pages' ) ?></a></p>
|
21 |
+
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/show-hide-on-mobile-desktop/"><?php _e( 'Show/Hide on Mobile/Desktop' ) ?></a></p>
|
22 |
</div>
|
23 |
</li>
|
24 |
|
25 |
<li>
|
26 |
+
<div class="collapsible-header"><?php _e( 'Change Values(number) at page level', 'click-to-chat-for-whatsapp' ); ?></div>
|
27 |
<div class="collapsible-body">
|
28 |
+
<p class="description">We can <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/change-values-at-page-level/"><?php _e( 'change the WhatsApp number, Call to Action' ) ?></a> <?php _e( 'while editing the post from the right side bar' ) ?></p>
|
29 |
+
</div>
|
30 |
+
</li>
|
31 |
+
|
32 |
+
<li>
|
33 |
+
<div class="collapsible-header"><?php _e( 'I Make Changes and Nothing Happens', 'click-to-chat-for-whatsapp' ); ?></div>
|
34 |
+
<div class="collapsible-body">
|
35 |
+
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/clear-cache/"><?php _e( 'Clear Cache' ) ?>:</a> <br>
|
36 |
+
  - <?php _e( 'Cache plugins', 'click-to-chat-for-whatsapp' ); ?> <br>
|
37 |
+
  - <?php _e( 'Server cache', 'click-to-chat-for-whatsapp' ); ?> <br>
|
38 |
+
  - <?php _e( 'Browser Cache', 'click-to-chat-for-whatsapp' ); ?>
|
39 |
</p>
|
40 |
</div>
|
41 |
</li>
|
42 |
|
43 |
+
<li>
|
44 |
+
<div class="collapsible-header"><?php _e( 'No WhatsApp Number Found!', 'click-to-chat-for-whatsapp' ); ?></div>
|
45 |
+
<div class="collapsible-body">
|
46 |
+
<p class="description"><?php _e( 'Add', 'click-to-chat-for-whatsapp' ); ?> <a href="#chat_settings"><?php _e( 'WhatsApp Number with Country Code', 'click-to-chat-for-whatsapp' ); ?></a></p>
|
47 |
+
<p class="description"><?php _e( 'If already added it might be cached version', 'click-to-chat-for-whatsapp' ); ?>, <strong><?php _e( 'Clear the Cache and try', 'click-to-chat-for-whatsapp' ); ?></strong></p>
|
48 |
+
<p class="description"><?php _e( 'If still an issue, please contact us', 'click-to-chat-for-whatsapp' ); ?></p>
|
49 |
+
</div>
|
50 |
+
</li>
|
51 |
+
|
52 |
<!-- <li>
|
53 |
<div class="collapsible-header">Positon to place</div>
|
54 |
<div class="collapsible-body">
|
55 |
<p class="description">Center to the Screen</p>
|
56 |
+
<p class="description">Different position for mobile, desktop (pro)</p>
|
57 |
</div>
|
58 |
</li> -->
|
59 |
|
60 |
+
<li>
|
61 |
+
<div class="collapsible-header"><?php _e( 'Contact Us', 'click-to-chat-for-whatsapp' ); ?></div>
|
62 |
<div class="collapsible-body">
|
63 |
+
<p class="description"><a href="http://api.whatsapp.com/send?phone=919494429789&text=<?php echo get_bloginfo('url'); ?>%0AHi%20HoliThemes!!" target="_blank"><?php _e( 'WhatsApp', 'click-to-chat-for-whatsapp' ); ?></a></p>
|
64 |
+
<p class="description"><?php _e( 'mail', 'click-to-chat-for-whatsapp' ); ?>: wp@holithemes.com</p>
|
65 |
</div>
|
66 |
+
</li>
|
67 |
|
68 |
<li>
|
69 |
+
<div class="collapsible-header"><?php _e( 'HoliThemes On', 'click-to-chat-for-whatsapp' ); ?></div>
|
70 |
<div class="collapsible-body">
|
71 |
+
<p class="description"><a href="https://www.facebook.com/holithemes/" target="_blank"><?php _e( 'Facebook', 'click-to-chat-for-whatsapp' ); ?></a></p>
|
72 |
+
<p class="description"><a href="https://www.youtube.com/channel/UC2Tf_WB9PWffO2B3tswWCGw" target="_blank"><?php _e( 'YouTube', 'click-to-chat-for-whatsapp' ); ?></a></p>
|
73 |
+
<p class="description"><a href="https://twitter.com/holithemes" target="_blank"><?php _e( 'Twitter', 'click-to-chat-for-whatsapp' ); ?></a></p>
|
74 |
+
<p class="description"><a href="https://www.instagram.com/holithemes/" target="_blank"><?php _e( 'Instagram', 'click-to-chat-for-whatsapp' ); ?></a></p>
|
75 |
+
<p class="description"><a href="https://www.linkedin.com/company/holithemes" target="_blank"><?php _e( 'LinkedIn', 'click-to-chat-for-whatsapp' ); ?></a></p>
|
76 |
</div>
|
77 |
</li>
|
78 |
|
new/admin/admin_commons/admin-desktop.php
ADDED
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin Desktop
|
4 |
+
*
|
5 |
+
* @package ctc
|
6 |
+
* @subpackage Administration
|
7 |
+
* @since 2.11
|
8 |
+
*/
|
9 |
+
|
10 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
11 |
+
|
12 |
+
// style
|
13 |
+
$style_desktop = ( isset( $options['style_desktop']) ) ? esc_attr( $options['style_desktop'] ) : '';
|
14 |
+
|
15 |
+
// position
|
16 |
+
$side_1 = ( isset( $options['side_1']) ) ? esc_attr( $options['side_1'] ) : '';
|
17 |
+
$side_1_value = ( isset( $options['side_1_value']) ) ? esc_attr( $options['side_1_value'] ) : '';
|
18 |
+
$side_2 = ( isset( $options['side_2']) ) ? esc_attr( $options['side_2'] ) : '';
|
19 |
+
$side_2_value = ( isset( $options['side_2_value']) ) ? esc_attr( $options['side_2_value'] ) : '';
|
20 |
+
|
21 |
+
?>
|
22 |
+
|
23 |
+
<ul class="collapsible">
|
24 |
+
<li class="active">
|
25 |
+
<div class="collapsible-header"><?php _e( 'Desktop', 'click-to-chat-for-whatsapp' ); ?></div>
|
26 |
+
<div class="collapsible-body">
|
27 |
+
|
28 |
+
|
29 |
+
<!-- style -->
|
30 |
+
<p class="description ht_ctc_admin_desktop ht_ctc_subtitle"><?php _e( 'Select Style (Desktop)', 'click-to-chat-for-whatsapp' ); ?>:</p class="description">
|
31 |
+
<div class="row ht_ctc_admin_desktop">
|
32 |
+
<div class="input-field col s12 m12">
|
33 |
+
<select name="<?php echo $dbrow ?>[style_desktop]" class="chat_select_style select_style_desktop">
|
34 |
+
<option value="1" <?php echo $style_desktop == 1 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-1', 'click-to-chat-for-whatsapp' ); ?></option>
|
35 |
+
<option value="2" <?php echo $style_desktop == 2 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-2', 'click-to-chat-for-whatsapp' ); ?></option>
|
36 |
+
<option value="3" <?php echo $style_desktop == 3 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-3', 'click-to-chat-for-whatsapp' ); ?></option>
|
37 |
+
<option value="4" <?php echo $style_desktop == 4 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-4', 'click-to-chat-for-whatsapp' ); ?></option>
|
38 |
+
<option value="5" <?php echo $style_desktop == 5 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-5', 'click-to-chat-for-whatsapp' ); ?></option>
|
39 |
+
<option value="6" <?php echo $style_desktop == 6 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-6', 'click-to-chat-for-whatsapp' ); ?></option>
|
40 |
+
<option value="7" <?php echo $style_desktop == 7 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7', 'click-to-chat-for-whatsapp' ); ?></option>
|
41 |
+
<option value="8" <?php echo $style_desktop == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
|
42 |
+
<option value="99" <?php echo $style_desktop == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-99 (Add your own image / GIF)', 'click-to-chat-for-whatsapp' ); ?></option>
|
43 |
+
</select>
|
44 |
+
<p class="description"><a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/list-of-styles/"><?php _e( 'List of styles', 'click-to-chat-for-whatsapp' ); ?></a>   |   <span><?php _e( 'Customize the styles', 'click-to-chat-for-whatsapp' ); ?> <a target="_blank" class="customize_styles_link" href="<?php echo admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">( Click to Chat -> Customize )</a></span> </p>
|
45 |
+
<p class="description"><span class="check_select_styles" style="font-size: 0.7em;"><?php _e( 'If Styles for desktop, mobile not selected as expected', 'click-to-chat-for-whatsapp' ); ?> <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat-customize-styles#styles_issue' ); ?>"><?php _e( 'Check this', 'click-to-chat-for-whatsapp' ); ?></a>, - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/select-styles/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a></span></p>
|
46 |
+
<!-- <span class="check_select_styles" style="font-size: 0.7em;">If Styles for desktop, mobile not selected as expected <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat-customize-styles#:~:text=check%20this, cache)' ); ?>">Check this</a>, - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/select-styles/">more info</a></span></p> -->
|
47 |
+
</div>
|
48 |
+
</div>
|
49 |
+
|
50 |
+
<!-- Dekstop position -->
|
51 |
+
<!-- side - 1 -->
|
52 |
+
<p class="description ht_ctc_admin_desktop ht_ctc_subtitle"><?php _e( 'Position to Place (Desktop)', 'click-to-chat-for-whatsapp' ); ?>:</p>
|
53 |
+
<div class="row ht_ctc_admin_desktop">
|
54 |
+
<br>
|
55 |
+
<div class="input-field col s6">
|
56 |
+
<select name="<?php echo $dbrow ?>[side_1]" class="select-2">
|
57 |
+
<option value="bottom" <?php echo $side_1 == 'bottom' ? 'SELECTED' : ''; ?> ><?php _e( 'bottom', 'click-to-chat-for-whatsapp' ); ?></option>
|
58 |
+
<option value="top" <?php echo $side_1 == 'top' ? 'SELECTED' : ''; ?> ><?php _e( 'top', 'click-to-chat-for-whatsapp' ); ?></option>
|
59 |
+
</select>
|
60 |
+
<label>top / bottom </label>
|
61 |
+
</div>
|
62 |
+
<div class="input-field col s6">
|
63 |
+
<input name="<?php echo $dbrow ?>[side_1_value]" value="<?php echo $side_1_value ?>" id="side_1_value" type="text" class="input-margin">
|
64 |
+
<label for="side_1_value"><?php _e( 'E.g. 10px', 'click-to-chat-for-whatsapp' ); ?></label>
|
65 |
+
</div>
|
66 |
+
</div>
|
67 |
+
|
68 |
+
<!-- side - 2 -->
|
69 |
+
<div class="row ht_ctc_admin_desktop" style="margin-bottom:0;">
|
70 |
+
<div class="input-field col s6">
|
71 |
+
<select name="<?php echo $dbrow ?>[side_2]" class="select-2">
|
72 |
+
<option value="right" <?php echo $side_2 == 'right' ? 'SELECTED' : ''; ?> ><?php _e( 'right', 'click-to-chat-for-whatsapp' ); ?></option>
|
73 |
+
<option value="left" <?php echo $side_2 == 'left' ? 'SELECTED' : ''; ?> ><?php _e( 'left', 'click-to-chat-for-whatsapp' ); ?></option>
|
74 |
+
</select>
|
75 |
+
<label><?php _e( 'right / left', 'click-to-chat-for-whatsapp' ); ?></label>
|
76 |
+
</div>
|
77 |
+
|
78 |
+
<div class="input-field col s6">
|
79 |
+
<input name="<?php echo $dbrow ?>[side_2_value]" value="<?php echo $side_2_value ?>" id="side_2_value" type="text" class="input-margin">
|
80 |
+
<label for="side_2_value"><?php _e( 'E.g. 50%', 'click-to-chat-for-whatsapp' ); ?></label>
|
81 |
+
</div>
|
82 |
+
</div>
|
83 |
+
<p class="description ht_ctc_admin_desktop"><?php _e( 'Add css units as suffix - e.g. 10px, 50%', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/position-to-place/">more info</a> </p>
|
84 |
+
|
85 |
+
<br class="ht_ctc_admin_desktop">
|
86 |
+
<hr class="ht_ctc_admin_desktop" style="max-width: 500px;">
|
87 |
+
<br class="ht_ctc_admin_desktop">
|
88 |
+
|
89 |
+
|
90 |
+
<?php
|
91 |
+
// Hide on Desktop Devices
|
92 |
+
if ( isset( $options['hideon_desktop'] ) ) {
|
93 |
+
?>
|
94 |
+
<p>
|
95 |
+
<label>
|
96 |
+
<input name="<?php echo $dbrow ?>[hideon_desktop]" type="checkbox" value="1" <?php checked( $options['hideon_desktop'], 1 ); ?> class="hidebasedondevice" id="hideon_desktop" />
|
97 |
+
<span><?php _e( 'Hide on - Desktop Devices', 'click-to-chat-for-whatsapp' ); ?></span>
|
98 |
+
</label>
|
99 |
+
</p>
|
100 |
+
<?php
|
101 |
+
} else {
|
102 |
+
?>
|
103 |
+
<p>
|
104 |
+
<label>
|
105 |
+
<input name="<?php echo $dbrow ?>[hideon_desktop]" type="checkbox" value="1" class="hidebasedondevice" id="hideon_desktop" />
|
106 |
+
<span><?php _e( 'Hide on - Desktop Devices', 'click-to-chat-for-whatsapp' ); ?></span>
|
107 |
+
</label>
|
108 |
+
</p>
|
109 |
+
<?php
|
110 |
+
}
|
111 |
+
?>
|
112 |
+
|
113 |
+
</div>
|
114 |
+
</div>
|
115 |
+
</li>
|
116 |
+
<ul>
|
new/admin/admin_commons/admin-mobile.php
ADDED
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin Mobile
|
4 |
+
*
|
5 |
+
* @package ctc
|
6 |
+
* @subpackage Administration
|
7 |
+
* @since 2.11
|
8 |
+
*/
|
9 |
+
|
10 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
11 |
+
|
12 |
+
// style
|
13 |
+
$style_mobile = ( isset( $options['style_mobile']) ) ? esc_attr( $options['style_mobile'] ) : '';
|
14 |
+
|
15 |
+
// position
|
16 |
+
$mobile_side_1 = ( isset( $options['mobile_side_1']) ) ? esc_attr( $options['mobile_side_1'] ) : '';
|
17 |
+
$mobile_side_1_value = ( isset( $options['mobile_side_1_value'])) ? esc_attr( $options['mobile_side_1_value'] ) : '';
|
18 |
+
$mobile_side_2 = ( isset( $options['mobile_side_2']) ) ? esc_attr( $options['mobile_side_2'] ) : '';
|
19 |
+
$mobile_side_2_value = ( isset( $options['mobile_side_2_value'])) ? esc_attr( $options['mobile_side_2_value'] ) : '';
|
20 |
+
|
21 |
+
?>
|
22 |
+
|
23 |
+
<ul class="collapsible">
|
24 |
+
<li class="active">
|
25 |
+
<div class="collapsible-header"><?php _e( 'Mobile', 'click-to-chat-for-whatsapp' ); ?></div>
|
26 |
+
<div class="collapsible-body">
|
27 |
+
|
28 |
+
<!-- style -->
|
29 |
+
<p class="description ht_ctc_admin_mobile ht_ctc_subtitle"><?php _e( 'Select Style (Mobile)', 'click-to-chat-for-whatsapp' ); ?>:</p class="description">
|
30 |
+
<div class="row ht_ctc_admin_mobile">
|
31 |
+
<div class="input-field col s12 m12">
|
32 |
+
<select name="<?php echo $dbrow ?>[style_mobile]" class="chat_select_style select_style_mobile">
|
33 |
+
<option value="1" <?php echo $style_mobile == 1 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-1', 'click-to-chat-for-whatsapp' ); ?></option>
|
34 |
+
<option value="2" <?php echo $style_mobile == 2 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-2', 'click-to-chat-for-whatsapp' ); ?></option>
|
35 |
+
<option value="3" <?php echo $style_mobile == 3 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-3', 'click-to-chat-for-whatsapp' ); ?></option>
|
36 |
+
<option value="4" <?php echo $style_mobile == 4 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-4', 'click-to-chat-for-whatsapp' ); ?></option>
|
37 |
+
<option value="5" <?php echo $style_mobile == 5 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-5', 'click-to-chat-for-whatsapp' ); ?></option>
|
38 |
+
<option value="6" <?php echo $style_mobile == 6 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-6', 'click-to-chat-for-whatsapp' ); ?></option>
|
39 |
+
<option value="7" <?php echo $style_mobile == 7 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7', 'click-to-chat-for-whatsapp' ); ?></option>
|
40 |
+
<option value="8" <?php echo $style_mobile == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
|
41 |
+
<option value="99" <?php echo $style_mobile == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-99 (Add your own image / GIF)', 'click-to-chat-for-whatsapp' ); ?></option>
|
42 |
+
</select>
|
43 |
+
<p class="description"><a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/list-of-styles/"><?php _e( 'List of styles', 'click-to-chat-for-whatsapp' ); ?></a>   |   <span><?php _e( 'Customize the styles', 'click-to-chat-for-whatsapp' ); ?> <a target="_blank" class="customize_styles_link" href="<?php echo admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">( Click to Chat -> Customize )</a></span> </p>
|
44 |
+
<p class="description"><span class="check_select_styles" style="font-size: 0.7em;">If Styles for desktop, mobile not selected as expected <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat-customize-styles#styles_issue' ); ?>">Check this</a>, - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/select-styles/">more info</a></span></p>
|
45 |
+
</div>
|
46 |
+
</div>
|
47 |
+
|
48 |
+
<!-- Mobile position -->
|
49 |
+
<!-- side - 1 -->
|
50 |
+
<p class="description ht_ctc_admin_mobile ht_ctc_subtitle"><?php _e( 'Position to Place (Mobile)', 'click-to-chat-for-whatsapp' ); ?>:</p>
|
51 |
+
<div class="row ht_ctc_admin_mobile">
|
52 |
+
<br>
|
53 |
+
<div class="input-field col s6">
|
54 |
+
<select name="<?php echo $dbrow ?>[mobile_side_1]" class="select-2">
|
55 |
+
<option value="bottom" <?php echo $mobile_side_1 == 'bottom' ? 'SELECTED' : ''; ?> ><?php _e( 'bottom', 'click-to-chat-for-whatsapp' ); ?></option>
|
56 |
+
<option value="top" <?php echo $mobile_side_1 == 'top' ? 'SELECTED' : ''; ?> ><?php _e( 'top', 'click-to-chat-for-whatsapp' ); ?></option>
|
57 |
+
</select>
|
58 |
+
<label>top / bottom </label>
|
59 |
+
</div>
|
60 |
+
<div class="input-field col s6">
|
61 |
+
<input name="<?php echo $dbrow ?>[mobile_side_1_value]" value="<?php echo $mobile_side_1_value ?>" id="side_1_value" type="text" class="input-margin">
|
62 |
+
<label for="side_1_value"><?php _e( 'E.g. 10px', 'click-to-chat-for-whatsapp' ); ?></label>
|
63 |
+
</div>
|
64 |
+
</div>
|
65 |
+
|
66 |
+
<!-- side - 2 -->
|
67 |
+
<div class="row ht_ctc_admin_mobile" style="margin-bottom:0;">
|
68 |
+
<div class="input-field col s6">
|
69 |
+
<select name="<?php echo $dbrow ?>[mobile_side_2]" class="select-2">
|
70 |
+
<option value="right" <?php echo $mobile_side_2 == 'right' ? 'SELECTED' : ''; ?> ><?php _e( 'right', 'click-to-chat-for-whatsapp' ); ?></option>
|
71 |
+
<option value="left" <?php echo $mobile_side_2 == 'left' ? 'SELECTED' : ''; ?> ><?php _e( 'left', 'click-to-chat-for-whatsapp' ); ?></option>
|
72 |
+
</select>
|
73 |
+
<label><?php _e( 'right / left', 'click-to-chat-for-whatsapp' ); ?></label>
|
74 |
+
</div>
|
75 |
+
|
76 |
+
<div class="input-field col s6">
|
77 |
+
<input name="<?php echo $dbrow ?>[mobile_side_2_value]" value="<?php echo $mobile_side_2_value ?>" id="side_2_value" type="text" class="input-margin">
|
78 |
+
<label for="side_2_value"><?php _e( 'E.g. 50%', 'click-to-chat-for-whatsapp' ); ?></label>
|
79 |
+
</div>
|
80 |
+
</div>
|
81 |
+
<p class="description ht_ctc_admin_mobile"><?php _e( 'Add css units as suffix - e.g. 10px, 50%', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/position-to-place/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
|
82 |
+
|
83 |
+
<br class="ht_ctc_admin_mobile">
|
84 |
+
<hr class="ht_ctc_admin_mobile" style="max-width: 500px;">
|
85 |
+
<br class="ht_ctc_admin_mobile">
|
86 |
+
|
87 |
+
<?php
|
88 |
+
|
89 |
+
// Hide on Mobile Devices
|
90 |
+
if ( isset( $options['hideon_mobile'] ) ) {
|
91 |
+
?>
|
92 |
+
<p>
|
93 |
+
<label>
|
94 |
+
<input name="<?php echo $dbrow ?>[hideon_mobile]" type="checkbox" value="1" <?php checked( $options['hideon_mobile'], 1 ); ?> class="hidebasedondevice" id="hideon_mobile" />
|
95 |
+
<span><?php _e( 'Hide on - Mobile Devices', 'click-to-chat-for-whatsapp' ); ?></span>
|
96 |
+
</label>
|
97 |
+
</p>
|
98 |
+
<?php
|
99 |
+
} else {
|
100 |
+
?>
|
101 |
+
<p>
|
102 |
+
<label>
|
103 |
+
<input name="<?php echo $dbrow ?>[hideon_mobile]" type="checkbox" value="1" class="hidebasedondevice" id="hideon_mobile" />
|
104 |
+
<span><?php _e( 'Hide on - Mobile Devices', 'click-to-chat-for-whatsapp' ); ?></span>
|
105 |
+
</label>
|
106 |
+
</p>
|
107 |
+
<?php
|
108 |
+
}
|
109 |
+
|
110 |
+
?>
|
111 |
+
|
112 |
+
</div>
|
113 |
+
</div>
|
114 |
+
</li>
|
115 |
+
<ul>
|
new/admin/admin_commons/admin-show-hide.php
CHANGED
@@ -9,77 +9,36 @@
|
|
9 |
|
10 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
11 |
|
12 |
-
$show_or_hide = (
|
13 |
|
14 |
-
$list_hideon_pages = (
|
15 |
-
$list_hideon_cat = (
|
16 |
-
$list_showon_pages = (
|
17 |
-
$list_showon_cat = (
|
18 |
|
19 |
|
20 |
?>
|
21 |
|
22 |
<ul class="collapsible">
|
23 |
<li class="active">
|
24 |
-
<div class="collapsible-header"
|
25 |
<div class="collapsible-body">
|
26 |
|
27 |
<?php
|
28 |
|
29 |
-
|
30 |
-
|
31 |
-
if ( isset( $options['hideon_mobile'] ) ) {
|
32 |
-
?>
|
33 |
-
<p>
|
34 |
-
<label>
|
35 |
-
<input name="<?php echo $dbrow ?>[hideon_mobile]" type="checkbox" value="1" <?php checked( $options['hideon_mobile'], 1 ); ?> id="hideon_mobile" />
|
36 |
-
<span>Hide on - Mobile Devices</span>
|
37 |
-
</label>
|
38 |
-
</p>
|
39 |
-
<?php
|
40 |
-
} else {
|
41 |
-
?>
|
42 |
-
<p>
|
43 |
-
<label>
|
44 |
-
<input name="<?php echo $dbrow ?>[hideon_mobile]" type="checkbox" value="1" id="hideon_mobile" />
|
45 |
-
<span>Hide on - Mobile Devices</span>
|
46 |
-
</label>
|
47 |
-
</p>
|
48 |
-
<?php
|
49 |
-
}
|
50 |
-
|
51 |
-
// Hide on Desktop Devices
|
52 |
-
if ( isset( $options['hideon_desktop'] ) ) {
|
53 |
-
?>
|
54 |
-
<p>
|
55 |
-
<label>
|
56 |
-
<input name="<?php echo $dbrow ?>[hideon_desktop]" type="checkbox" value="1" <?php checked( $options['hideon_desktop'], 1 ); ?> id="hideon_desktop" />
|
57 |
-
<span>Hide on - Desktop Devices</span>
|
58 |
-
</label>
|
59 |
-
</p>
|
60 |
-
<?php
|
61 |
-
} else {
|
62 |
-
?>
|
63 |
-
<p>
|
64 |
-
<label>
|
65 |
-
<input name="<?php echo $dbrow ?>[hideon_desktop]" type="checkbox" value="1" id="hideon_desktop" />
|
66 |
-
<span>Hide on - Desktop Devices</span>
|
67 |
-
</label>
|
68 |
-
</p>
|
69 |
-
<?php
|
70 |
}
|
|
|
71 |
?>
|
72 |
-
<!-- <p class="description">plugin detects device based on HTTP User agent </p> -->
|
73 |
-
<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>
|
74 |
-
<br><hr><br>
|
75 |
|
76 |
-
<span class="description"><b
|
77 |
|
78 |
<div class="row" style="margin-bottom: 0px;">
|
79 |
<div class="input-field col s8">
|
80 |
<select name="<?php echo $dbrow ?>[show_or_hide]" class="select_show_or_hide">
|
81 |
-
<option value="hide" <?php echo $show_or_hide == "hide" ? 'SELECTED' : ''; ?>
|
82 |
-
<option value="show" <?php echo $show_or_hide == "show" ? 'SELECTED' : ''; ?>
|
83 |
</select>
|
84 |
<!-- <label><?php _e( 'enable' , 'click-to-chat-for-whatsapp' ) ?></label> -->
|
85 |
</div>
|
@@ -105,7 +64,7 @@ if ( isset( $options['hideon_posts'] ) ) {
|
|
105 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
106 |
<label>
|
107 |
<input name="<?php echo $dbrow ?>[hideon_posts]" type="checkbox" value="1" <?php checked( $options['hideon_posts'], 1 ); ?> id="filled-in-box1" />
|
108 |
-
<span
|
109 |
</label>
|
110 |
</p>
|
111 |
<?php
|
@@ -114,7 +73,7 @@ if ( isset( $options['hideon_posts'] ) ) {
|
|
114 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
115 |
<label>
|
116 |
<input name="<?php echo $dbrow ?>[hideon_posts]" type="checkbox" value="1" id="filled-in-box1" />
|
117 |
-
<span
|
118 |
</label>
|
119 |
</p>
|
120 |
<?php
|
@@ -127,7 +86,7 @@ if ( isset( $options['hideon_page'] ) ) {
|
|
127 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
128 |
<label>
|
129 |
<input name="<?php echo $dbrow ?>[hideon_page]" type="checkbox" value="1" <?php checked( $options['hideon_page'], 1 ); ?> id="filled-in-box2" />
|
130 |
-
<span
|
131 |
</label>
|
132 |
</p>
|
133 |
<?php
|
@@ -136,7 +95,7 @@ if ( isset( $options['hideon_page'] ) ) {
|
|
136 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
137 |
<label>
|
138 |
<input name="<?php echo $dbrow ?>[hideon_page]" type="checkbox" value="1" id="filled-in-box2" />
|
139 |
-
<span
|
140 |
</label>
|
141 |
</p>
|
142 |
<?php
|
@@ -152,7 +111,7 @@ if ( isset( $options['hideon_homepage'] ) ) {
|
|
152 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
153 |
<label>
|
154 |
<input name="<?php echo $dbrow ?>[hideon_homepage]" type="checkbox" value="1" <?php checked( $options['hideon_homepage'], 1 ); ?> id="filled-in-box3" />
|
155 |
-
<span
|
156 |
</label>
|
157 |
</p>
|
158 |
<?php
|
@@ -161,7 +120,7 @@ if ( isset( $options['hideon_homepage'] ) ) {
|
|
161 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
162 |
<label>
|
163 |
<input name="<?php echo $dbrow ?>[hideon_homepage]" type="checkbox" value="1" id="filled-in-box3" />
|
164 |
-
<span
|
165 |
</label>
|
166 |
</p>
|
167 |
<?php
|
@@ -174,7 +133,7 @@ if ( isset( $options['hideon_category'] ) ) {
|
|
174 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
175 |
<label>
|
176 |
<input name="<?php echo $dbrow ?>[hideon_category]" type="checkbox" value="1" <?php checked( $options['hideon_category'], 1 ); ?> id="filled-in-box5" />
|
177 |
-
<span
|
178 |
</label>
|
179 |
</p>
|
180 |
<?php
|
@@ -183,7 +142,7 @@ if ( isset( $options['hideon_category'] ) ) {
|
|
183 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
184 |
<label>
|
185 |
<input name="<?php echo $dbrow ?>[hideon_category]" type="checkbox" value="1" id="filled-in-box5" />
|
186 |
-
<span
|
187 |
</label>
|
188 |
</p>
|
189 |
<?php
|
@@ -197,7 +156,7 @@ if ( isset( $options['hideon_archive'] ) ) {
|
|
197 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
198 |
<label>
|
199 |
<input name="<?php echo $dbrow ?>[hideon_archive]" type="checkbox" value="1" <?php checked( $options['hideon_archive'], 1 ); ?> id="filled-in-box6" />
|
200 |
-
<span
|
201 |
</label>
|
202 |
</p>
|
203 |
<?php
|
@@ -206,7 +165,7 @@ if ( isset( $options['hideon_archive'] ) ) {
|
|
206 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
207 |
<label>
|
208 |
<input name="<?php echo $dbrow ?>[hideon_archive]" type="checkbox" value="1" id="filled-in-box6" />
|
209 |
-
<span
|
210 |
</label>
|
211 |
</p>
|
212 |
<?php
|
@@ -219,7 +178,7 @@ if ( isset( $options['hideon_404'] ) ) {
|
|
219 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
220 |
<label>
|
221 |
<input name="<?php echo $dbrow ?>[hideon_404]" type="checkbox" value="1" <?php checked( $options['hideon_404'], 1 ); ?> id="hideon_404" />
|
222 |
-
<span
|
223 |
</label>
|
224 |
</p>
|
225 |
<?php
|
@@ -228,7 +187,7 @@ if ( isset( $options['hideon_404'] ) ) {
|
|
228 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
229 |
<label>
|
230 |
<input name="<?php echo $dbrow ?>[hideon_404]" type="checkbox" value="1" id="hideon_404" />
|
231 |
-
<span
|
232 |
</label>
|
233 |
</p>
|
234 |
<?php
|
@@ -241,7 +200,7 @@ if ( isset( $options['hideon_wooproduct'] ) ) {
|
|
241 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
242 |
<label>
|
243 |
<input name="<?php echo $dbrow ?>[hideon_wooproduct]" type="checkbox" value="1" <?php checked( $options['hideon_wooproduct'], 1 ); ?> id="hideon_wooproduct" />
|
244 |
-
<span
|
245 |
</label>
|
246 |
</p>
|
247 |
<?php
|
@@ -250,7 +209,7 @@ if ( isset( $options['hideon_wooproduct'] ) ) {
|
|
250 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
251 |
<label>
|
252 |
<input name="<?php echo $dbrow ?>[hideon_wooproduct]" type="checkbox" value="1" id="hideon_wooproduct" />
|
253 |
-
<span
|
254 |
</label>
|
255 |
</p>
|
256 |
<?php
|
@@ -258,24 +217,24 @@ if ( isset( $options['hideon_wooproduct'] ) ) {
|
|
258 |
|
259 |
|
260 |
?>
|
261 |
-
<p class="description ctc_show_hide_display show-hide_display-none hidebased"
|
262 |
<br>
|
263 |
|
264 |
<!-- ID's list to hide styles -->
|
265 |
<div class="row ctc_show_hide_display show-hide_display-none hidebased">
|
266 |
<div class="input-field col s7">
|
267 |
<input name="<?php echo $dbrow ?>[list_hideon_pages]" value="<?php echo $list_hideon_pages ?>" id="ccw_list_id_tohide" type="text" class="input-margin">
|
268 |
-
<label for="ccw_list_id_tohide"
|
269 |
-
<p class="description"
|
270 |
</div>
|
271 |
</div>
|
272 |
|
273 |
<!-- Categorys list - to hide -->
|
274 |
<div class="row ctc_show_hide_display show-hide_display-none hidebased">
|
275 |
<div class="input-field col s7">
|
276 |
-
<input name="<?php echo $dbrow ?>[list_hideon_cat]" value="<?php echo $list_hideon_cat ?>" id="
|
277 |
-
<label for="
|
278 |
-
<p class="description"
|
279 |
</div>
|
280 |
</div>
|
281 |
|
@@ -454,8 +413,8 @@ if ( isset( $options['showon_wooproduct'] ) ) {
|
|
454 |
<div class="row ctc_show_hide_display show-hide_display-none showbased">
|
455 |
<div class="input-field col s7">
|
456 |
<input name="<?php echo $dbrow ?>[list_showon_pages]" value="<?php echo $list_showon_pages ?>" id="ccw_list_id_toshow" type="text" class="input-margin">
|
457 |
-
<label for="ccw_list_id_toshow">
|
458 |
-
<p class="description"
|
459 |
</div>
|
460 |
</div>
|
461 |
|
@@ -464,17 +423,24 @@ if ( isset( $options['showon_wooproduct'] ) ) {
|
|
464 |
<div class="row ctc_show_hide_display show-hide_display-none showbased">
|
465 |
<div class="input-field col s7">
|
466 |
<input name="<?php echo $dbrow ?>[list_showon_cat]" value="<?php echo $list_showon_cat ?>" id="ccw_list_cat_toshow" type="text" class="input-margin">
|
467 |
-
<label for="ccw_list_cat_toshow"><?php _e( '
|
468 |
-
<p class="description"
|
469 |
</div>
|
470 |
</div>
|
471 |
|
472 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
473 |
<br>
|
474 |
-
<p class="description"
|
475 |
-
<p class="description"
|
476 |
-
<p class="description"
|
477 |
-
<p class="description"
|
478 |
|
479 |
|
480 |
</div>
|
9 |
|
10 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
11 |
|
12 |
+
$show_or_hide = ( isset( $options['show_or_hide']) ) ? esc_attr( $options['show_or_hide'] ) : '';
|
13 |
|
14 |
+
$list_hideon_pages = ( isset( $options['list_hideon_pages']) ) ? esc_attr( $options['list_hideon_pages'] ) : '';
|
15 |
+
$list_hideon_cat = ( isset( $options['list_hideon_cat']) ) ? esc_attr( $options['list_hideon_cat'] ) : '';
|
16 |
+
$list_showon_pages = ( isset( $options['list_showon_pages']) ) ? esc_attr( $options['list_showon_pages'] ) : '';
|
17 |
+
$list_showon_cat = ( isset( $options['list_showon_cat']) ) ? esc_attr( $options['list_showon_cat'] ) : '';
|
18 |
|
19 |
|
20 |
?>
|
21 |
|
22 |
<ul class="collapsible">
|
23 |
<li class="active">
|
24 |
+
<div class="collapsible-header" id="showhide_settings"><?php _e( 'Show/Hide on Selected pages', 'click-to-chat-for-whatsapp' ); ?></div>
|
25 |
<div class="collapsible-body">
|
26 |
|
27 |
<?php
|
28 |
|
29 |
+
if ( 'chat' == $type ) {
|
30 |
+
do_action('ht_ctc_ah_admin_chat_before_showhide');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
}
|
32 |
+
do_action('ht_ctc_ah_admin_before_showhide');
|
33 |
?>
|
|
|
|
|
|
|
34 |
|
35 |
+
<span class="description"><b><?php _e( 'Select Show/Hide', 'click-to-chat-for-whatsapp' ); ?>:</b></span>
|
36 |
|
37 |
<div class="row" style="margin-bottom: 0px;">
|
38 |
<div class="input-field col s8">
|
39 |
<select name="<?php echo $dbrow ?>[show_or_hide]" class="select_show_or_hide">
|
40 |
+
<option value="hide" <?php echo $show_or_hide == "hide" ? 'SELECTED' : ''; ?> ><?php _e( 'Hide on selected pages', 'click-to-chat-for-whatsapp' ); ?></option>
|
41 |
+
<option value="show" <?php echo $show_or_hide == "show" ? 'SELECTED' : ''; ?> ><?php _e( 'Show on selected pages', 'click-to-chat-for-whatsapp' ); ?></option>
|
42 |
</select>
|
43 |
<!-- <label><?php _e( 'enable' , 'click-to-chat-for-whatsapp' ) ?></label> -->
|
44 |
</div>
|
64 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
65 |
<label>
|
66 |
<input name="<?php echo $dbrow ?>[hideon_posts]" type="checkbox" value="1" <?php checked( $options['hideon_posts'], 1 ); ?> id="filled-in-box1" />
|
67 |
+
<span><?php _e( 'Hide on - Posts', 'click-to-chat-for-whatsapp' ); ?></span>
|
68 |
</label>
|
69 |
</p>
|
70 |
<?php
|
73 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
74 |
<label>
|
75 |
<input name="<?php echo $dbrow ?>[hideon_posts]" type="checkbox" value="1" id="filled-in-box1" />
|
76 |
+
<span><?php _e( 'Hide on - Posts', 'click-to-chat-for-whatsapp' ); ?></span>
|
77 |
</label>
|
78 |
</p>
|
79 |
<?php
|
86 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
87 |
<label>
|
88 |
<input name="<?php echo $dbrow ?>[hideon_page]" type="checkbox" value="1" <?php checked( $options['hideon_page'], 1 ); ?> id="filled-in-box2" />
|
89 |
+
<span><?php _e( 'Hide on - Pages', 'click-to-chat-for-whatsapp' ); ?></span>
|
90 |
</label>
|
91 |
</p>
|
92 |
<?php
|
95 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
96 |
<label>
|
97 |
<input name="<?php echo $dbrow ?>[hideon_page]" type="checkbox" value="1" id="filled-in-box2" />
|
98 |
+
<span><?php _e( 'Hide on - Pages', 'click-to-chat-for-whatsapp' ); ?></span>
|
99 |
</label>
|
100 |
</p>
|
101 |
<?php
|
111 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
112 |
<label>
|
113 |
<input name="<?php echo $dbrow ?>[hideon_homepage]" type="checkbox" value="1" <?php checked( $options['hideon_homepage'], 1 ); ?> id="filled-in-box3" />
|
114 |
+
<span><?php _e( 'Hide on - Home/Front Page', 'click-to-chat-for-whatsapp' ); ?></span>
|
115 |
</label>
|
116 |
</p>
|
117 |
<?php
|
120 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
121 |
<label>
|
122 |
<input name="<?php echo $dbrow ?>[hideon_homepage]" type="checkbox" value="1" id="filled-in-box3" />
|
123 |
+
<span><?php _e( 'Hide on - Home/Front Page', 'click-to-chat-for-whatsapp' ); ?></span>
|
124 |
</label>
|
125 |
</p>
|
126 |
<?php
|
133 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
134 |
<label>
|
135 |
<input name="<?php echo $dbrow ?>[hideon_category]" type="checkbox" value="1" <?php checked( $options['hideon_category'], 1 ); ?> id="filled-in-box5" />
|
136 |
+
<span><?php _e( 'Hide on - Category', 'click-to-chat-for-whatsapp' ); ?></span>
|
137 |
</label>
|
138 |
</p>
|
139 |
<?php
|
142 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
143 |
<label>
|
144 |
<input name="<?php echo $dbrow ?>[hideon_category]" type="checkbox" value="1" id="filled-in-box5" />
|
145 |
+
<span><?php _e( 'Hide on - Category', 'click-to-chat-for-whatsapp' ); ?></span>
|
146 |
</label>
|
147 |
</p>
|
148 |
<?php
|
156 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
157 |
<label>
|
158 |
<input name="<?php echo $dbrow ?>[hideon_archive]" type="checkbox" value="1" <?php checked( $options['hideon_archive'], 1 ); ?> id="filled-in-box6" />
|
159 |
+
<span><?php _e( 'Hide on - Archive', 'click-to-chat-for-whatsapp' ); ?></span>
|
160 |
</label>
|
161 |
</p>
|
162 |
<?php
|
165 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
166 |
<label>
|
167 |
<input name="<?php echo $dbrow ?>[hideon_archive]" type="checkbox" value="1" id="filled-in-box6" />
|
168 |
+
<span><?php _e( 'Hide on - Archive', 'click-to-chat-for-whatsapp' ); ?></span>
|
169 |
</label>
|
170 |
</p>
|
171 |
<?php
|
178 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
179 |
<label>
|
180 |
<input name="<?php echo $dbrow ?>[hideon_404]" type="checkbox" value="1" <?php checked( $options['hideon_404'], 1 ); ?> id="hideon_404" />
|
181 |
+
<span><?php _e( 'Hide on - 404 Page', 'click-to-chat-for-whatsapp' ); ?></span>
|
182 |
</label>
|
183 |
</p>
|
184 |
<?php
|
187 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
188 |
<label>
|
189 |
<input name="<?php echo $dbrow ?>[hideon_404]" type="checkbox" value="1" id="hideon_404" />
|
190 |
+
<span><?php _e( 'Hide on - 404 Page', 'click-to-chat-for-whatsapp' ); ?></span>
|
191 |
</label>
|
192 |
</p>
|
193 |
<?php
|
200 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
201 |
<label>
|
202 |
<input name="<?php echo $dbrow ?>[hideon_wooproduct]" type="checkbox" value="1" <?php checked( $options['hideon_wooproduct'], 1 ); ?> id="hideon_wooproduct" />
|
203 |
+
<span><?php _e( 'Hide on - WooCommerce single product pages', 'click-to-chat-for-whatsapp' ); ?></span>
|
204 |
</label>
|
205 |
</p>
|
206 |
<?php
|
209 |
<p class="ctc_show_hide_display show-hide_display-none hidebased">
|
210 |
<label>
|
211 |
<input name="<?php echo $dbrow ?>[hideon_wooproduct]" type="checkbox" value="1" id="hideon_wooproduct" />
|
212 |
+
<span><?php _e( 'Hide on - WooCommerce single product pages', 'click-to-chat-for-whatsapp' ); ?></span>
|
213 |
</label>
|
214 |
</p>
|
215 |
<?php
|
217 |
|
218 |
|
219 |
?>
|
220 |
+
<p class="description ctc_show_hide_display show-hide_display-none hidebased"><?php _e( 'Check to hide Styles based on the type of pages', 'click-to-chat-for-whatsapp' ); ?></p>
|
221 |
<br>
|
222 |
|
223 |
<!-- ID's list to hide styles -->
|
224 |
<div class="row ctc_show_hide_display show-hide_display-none hidebased">
|
225 |
<div class="input-field col s7">
|
226 |
<input name="<?php echo $dbrow ?>[list_hideon_pages]" value="<?php echo $list_hideon_pages ?>" id="ccw_list_id_tohide" type="text" class="input-margin">
|
227 |
+
<label for="ccw_list_id_tohide"><?php _e( 'Hide on this pages', 'click-to-chat-for-whatsapp' ); ?></label>
|
228 |
+
<p class="description"><?php _e( "Add post id's to hide. Add multiple post id's by separating with a comma ( , )", 'click-to-chat-for-whatsapp' ); ?></p>
|
229 |
</div>
|
230 |
</div>
|
231 |
|
232 |
<!-- Categorys list - to hide -->
|
233 |
<div class="row ctc_show_hide_display show-hide_display-none hidebased">
|
234 |
<div class="input-field col s7">
|
235 |
+
<input name="<?php echo $dbrow ?>[list_hideon_cat]" value="<?php echo $list_hideon_cat ?>" id="list_hideon_cat" type="text" class="input-margin">
|
236 |
+
<label for="list_hideon_cat"><?php _e( 'Hide on this Category pages' , 'click-to-chat-for-whatsapp' ) ?> </label>
|
237 |
+
<p class="description"><?php _e( 'Add Categories names to hide, Add multiple Categories by separating with a comma ( , ) ', 'click-to-chat-for-whatsapp' ); ?></p>
|
238 |
</div>
|
239 |
</div>
|
240 |
|
413 |
<div class="row ctc_show_hide_display show-hide_display-none showbased">
|
414 |
<div class="input-field col s7">
|
415 |
<input name="<?php echo $dbrow ?>[list_showon_pages]" value="<?php echo $list_showon_pages ?>" id="ccw_list_id_toshow" type="text" class="input-margin">
|
416 |
+
<label for="ccw_list_id_toshow">Show on this pages</label>
|
417 |
+
<p class="description"><?php _e( "Add Post, Page, Media - ID's to show styles, Add multiple id's by separating with a comma ( , )", 'click-to-chat-for-whatsapp' ); ?></p>
|
418 |
</div>
|
419 |
</div>
|
420 |
|
423 |
<div class="row ctc_show_hide_display show-hide_display-none showbased">
|
424 |
<div class="input-field col s7">
|
425 |
<input name="<?php echo $dbrow ?>[list_showon_cat]" value="<?php echo $list_showon_cat ?>" id="ccw_list_cat_toshow" type="text" class="input-margin">
|
426 |
+
<label for="ccw_list_cat_toshow"><?php _e( 'Show on this Category pages' , 'click-to-chat-for-whatsapp' ) ?> </label>
|
427 |
+
<p class="description"><?php _e( 'Add Categories name to show styles, Add multiple Categories by separating with a comma ( , )', 'click-to-chat-for-whatsapp' ); ?> </p>
|
428 |
</div>
|
429 |
</div>
|
430 |
|
431 |
+
<?php
|
432 |
+
if ( 'chat' == $type ) {
|
433 |
+
do_action('ht_ctc_ah_admin_chat_after_showhide');
|
434 |
+
}
|
435 |
+
do_action('ht_ctc_ah_admin_after_showhide');
|
436 |
+
?>
|
437 |
+
|
438 |
+
<p class="description"><a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/show-hide-styles/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
|
439 |
<br>
|
440 |
+
<p class="description"><?php _e( 'Usecases', 'click-to-chat-for-whatsapp' ); ?>:</p>
|
441 |
+
<p class="description"> > <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/show-only-on-selected-pages/"><?php _e( 'Show only on selected pages', 'click-to-chat-for-whatsapp' ); ?></a><?php _e( ' (Single, Cart, Checkout page)', 'click-to-chat-for-whatsapp' ); ?></p>
|
442 |
+
<p class="description"> > <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/hide-only-on-selected-pages/"><?php _e( 'Hide only on selected pages', 'click-to-chat-for-whatsapp' ); ?></a><?php _e( ' (Single, Cart, Checkout page)', 'click-to-chat-for-whatsapp' ); ?> </p>
|
443 |
+
<p class="description"> > <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/show-hide-on-mobile-desktop/"><?php _e( 'Show/Hide on Mobile/Desktop', 'click-to-chat-for-whatsapp' ); ?></a></p>
|
444 |
|
445 |
|
446 |
</div>
|
new/admin/admin_commons/admin-sidebar-content.php
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* sidebar content
|
4 |
+
*/
|
5 |
+
?>
|
6 |
+
|
7 |
+
<div class="sidebar-content">
|
8 |
+
<!-- <p>
|
9 |
+
Please let us know if you have any suggestions or feedback!! <br>
|
10 |
+
<a href="http://api.whatsapp.com/send?phone=919494429789&text=<?php echo get_bloginfo('url'); ?>%0AHi%20HoliThemes,%0AI%20have%20a%20Suggestion/Feedback:" target="_blank">WhatsApp</a> <br>
|
11 |
+
mail: wp@holithemes.com
|
12 |
+
</p> -->
|
13 |
+
|
14 |
+
<div class="col s12 m8 l12 xl12">
|
15 |
+
<div class="row">
|
16 |
+
|
17 |
+
<ul class="collapsible popout">
|
18 |
+
|
19 |
+
<!-- <li>
|
20 |
+
<div class="collapsible-header">Show/Hide on Selected pages, devices</div>
|
21 |
+
<div class="collapsible-body">
|
22 |
+
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/show-only-on-selected-pages/">Show only on selected pages</a></p>
|
23 |
+
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/hide-only-on-selected-pages/">Hide only on selected pages</a> </p>
|
24 |
+
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/show-hide-on-mobile-desktop/">Show/Hide on Mobile/Desktop</a></p>
|
25 |
+
</div>
|
26 |
+
</li> -->
|
27 |
+
|
28 |
+
<!-- <li>
|
29 |
+
<div class="collapsible-header">I Make Changes and Nothing Happens</div>
|
30 |
+
<div class="collapsible-body">
|
31 |
+
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/clear-cache/">Clear Cache:</a> <br>
|
32 |
+
  - Cache plugins <br>
|
33 |
+
  - Server cache <br>
|
34 |
+
  - Browser Cache
|
35 |
+
</p>
|
36 |
+
</div>
|
37 |
+
</li> -->
|
38 |
+
|
39 |
+
<!-- <li>
|
40 |
+
<div class="collapsible-header">Positon to place</div>
|
41 |
+
<div class="collapsible-body">
|
42 |
+
<p class="description">Center to the Screen</p>
|
43 |
+
<p class="description">Different position for mobile, desktop (pro)</p>
|
44 |
+
</div>
|
45 |
+
</li> -->
|
46 |
+
|
47 |
+
<li class="active">
|
48 |
+
<div class="collapsible-header"><?php _e( 'Contact Us', 'click-to-chat-for-whatsapp' ); ?></div>
|
49 |
+
<div class="collapsible-body">
|
50 |
+
<p class="description"><?php _e( 'Please let us know if you have any suggestions or feedback!!', 'click-to-chat-for-whatsapp' ); ?> <br><br> <a href="http://api.whatsapp.com/send?phone=919494429789&text=<?php echo get_bloginfo('url'); ?>%0AHi%20HoliThemes,%0AI%20have%20a%20Suggestion/Feedback:" target="_blank"><?php _e( 'WhatsApp', 'click-to-chat-for-whatsapp' ); ?></a></p>
|
51 |
+
<p class="description"><?php _e( 'mail', 'click-to-chat-for-whatsapp' ); ?>: wp@holithemes.com</p>
|
52 |
+
</div>
|
53 |
+
</li>
|
54 |
+
|
55 |
+
<!-- <li>
|
56 |
+
<div class="collapsible-header">HoliThemes On</div>
|
57 |
+
<div class="collapsible-body">
|
58 |
+
<p class="description"><a href="https://www.facebook.com/holithemes/" target="_blank">Facebook</a></p>
|
59 |
+
<p class="description"><a href="https://www.youtube.com/channel/UC2Tf_WB9PWffO2B3tswWCGw" target="_blank">YouTube</a></p>
|
60 |
+
<p class="description"><a href="https://twitter.com/holithemes" target="_blank">Twitter</a></p>
|
61 |
+
<p class="description"><a href="https://www.instagram.com/holithemes/" target="_blank">Instagram</a></p>
|
62 |
+
<p class="description"><a href="https://www.linkedin.com/company/holithemes" target="_blank">LinkedIn</a></p>
|
63 |
+
</div>
|
64 |
+
</li> -->
|
65 |
+
|
66 |
+
<!-- <div class="collapsible-header">Support Us</div>
|
67 |
+
<div class="collapsible-body">
|
68 |
+
<p class="description">If you like the plugin support us by giving 5 star rating</p>
|
69 |
+
</div>
|
70 |
+
</li> -->
|
71 |
+
|
72 |
+
</ul>
|
73 |
+
|
74 |
+
</div>
|
75 |
+
</div>
|
76 |
+
|
77 |
+
<!-- <div class="col s12 m8">
|
78 |
+
<div class="collection with-header">
|
79 |
+
<div class="collection-header"><bold>HoliThemes On</bold></div>
|
80 |
+
<a target="_blank" href="https://www.facebook.com/holithemes/" class="collection-item">Facebook</a>
|
81 |
+
<a target="_blank" href="https://twitter.com/holithemes" class="collection-item">Twitter</a>
|
82 |
+
<a target="_blank" href="https://www.instagram.com/holithemes/" class="collection-item">Instagram</a>
|
83 |
+
<a target="_blank" href="https://www.youtube.com/channel/UC2Tf_WB9PWffO2B3tswWCGw" class="collection-item">YouTube</a>
|
84 |
+
<a target="_blank" href="https://www.linkedin.com/company/holithemes" class="collection-item">LinkedIn</a>
|
85 |
+
</div>
|
86 |
+
</div> -->
|
87 |
+
|
88 |
+
</div>
|
new/admin/admin_commons/class-ht-ctc-admin-others.php
CHANGED
@@ -17,26 +17,34 @@ if ( ! class_exists( 'HT_CTC_Admin_Others' ) ) :
|
|
17 |
class HT_CTC_Admin_Others {
|
18 |
|
19 |
public function __construct() {
|
20 |
-
$this->
|
21 |
}
|
22 |
|
23 |
-
function
|
24 |
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
|
|
27 |
// if number blank
|
28 |
-
|
29 |
-
$ht_ctc_chat_options = get_option('ht_ctc_chat_options');
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
}
|
35 |
}
|
36 |
}
|
|
|
|
|
37 |
|
38 |
// if group id blank
|
39 |
-
if ( isset( $
|
40 |
$ht_ctc_group = get_option('ht_ctc_group');
|
41 |
|
42 |
if ( isset( $ht_ctc_group['group_id'] ) ) {
|
@@ -44,11 +52,10 @@ class HT_CTC_Admin_Others {
|
|
44 |
add_action('admin_notices', array( $this, 'ifgroupblank') );
|
45 |
}
|
46 |
}
|
47 |
-
|
48 |
}
|
49 |
|
50 |
// if share_text blank
|
51 |
-
if ( isset( $
|
52 |
$ht_ctc_share = get_option('ht_ctc_share');
|
53 |
|
54 |
if ( isset( $ht_ctc_share['share_text'] ) ) {
|
@@ -64,7 +71,8 @@ class HT_CTC_Admin_Others {
|
|
64 |
function ifnumberblank() {
|
65 |
?>
|
66 |
<div class="notice notice-info is-dismissible">
|
67 |
-
<p
|
|
|
68 |
<!-- <a href="?dismis">Dismiss</a> -->
|
69 |
</div>
|
70 |
<?php
|
@@ -73,7 +81,7 @@ class HT_CTC_Admin_Others {
|
|
73 |
function ifgroupblank() {
|
74 |
?>
|
75 |
<div class="notice notice-info is-dismissible">
|
76 |
-
<p
|
77 |
<!-- <a href="?dismis">Dismiss</a> -->
|
78 |
</div>
|
79 |
<?php
|
@@ -82,12 +90,89 @@ class HT_CTC_Admin_Others {
|
|
82 |
function ifshareblank() {
|
83 |
?>
|
84 |
<div class="notice notice-info is-dismissible">
|
85 |
-
<p
|
86 |
<!-- <a href="?dismis">Dismiss</a> -->
|
87 |
</div>
|
88 |
<?php
|
89 |
}
|
90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
|
92 |
}
|
93 |
|
17 |
class HT_CTC_Admin_Others {
|
18 |
|
19 |
public function __construct() {
|
20 |
+
$this->admin_notice();
|
21 |
}
|
22 |
|
23 |
+
function admin_notice() {
|
24 |
|
25 |
+
// clear cache
|
26 |
+
add_action( 'update_option_ht_ctc_chat_options', array( $this, 'clear_cache') );
|
27 |
+
add_action( 'update_option_ht_ctc_group', array( $this, 'clear_cache') );
|
28 |
+
add_action( 'update_option_ht_ctc_share', array( $this, 'clear_cache') );
|
29 |
+
add_action( 'update_option_ht_ctc_s2', array( $this, 'clear_cache') ); //customize styles
|
30 |
+
add_action( 'update_option_ht_ctc_s4', array( $this, 'clear_cache') );
|
31 |
+
add_action( 'update_option_ht_ctc_s8', array( $this, 'clear_cache') );
|
32 |
+
add_action( 'update_option_ht_ctc_s99', array( $this, 'clear_cache') );
|
33 |
|
34 |
+
// Admin notices
|
35 |
// if number blank
|
36 |
+
$ht_ctc_chat_options = get_option('ht_ctc_chat_options');
|
|
|
37 |
|
38 |
+
if ( isset( $ht_ctc_chat_options['number'] ) ) {
|
39 |
+
if ( '' == $ht_ctc_chat_options['number'] ) {
|
40 |
+
add_action('admin_notices', array( $this, 'ifnumberblank') );
|
|
|
41 |
}
|
42 |
}
|
43 |
+
|
44 |
+
$ht_ctc_othersettings = get_option('ht_ctc_othersettings');
|
45 |
|
46 |
// if group id blank
|
47 |
+
if ( isset( $ht_ctc_othersettings['enable_group'] ) ) {
|
48 |
$ht_ctc_group = get_option('ht_ctc_group');
|
49 |
|
50 |
if ( isset( $ht_ctc_group['group_id'] ) ) {
|
52 |
add_action('admin_notices', array( $this, 'ifgroupblank') );
|
53 |
}
|
54 |
}
|
|
|
55 |
}
|
56 |
|
57 |
// if share_text blank
|
58 |
+
if ( isset( $ht_ctc_othersettings['enable_share'] ) ) {
|
59 |
$ht_ctc_share = get_option('ht_ctc_share');
|
60 |
|
61 |
if ( isset( $ht_ctc_share['share_text'] ) ) {
|
71 |
function ifnumberblank() {
|
72 |
?>
|
73 |
<div class="notice notice-info is-dismissible">
|
74 |
+
<p><?php _e( 'Click to Chat is almost ready', 'click-to-chat-for-whatsapp' ); ?>. <a href="<?php echo admin_url('admin.php?page=click-to-chat');?>"><?php _e( 'Add WhatsApp Number', 'click-to-chat-for-whatsapp' ); ?></a> <?php _e( 'and let visitors chat', 'click-to-chat-for-whatsapp' ); ?>.</p>
|
75 |
+
<!-- <p>Click to Chat is almost ready. <a href="<?php // echo admin_url('admin.php?page=click-to-chat');?>">Add WhatsApp Number</a> to display the chat options and let visitors chat.</p> -->
|
76 |
<!-- <a href="?dismis">Dismiss</a> -->
|
77 |
</div>
|
78 |
<?php
|
81 |
function ifgroupblank() {
|
82 |
?>
|
83 |
<div class="notice notice-info is-dismissible">
|
84 |
+
<p><?php _e( 'Click to Chat is almost ready', 'click-to-chat-for-whatsapp' ); ?>. <a href="<?php echo admin_url('admin.php?page=click-to-chat-group-feature');?>"><?php _e( 'Add WhatsApp Group ID', 'click-to-chat-for-whatsapp' ); ?></a> <?php _e( 'to let visitors join in your WhatsApp Group', 'click-to-chat-for-whatsapp' ); ?>.</p>
|
85 |
<!-- <a href="?dismis">Dismiss</a> -->
|
86 |
</div>
|
87 |
<?php
|
90 |
function ifshareblank() {
|
91 |
?>
|
92 |
<div class="notice notice-info is-dismissible">
|
93 |
+
<p><?php _e( 'Click to Chat is almost ready', 'click-to-chat-for-whatsapp' ); ?>. <a href="<?php echo admin_url('admin.php?page=click-to-chat-share-feature');?>"><?php _e( 'Add Share Text', 'click-to-chat-for-whatsapp' ); ?></a> <?php _e( 'to let vistiors Share your Webpages', 'click-to-chat-for-whatsapp' ); ?>.</p>
|
94 |
<!-- <a href="?dismis">Dismiss</a> -->
|
95 |
</div>
|
96 |
<?php
|
97 |
}
|
98 |
|
99 |
+
// clear cache after save settings.
|
100 |
+
function clear_cache() {
|
101 |
+
|
102 |
+
// WP Super Cache
|
103 |
+
if ( function_exists( 'wp_cache_clear_cache' ) ) {
|
104 |
+
wp_cache_clear_cache();
|
105 |
+
}
|
106 |
+
// W3 Total Cache
|
107 |
+
if ( function_exists( 'w3tc_pgcache_flush' ) ) {
|
108 |
+
w3tc_pgcache_flush();
|
109 |
+
// w3tc_flush_all();
|
110 |
+
}
|
111 |
+
// WP Fastest Cache
|
112 |
+
if( function_exists('wpfc_clear_all_cache') ) {
|
113 |
+
wpfc_clear_all_cache();
|
114 |
+
// wpfc_clear_all_cache(true);
|
115 |
+
}
|
116 |
+
// Autoptimize
|
117 |
+
if( class_exists('autoptimizeCache') && method_exists( 'autoptimizeCache', 'clearall') ) {
|
118 |
+
autoptimizeCache::clearall();
|
119 |
+
}
|
120 |
+
// WP Rocket
|
121 |
+
if ( function_exists( 'rocket_clean_domain' ) ) {
|
122 |
+
rocket_clean_domain();
|
123 |
+
// rocket_clean_minify();
|
124 |
+
}
|
125 |
+
// WPEngine
|
126 |
+
if ( class_exists( 'WpeCommon' ) && method_exists( 'WpeCommon', 'purge_memcached' ) ) {
|
127 |
+
WpeCommon::purge_memcached();
|
128 |
+
WpeCommon::purge_varnish_cache();
|
129 |
+
}
|
130 |
+
// SG Optimizer by Siteground
|
131 |
+
if ( function_exists( 'sg_cachepress_purge_cache' ) ) {
|
132 |
+
sg_cachepress_purge_cache();
|
133 |
+
// SG_CachePress_Supercacher::purge_cache(true);
|
134 |
+
}
|
135 |
+
// LiteSpeed
|
136 |
+
if( class_exists('LiteSpeed_Cache_API') && method_exists('LiteSpeed_Cache_API', 'purge_all') ) {
|
137 |
+
LiteSpeed_Cache_API::purge_all();
|
138 |
+
}
|
139 |
+
// Cache Enabler
|
140 |
+
if( class_exists('Cache_Enabler') && method_exists('Cache_Enabler', 'clear_total_cache') ) {
|
141 |
+
Cache_Enabler::clear_total_cache();
|
142 |
+
// ce_clear_cache();
|
143 |
+
}
|
144 |
+
// Pagely
|
145 |
+
if ( class_exists('PagelyCachePurge') && method_exists('PagelyCachePurge','purgeAll') ) {
|
146 |
+
PagelyCachePurge::purgeAll();
|
147 |
+
}
|
148 |
+
// Comet cache
|
149 |
+
if( class_exists('comet_cache') && method_exists('comet_cache', 'clear') ) {
|
150 |
+
comet_cache::clear();
|
151 |
+
}
|
152 |
+
// Hummingbird Cache
|
153 |
+
if( class_exists('\Hummingbird\WP_Hummingbird') && method_exists('\Hummingbird\WP_Hummingbird', 'flush_cache') ) {
|
154 |
+
\Hummingbird\WP_Hummingbird::flush_cache();
|
155 |
+
}
|
156 |
+
// WP-Optimize
|
157 |
+
if ( function_exists( 'wpo_cache_flush' ) ) {
|
158 |
+
wpo_cache_flush();
|
159 |
+
}
|
160 |
+
|
161 |
+
// cachify_flush_cache
|
162 |
+
// pantheon_wp_clear_edge_all
|
163 |
+
// zencache
|
164 |
+
// Breeze_PurgeCache
|
165 |
+
// Swift_Performance_Cache
|
166 |
+
|
167 |
+
|
168 |
+
|
169 |
+
// clear cache
|
170 |
+
if ( function_exists('wp_cache_flush') ) {
|
171 |
+
wp_cache_flush();
|
172 |
+
}
|
173 |
+
|
174 |
+
}
|
175 |
+
|
176 |
|
177 |
}
|
178 |
|
new/admin/admin_commons/class-ht-ctc-metabox.php
CHANGED
@@ -10,6 +10,12 @@ if ( ! class_exists( 'HT_CTC_MetaBox' ) ) :
|
|
10 |
|
11 |
class HT_CTC_MetaBox {
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
/**
|
14 |
* add meta box
|
15 |
*/
|
@@ -31,7 +37,10 @@ class HT_CTC_MetaBox {
|
|
31 |
function display_meta_box( $current_post ) {
|
32 |
|
33 |
wp_nonce_field( 'ht_ctc_page_meta_box', 'ht_ctc_page_meta_box_nonce' );
|
34 |
-
|
|
|
|
|
|
|
35 |
|
36 |
?>
|
37 |
<div class="row">
|
@@ -39,40 +48,39 @@ class HT_CTC_MetaBox {
|
|
39 |
</div>
|
40 |
<?php
|
41 |
|
42 |
-
//
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
<!-- number -->
|
47 |
-
<div class="row">
|
48 |
-
<label for="number">Chat - WhatsApp Number</label><br>
|
49 |
-
<input name="ht_ctc_page_number" value="<?php echo esc_attr( get_post_meta( $current_post->ID, 'ht_ctc_page_number', true ) ); ?>" id="number" type="text">
|
50 |
-
<p class="description"><a style="text-decoration: none" target="_blank" href="https://holithemes.com/plugins/click-to-chat/whatsapp-number/">WhatsApp Number</a> with country code</p>
|
51 |
-
</div>
|
52 |
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
</
|
|
|
58 |
|
|
|
|
|
|
|
|
|
|
|
59 |
|
60 |
-
|
61 |
-
|
62 |
|
63 |
|
64 |
|
65 |
// if group enabled
|
66 |
if ( isset( $options['enable_group'] ) ) {
|
|
|
67 |
?>
|
68 |
-
|
69 |
<!-- group id -->
|
70 |
<div class="row">
|
71 |
<label for="group_id">Group - Group ID</label><br>
|
72 |
-
<input name="
|
73 |
<!-- <p class="description"><a style="text-decoration: none" target="_blank" href="https://holithemes.com/plugins/click-to-chat/whatsapp-number/">WhatsApp Number</a> with country code</p> -->
|
74 |
</div>
|
75 |
-
|
76 |
<?php
|
77 |
}
|
78 |
|
@@ -108,44 +116,30 @@ class HT_CTC_MetaBox {
|
|
108 |
return $post_id;
|
109 |
}
|
110 |
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
// call to action
|
136 |
-
if ( isset( $_POST['ht_ctc_page_call_to_action'] ) && '' == $_POST['ht_ctc_page_call_to_action'] ) {
|
137 |
-
// if empty delete
|
138 |
-
delete_post_meta($post_id, 'ht_ctc_page_call_to_action', '' );
|
139 |
-
} elseif ( isset( $_POST['ht_ctc_page_call_to_action'] ) ) {
|
140 |
-
update_post_meta( $post_id, 'ht_ctc_page_call_to_action', sanitize_text_field( $_POST['ht_ctc_page_call_to_action'] ) );
|
141 |
-
}
|
142 |
-
|
143 |
-
// group id
|
144 |
-
if ( isset( $_POST['ht_ctc_page_group_id'] ) && '' == $_POST['ht_ctc_page_group_id'] ) {
|
145 |
-
// if empty delete
|
146 |
-
delete_post_meta($post_id, 'ht_ctc_page_group_id', '' );
|
147 |
-
} elseif ( isset( $_POST['ht_ctc_page_group_id'] ) ) {
|
148 |
-
update_post_meta( $post_id, 'ht_ctc_page_group_id', sanitize_text_field( $_POST['ht_ctc_page_group_id'] ) );
|
149 |
}
|
150 |
|
151 |
}
|
@@ -158,9 +152,8 @@ class HT_CTC_MetaBox {
|
|
158 |
|
159 |
$ht_ctc_metabox = new HT_CTC_MetaBox();
|
160 |
|
161 |
-
|
162 |
add_action( 'add_meta_boxes', array($ht_ctc_metabox, 'meta_box') );
|
163 |
add_action( 'save_post', array($ht_ctc_metabox, 'save_meta_box') );
|
164 |
|
165 |
-
|
166 |
endif; // END class_exists check
|
10 |
|
11 |
class HT_CTC_MetaBox {
|
12 |
|
13 |
+
// update from previous method
|
14 |
+
function prev_meta() {
|
15 |
+
do_action('ht_ctc_ah_previous_metabox');
|
16 |
+
}
|
17 |
+
|
18 |
+
|
19 |
/**
|
20 |
* add meta box
|
21 |
*/
|
37 |
function display_meta_box( $current_post ) {
|
38 |
|
39 |
wp_nonce_field( 'ht_ctc_page_meta_box', 'ht_ctc_page_meta_box_nonce' );
|
40 |
+
|
41 |
+
$options = get_option( 'ht_ctc_othersettings' );
|
42 |
+
|
43 |
+
$ht_ctc_pagelevel = get_post_meta( $current_post->ID, 'ht_ctc_pagelevel', true );
|
44 |
|
45 |
?>
|
46 |
<div class="row">
|
48 |
</div>
|
49 |
<?php
|
50 |
|
51 |
+
// chat
|
52 |
+
$number = ( isset($ht_ctc_pagelevel['number']) ) ? esc_attr($ht_ctc_pagelevel['number']) : '';
|
53 |
+
$call_to_action = ( isset($ht_ctc_pagelevel['call_to_action']) ) ? esc_attr($ht_ctc_pagelevel['call_to_action']) : '';
|
54 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
+
<!-- number -->
|
57 |
+
<div class="row">
|
58 |
+
<label for="number">Chat - WhatsApp Number</label><br>
|
59 |
+
<input name="ht_ctc_pagelevel[number]" value="<?php echo $number ?>" id="number" type="text">
|
60 |
+
<p class="description"><a style="text-decoration: none" target="_blank" href="https://holithemes.com/plugins/click-to-chat/whatsapp-number/">WhatsApp Number</a> with country code</p>
|
61 |
+
</div>
|
62 |
|
63 |
+
<!-- call to action -->
|
64 |
+
<div class="row">
|
65 |
+
<label for="call_to_action">Chat - Call to Action</label><br>
|
66 |
+
<input name="ht_ctc_pagelevel[call_to_action]" value="<?php echo $call_to_action ?>" id="call_to_action" type="text">
|
67 |
+
</div>
|
68 |
|
69 |
+
<?php
|
70 |
+
do_action('ht_ctc_ah_admin_chat_bottom_meta_box', $current_post );
|
71 |
|
72 |
|
73 |
|
74 |
// if group enabled
|
75 |
if ( isset( $options['enable_group'] ) ) {
|
76 |
+
$group_id = ( isset($ht_ctc_pagelevel['group_id']) ) ? esc_attr($ht_ctc_pagelevel['group_id']) : '';
|
77 |
?>
|
|
|
78 |
<!-- group id -->
|
79 |
<div class="row">
|
80 |
<label for="group_id">Group - Group ID</label><br>
|
81 |
+
<input name="ht_ctc_pagelevel[group_id]" value="<?php echo $group_id ?>" id="group_id" type="text">
|
82 |
<!-- <p class="description"><a style="text-decoration: none" target="_blank" href="https://holithemes.com/plugins/click-to-chat/whatsapp-number/">WhatsApp Number</a> with country code</p> -->
|
83 |
</div>
|
|
|
84 |
<?php
|
85 |
}
|
86 |
|
116 |
return $post_id;
|
117 |
}
|
118 |
|
119 |
+
if ( isset( $_POST['ht_ctc_pagelevel'] ) ) {
|
120 |
+
|
121 |
+
$ht_ctc_pagelevel = array_filter( $_POST['ht_ctc_pagelevel'] );
|
122 |
+
|
123 |
+
if ( !empty( $ht_ctc_pagelevel ) ) {
|
124 |
+
|
125 |
+
// sanitize
|
126 |
+
foreach ($ht_ctc_pagelevel as $key => $value) {
|
127 |
+
if( isset( $ht_ctc_pagelevel[$key] ) ) {
|
128 |
+
if ( 'pre_filled' == $key ) {
|
129 |
+
$new[$key] = sanitize_textarea_field( $ht_ctc_pagelevel[$key] );
|
130 |
+
} elseif ( 'call_to_action' == $key ) {
|
131 |
+
$new[$key] = sanitize_text_field( $ht_ctc_pagelevel[$key] );
|
132 |
+
} else {
|
133 |
+
$new[$key] = sanitize_text_field( $ht_ctc_pagelevel[$key] );
|
134 |
+
}
|
135 |
+
$ht_ctc_pagelevel[$key] = $new[$key];
|
136 |
+
}
|
137 |
+
}
|
138 |
+
|
139 |
+
update_post_meta( $post_id, 'ht_ctc_pagelevel', $ht_ctc_pagelevel );
|
140 |
+
} else {
|
141 |
+
delete_post_meta($post_id, 'ht_ctc_pagelevel', '' );
|
142 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
}
|
144 |
|
145 |
}
|
152 |
|
153 |
$ht_ctc_metabox = new HT_CTC_MetaBox();
|
154 |
|
155 |
+
add_action( 'add_meta_boxes', array($ht_ctc_metabox, 'prev_meta') );
|
156 |
add_action( 'add_meta_boxes', array($ht_ctc_metabox, 'meta_box') );
|
157 |
add_action( 'save_post', array($ht_ctc_metabox, 'save_meta_box') );
|
158 |
|
|
|
159 |
endif; // END class_exists check
|
new/admin/class-ht-ctc-admin-customize-styles.php
CHANGED
@@ -16,8 +16,8 @@ class HT_CTC_Admin_Customize_Styles {
|
|
16 |
|
17 |
add_submenu_page(
|
18 |
'click-to-chat',
|
19 |
-
'Customize
|
20 |
-
'Customize
|
21 |
'manage_options',
|
22 |
'click-to-chat-customize-styles',
|
23 |
array( $this, 'settings_page' )
|
@@ -87,7 +87,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
87 |
|
88 |
public function main_settings_section_cb() {
|
89 |
?>
|
90 |
-
<h1>Customize
|
91 |
<?php
|
92 |
}
|
93 |
|
@@ -99,13 +99,13 @@ class HT_CTC_Admin_Customize_Styles {
|
|
99 |
?>
|
100 |
<ul class="collapsible" data-collapsible="accordion">
|
101 |
<li>
|
102 |
-
<div class="collapsible-header"
|
103 |
<div class="collapsible-body">
|
104 |
|
105 |
<!-- not make empty table -->
|
106 |
<input name="ht_ctc_s1[hello]" value="hello" id="" type="text" class="hide" >
|
107 |
|
108 |
-
<p class="description"
|
109 |
|
110 |
</div>
|
111 |
</div>
|
@@ -121,22 +121,22 @@ class HT_CTC_Admin_Customize_Styles {
|
|
121 |
function ht_ctc_s2_cb() {
|
122 |
|
123 |
$options = get_option('ht_ctc_s2');
|
124 |
-
$s2_img_size = (
|
125 |
?>
|
126 |
<ul class="collapsible" data-collapsible="accordion">
|
127 |
<li>
|
128 |
-
<div class="collapsible-header"
|
129 |
<div class="collapsible-body">
|
130 |
|
131 |
|
132 |
<!-- img size -->
|
133 |
<div class="row">
|
134 |
<div class="col s6">
|
135 |
-
<p
|
136 |
</div>
|
137 |
<div class="input-field col s6">
|
138 |
<input name="ht_ctc_s2[s2_img_size]" value="<?php echo $s2_img_size ?>" id="s2_img_size" type="text" class="" >
|
139 |
-
<label for="s2_img_size"
|
140 |
</div>
|
141 |
</div>
|
142 |
|
@@ -155,24 +155,137 @@ class HT_CTC_Admin_Customize_Styles {
|
|
155 |
function ht_ctc_s3_cb() {
|
156 |
|
157 |
$options = get_option('ht_ctc_s3');
|
158 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
?>
|
160 |
<ul class="collapsible" data-collapsible="accordion">
|
161 |
<li>
|
162 |
-
<div class="collapsible-header"
|
163 |
<div class="collapsible-body">
|
164 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
<!-- img size -->
|
166 |
<div class="row">
|
167 |
<div class="col s6">
|
168 |
-
<p
|
169 |
</div>
|
170 |
<div class="input-field col s6">
|
171 |
<input name="ht_ctc_s3[s3_img_size]" value="<?php echo $s3_img_size ?>" id="s3_img_size" type="text" class="" >
|
172 |
-
<label for="s3_img_size"
|
173 |
</div>
|
174 |
</div>
|
175 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
</div>
|
177 |
</div>
|
178 |
</li>
|
@@ -187,9 +300,11 @@ class HT_CTC_Admin_Customize_Styles {
|
|
187 |
function ht_ctc_s4_cb() {
|
188 |
|
189 |
$options = get_option('ht_ctc_s4');
|
190 |
-
$s4_text_color = (
|
191 |
-
$s4_bg_color = (
|
192 |
-
$s4_img_url = (
|
|
|
|
|
193 |
?>
|
194 |
<ul class="collapsible" data-collapsible="accordion">
|
195 |
<li>
|
@@ -199,7 +314,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
199 |
<!-- text color -->
|
200 |
<div class="row">
|
201 |
<div class="col s6">
|
202 |
-
<p
|
203 |
</div>
|
204 |
<div class="input-field col s6">
|
205 |
<input class="ht-ctc-color" name="ht_ctc_s4[s4_text_color]" data-default-color="#7f7d7d" value="<?php echo $s4_text_color ?>" id="s4_text_color" type="text">
|
@@ -209,24 +324,48 @@ class HT_CTC_Admin_Customize_Styles {
|
|
209 |
<!-- background color -->
|
210 |
<div class="row">
|
211 |
<div class="col s6">
|
212 |
-
<p
|
213 |
</div>
|
214 |
<div class="input-field col s6">
|
215 |
<input id="s4_bg_color" class="ht-ctc-color" data-default-color="#e4e4e4" name="ht_ctc_s4[s4_bg_color]" value="<?php echo $s4_bg_color ?>" type="text" style="height: 1.375rem;" >
|
216 |
</div>
|
217 |
</div>
|
218 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
219 |
<!-- image url -->
|
220 |
<div class="row">
|
221 |
<div class="col s6">
|
222 |
-
<p
|
223 |
</div>
|
224 |
<div class="input-field col s6">
|
225 |
<input name="ht_ctc_s4[s4_img_url]" value="<?php echo $s4_img_url ?>" id="s4_img_url" type="text" class="" >
|
226 |
-
<label for="s4_img_url"
|
227 |
</div>
|
228 |
</div>
|
229 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
|
231 |
|
232 |
</div>
|
@@ -243,50 +382,50 @@ class HT_CTC_Admin_Customize_Styles {
|
|
243 |
function ht_ctc_s5_cb() {
|
244 |
|
245 |
$options = get_option('ht_ctc_s5');
|
246 |
-
$s5_line_1 = (
|
247 |
-
$s5_line_2 = (
|
248 |
-
$s5_line_1_color = (
|
249 |
-
$s5_line_2_color = (
|
250 |
-
$s5_background_color = (
|
251 |
-
$s5_border_color = (
|
252 |
-
$s5_img = (
|
253 |
-
$s5_img_height = (
|
254 |
-
$s5_img_width = (
|
255 |
-
$s5_content_height = (
|
256 |
-
$s5_content_width = (
|
257 |
-
$select_s5_img_position = (
|
258 |
?>
|
259 |
<ul class="collapsible" data-collapsible="accordion">
|
260 |
<li>
|
261 |
-
<div class="collapsible-header"
|
262 |
<div class="collapsible-body">
|
263 |
|
264 |
<!-- s5_line_1 -->
|
265 |
<div class="row">
|
266 |
<div class="col s6">
|
267 |
-
<p
|
268 |
</div>
|
269 |
<div class="input-field col s6">
|
270 |
<input name="ht_ctc_s5[s5_line_1]" value="<?php echo $s5_line_1 ?>" id="s5_line_1" type="text" class="" >
|
271 |
-
<label for="s5_line_1"
|
272 |
</div>
|
273 |
</div>
|
274 |
|
275 |
<!-- s5_line_2 -->
|
276 |
<div class="row">
|
277 |
<div class="col s6">
|
278 |
-
<p
|
279 |
</div>
|
280 |
<div class="input-field col s6">
|
281 |
<input name="ht_ctc_s5[s5_line_2]" value="<?php echo $s5_line_2 ?>" id="s5_line_2" type="text" class="" >
|
282 |
-
<label for="s5_line_2"
|
283 |
</div>
|
284 |
</div>
|
285 |
|
286 |
<!-- s5_line_1_color -->
|
287 |
<div class="row">
|
288 |
<div class="col s6">
|
289 |
-
<p
|
290 |
</div>
|
291 |
<div class="input-field col s6">
|
292 |
<input class="ht-ctc-color" name="ht_ctc_s5[s5_line_1_color]" data-default-color="#000000" value="<?php echo $s5_line_1_color ?>" id="s5_line_1_color" type="text">
|
@@ -296,7 +435,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
296 |
<!-- s5_line_2_color -->
|
297 |
<div class="row">
|
298 |
<div class="col s6">
|
299 |
-
<p
|
300 |
</div>
|
301 |
<div class="input-field col s6">
|
302 |
<input class="ht-ctc-color" name="ht_ctc_s5[s5_line_2_color]" data-default-color="#000000" value="<?php echo $s5_line_2_color ?>" id="s5_line_2_color" type="text">
|
@@ -306,7 +445,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
306 |
<!-- s5_background_color -->
|
307 |
<div class="row">
|
308 |
<div class="col s6">
|
309 |
-
<p
|
310 |
</div>
|
311 |
<div class="input-field col s6">
|
312 |
<input class="ht-ctc-color" name="ht_ctc_s5[s5_background_color]" data-default-color="#ffffff" value="<?php echo $s5_background_color ?>" id="s5_background_color" type="text">
|
@@ -316,7 +455,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
316 |
<!-- s5_border_color -->
|
317 |
<div class="row">
|
318 |
<div class="col s6">
|
319 |
-
<p
|
320 |
</div>
|
321 |
<div class="input-field col s6">
|
322 |
<input class="ht-ctc-color" name="ht_ctc_s5[s5_border_color]" data-default-color="#dddddd" value="<?php echo $s5_border_color ?>" id="s5_border_color" type="text">
|
@@ -326,7 +465,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
326 |
<!-- s5_img -->
|
327 |
<div class="row">
|
328 |
<div class="col s6">
|
329 |
-
<p
|
330 |
</div>
|
331 |
<div class="input-field col s6">
|
332 |
<input name="ht_ctc_s5[s5_img]" value="<?php echo $s5_img ?>" id="s5_img" type="text" class="" >
|
@@ -337,58 +476,58 @@ class HT_CTC_Admin_Customize_Styles {
|
|
337 |
<!-- s5_img_height -->
|
338 |
<div class="row">
|
339 |
<div class="col s6">
|
340 |
-
<p
|
341 |
</div>
|
342 |
<div class="input-field col s6">
|
343 |
<input name="ht_ctc_s5[s5_img_height]" value="<?php echo $s5_img_height ?>" id="s5_img_height" type="text" class="" >
|
344 |
-
<label for="s5_img_height"
|
345 |
</div>
|
346 |
</div>
|
347 |
|
348 |
<!-- s5_img_width -->
|
349 |
<div class="row">
|
350 |
<div class="col s6">
|
351 |
-
<p
|
352 |
</div>
|
353 |
<div class="input-field col s6">
|
354 |
<input name="ht_ctc_s5[s5_img_width]" value="<?php echo $s5_img_width ?>" id="s5_img_width" type="text" class="" >
|
355 |
-
<label for="s5_img_width"
|
356 |
</div>
|
357 |
</div>
|
358 |
|
359 |
<!-- s5_content_height -->
|
360 |
<div class="row">
|
361 |
<div class="col s6">
|
362 |
-
<p
|
363 |
</div>
|
364 |
<div class="input-field col s6">
|
365 |
<input name="ht_ctc_s5[s5_content_height]" value="<?php echo $s5_content_height ?>" id="s5_content_height" type="text" class="" >
|
366 |
-
<label for="s5_content_height"
|
367 |
</div>
|
368 |
</div>
|
369 |
|
370 |
<!-- s5_content_width -->
|
371 |
<div class="row">
|
372 |
<div class="col s6">
|
373 |
-
<p
|
374 |
</div>
|
375 |
<div class="input-field col s6">
|
376 |
<input name="ht_ctc_s5[s5_content_width]" value="<?php echo $s5_content_width ?>" id="s5_content_width" type="text" class="" >
|
377 |
-
<label for="s5_content_width"
|
378 |
</div>
|
379 |
</div>
|
380 |
|
381 |
<!-- s5_img_position -->
|
382 |
<div class="row">
|
383 |
<div class="col s6">
|
384 |
-
<p
|
385 |
</div>
|
386 |
<div class="input-field col s6">
|
387 |
<select name="ht_ctc_s5[s5_img_position]" class="select-2">
|
388 |
-
<option value="right" <?php echo $select_s5_img_position == 'right' ? 'SELECTED' : ''; ?>
|
389 |
-
<option value="left" <?php echo $select_s5_img_position == 'left' ? 'SELECTED' : ''; ?>
|
390 |
</select>
|
391 |
-
<p class="description"
|
392 |
</div>
|
393 |
</div>
|
394 |
|
@@ -408,10 +547,10 @@ class HT_CTC_Admin_Customize_Styles {
|
|
408 |
function ht_ctc_s6_cb() {
|
409 |
|
410 |
$options = get_option('ht_ctc_s6');
|
411 |
-
$s6_txt_color = (
|
412 |
-
$s6_txt_color_on_hover = (
|
413 |
-
$text_decoration_value = (
|
414 |
-
$text_decoration_hover_value = (
|
415 |
?>
|
416 |
<ul class="collapsible" data-collapsible="accordion">
|
417 |
<li>
|
@@ -421,7 +560,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
421 |
<!-- text color -->
|
422 |
<div class="row">
|
423 |
<div class="col s6">
|
424 |
-
<p
|
425 |
</div>
|
426 |
<div class="input-field col s6">
|
427 |
<!-- <input id="s6_txt_color" class="ht-ctc-color" data-default-color="#006ccc" name="ht_ctc_s6[s6_txt_color]" value="<?php echo $s6_txt_color ?>" type="text" style="height: 1.375rem;" > -->
|
@@ -433,7 +572,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
433 |
<!-- text color on hover -->
|
434 |
<div class="row">
|
435 |
<div class="col s6">
|
436 |
-
<p
|
437 |
</div>
|
438 |
<div class="input-field col s6">
|
439 |
<!-- <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 $s6_txt_color_on_hover ?>" type="text" style="height: 1.375rem;" > -->
|
@@ -444,7 +583,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
444 |
<!-- Text Decoration - none/initial/underline/overline/... -->
|
445 |
<div class="row">
|
446 |
<div class="col s6">
|
447 |
-
<p
|
448 |
</div>
|
449 |
<div class="input-field col s6">
|
450 |
<select name="ht_ctc_s6[s6_txt_decoration]" class="select-2">
|
@@ -461,7 +600,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
461 |
<!-- Text Decoration when hover - none/initial/underline/overline/... -->
|
462 |
<div class="row">
|
463 |
<div class="col s6">
|
464 |
-
<p
|
465 |
</div>
|
466 |
<div class="input-field col s6">
|
467 |
<select name="ht_ctc_s6[s6_txt_decoration_on_hover]" class="select-2">
|
@@ -488,34 +627,34 @@ class HT_CTC_Admin_Customize_Styles {
|
|
488 |
function ht_ctc_s7_cb() {
|
489 |
|
490 |
$options = get_option('ht_ctc_s7');
|
491 |
-
$s7_icon_size = (
|
492 |
-
$s7_icon_color = (
|
493 |
-
$s7_icon_color_hover = (
|
494 |
-
$s7_border_size = (
|
495 |
-
$s7_border_color = (
|
496 |
-
$s7_border_color_hover = (
|
497 |
-
$s7_border_radius = (
|
498 |
?>
|
499 |
<ul class="collapsible" data-collapsible="accordion">
|
500 |
<li>
|
501 |
-
<div class="collapsible-header"
|
502 |
<div class="collapsible-body">
|
503 |
|
504 |
<!-- s7_icon_size -->
|
505 |
<div class="row">
|
506 |
<div class="col s6">
|
507 |
-
<p
|
508 |
</div>
|
509 |
<div class="input-field col s6">
|
510 |
<input name="ht_ctc_s7[s7_icon_size]" value="<?php echo $s7_icon_size ?>" id="s7_icon_size" type="text" class="" >
|
511 |
-
<label for="s7_icon_size"
|
512 |
</div>
|
513 |
</div>
|
514 |
|
515 |
<!-- s7_icon_color -->
|
516 |
<div class="row">
|
517 |
<div class="col s6">
|
518 |
-
<p
|
519 |
</div>
|
520 |
<div class="input-field col s6">
|
521 |
<input id="s7_icon_color" class="ht-ctc-color" data-default-color="#ffffff" name="ht_ctc_s7[s7_icon_color]" value="<?php echo $s7_icon_color ?>" type="text" style="height: 1.375rem;" >
|
@@ -525,7 +664,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
525 |
<!-- s7_icon_color_hover -->
|
526 |
<div class="row">
|
527 |
<div class="col s6">
|
528 |
-
<p
|
529 |
</div>
|
530 |
<div class="input-field col s6">
|
531 |
<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 $s7_icon_color_hover ?>" type="text" style="height: 1.375rem;" >
|
@@ -535,46 +674,48 @@ class HT_CTC_Admin_Customize_Styles {
|
|
535 |
<!-- s7_border_size -->
|
536 |
<div class="row">
|
537 |
<div class="col s6">
|
538 |
-
<p
|
539 |
</div>
|
540 |
<div class="input-field col s6">
|
541 |
<input name="ht_ctc_s7[s7_border_size]" value="<?php echo $s7_border_size ?>" id="s7_border_size" type="text" class="" >
|
542 |
-
<label for="s7_border_size"
|
543 |
-
<p class="description"
|
544 |
</div>
|
545 |
</div>
|
546 |
|
547 |
<!-- s7_border_color -->
|
548 |
<div class="row">
|
549 |
<div class="col s6">
|
550 |
-
<p
|
551 |
</div>
|
552 |
<div class="input-field col s6">
|
553 |
-
<input id="s7_border_color" class="ht-ctc-color" data-default-color="#
|
554 |
</div>
|
555 |
</div>
|
556 |
|
557 |
<!-- s7_border_color_hover -->
|
558 |
<div class="row">
|
559 |
<div class="col s6">
|
560 |
-
<p
|
561 |
</div>
|
562 |
<div class="input-field col s6">
|
563 |
-
<input id="s7_border_color_hover" class="ht-ctc-color" data-default-color="#
|
564 |
</div>
|
565 |
</div>
|
566 |
|
567 |
<!-- s7_border_radius -->
|
568 |
<div class="row">
|
569 |
<div class="col s6">
|
570 |
-
<p
|
571 |
</div>
|
572 |
<div class="input-field col s6">
|
573 |
<input name="ht_ctc_s7[s7_border_radius]" value="<?php echo $s7_border_radius ?>" id="s7_border_radius" type="text" class="" >
|
574 |
-
<label for="s7_border_radius"
|
575 |
-
<p class="description"
|
576 |
</div>
|
577 |
</div>
|
|
|
|
|
578 |
|
579 |
</div>
|
580 |
</div>
|
@@ -591,27 +732,27 @@ class HT_CTC_Admin_Customize_Styles {
|
|
591 |
function ht_ctc_s8_cb() {
|
592 |
|
593 |
$options = get_option('ht_ctc_s8');
|
594 |
-
$s8_txt_color = (
|
595 |
-
$s8_txt_color_on_hover = (
|
596 |
-
$s8_bg_color = (
|
597 |
-
$s8_bg_color_on_hover = (
|
598 |
-
$s8_icon_color = (
|
599 |
-
$s8_icon_color_on_hover = (
|
600 |
-
$icon_position_value = (
|
601 |
-
$s8_text_size = (
|
602 |
-
$s8_icon_size = (
|
603 |
-
$s8_btn_size = (
|
604 |
?>
|
605 |
<ul class="collapsible" data-collapsible="accordion">
|
606 |
<li>
|
607 |
-
<div class="collapsible-header"
|
608 |
<div class="collapsible-body">
|
609 |
|
610 |
|
611 |
<!-- text color -->
|
612 |
<div class="row">
|
613 |
<div class="col s6">
|
614 |
-
<p
|
615 |
</div>
|
616 |
<div class="input-field col s6">
|
617 |
<input id="s8_txt_color" class="ht-ctc-color" data-default-color="#ffffff" name="ht_ctc_s8[s8_txt_color]" value="<?php echo $s8_txt_color ?>" type="text" style="height: 1.375rem;" >
|
@@ -623,7 +764,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
623 |
<!-- text color on hover -->
|
624 |
<div class="row">
|
625 |
<div class="col s6">
|
626 |
-
<p
|
627 |
</div>
|
628 |
<div class="input-field col s6">
|
629 |
<input id="s8_txt_color_on_hover" class="ht-ctc-color" data-default-color="#ffffff" name="ht_ctc_s8[s8_txt_color_on_hover]" value="<?php echo $s8_txt_color_on_hover ?>" type="text" style="height: 1.375rem;" >
|
@@ -635,7 +776,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
635 |
<!-- background color -->
|
636 |
<div class="row">
|
637 |
<div class="col s6">
|
638 |
-
<p
|
639 |
</div>
|
640 |
<div class="input-field col s6">
|
641 |
<input id="s8_bg_color" class="ht-ctc-color" data-default-color="#26a69a" name="ht_ctc_s8[s8_bg_color]" value="<?php echo $s8_bg_color ?>" type="text" style="height: 1.375rem;" >
|
@@ -647,7 +788,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
647 |
<!-- background color on hover -->
|
648 |
<div class="row">
|
649 |
<div class="col s6">
|
650 |
-
<p
|
651 |
</div>
|
652 |
<div class="input-field col s6">
|
653 |
<input id="s8_bg_color_on_hover" class="ht-ctc-color" data-default-color="#26a69a" name="ht_ctc_s8[s8_bg_color_on_hover]" value="<?php echo $s8_bg_color_on_hover ?>" type="text" style="height: 1.375rem;" >
|
@@ -659,7 +800,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
659 |
<!-- icon color -->
|
660 |
<div class="row">
|
661 |
<div class="col s6">
|
662 |
-
<p
|
663 |
</div>
|
664 |
<div class="input-field col s6">
|
665 |
<input id="s8_icon_color" class="ht-ctc-color" data-default-color="#ffffff" name="ht_ctc_s8[s8_icon_color]" value="<?php echo $s8_icon_color ?>" type="text" style="height: 1.375rem;" >
|
@@ -671,7 +812,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
671 |
<!-- icon color on hover -->
|
672 |
<div class="row">
|
673 |
<div class="col s6">
|
674 |
-
<p
|
675 |
</div>
|
676 |
<div class="input-field col s6">
|
677 |
<input id="s8_icon_color_on_hover" class="ht-ctc-color" data-default-color="#ffffff" name="ht_ctc_s8[s8_icon_color_on_hover]" value="<?php echo $s8_icon_color_on_hover ?>" type="text" style="height: 1.375rem;" >
|
@@ -685,7 +826,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
685 |
<!-- icon position - left/right -->
|
686 |
<div class="row">
|
687 |
<div class="col s6">
|
688 |
-
<p
|
689 |
</div>
|
690 |
<div class="input-field col s6">
|
691 |
<select name="ht_ctc_s8[s8_icon_position]" class="select-2">
|
@@ -701,12 +842,12 @@ class HT_CTC_Admin_Customize_Styles {
|
|
701 |
<!-- Text Size -->
|
702 |
<div class="row">
|
703 |
<div class="col s6">
|
704 |
-
<p
|
705 |
</div>
|
706 |
<div class="input-field col s6">
|
707 |
<input name="ht_ctc_s8[s8_text_size]" value="<?php echo $s8_text_size ?>" id="s8_text_size" type="text" class="" >
|
708 |
-
<label for="s8_text_size"
|
709 |
-
<span class="helper-text"
|
710 |
</div>
|
711 |
</div>
|
712 |
|
@@ -717,20 +858,20 @@ class HT_CTC_Admin_Customize_Styles {
|
|
717 |
</div>
|
718 |
<div class="input-field col s6">
|
719 |
<input name="ht_ctc_s8[s8_icon_size]" value="<?php echo $s8_icon_size ?>" id="s8_icon_size" type="text" class="" >
|
720 |
-
<label for="s8_icon_size"
|
721 |
-
<span class="helper-text"
|
722 |
</div>
|
723 |
</div>
|
724 |
|
725 |
<!-- button size - btn, btn-large -->
|
726 |
<div class="row">
|
727 |
<div class="col s6">
|
728 |
-
<p
|
729 |
</div>
|
730 |
<div class="input-field col s6">
|
731 |
<select name="ht_ctc_s8[s8_btn_size]" class="select-2">
|
732 |
-
<option value="btn" <?php echo $s8_btn_size == 'btn' ? 'SELECTED' : ''; ?>
|
733 |
-
<option value="btn-large" <?php echo $s8_btn_size == 'btn-large' ? 'SELECTED' : ''; ?>
|
734 |
</select>
|
735 |
</div>
|
736 |
</div>
|
@@ -750,16 +891,16 @@ class HT_CTC_Admin_Customize_Styles {
|
|
750 |
function ht_ctc_s99_cb() {
|
751 |
|
752 |
$options = get_option('ht_ctc_s99');
|
753 |
-
$s99_dekstop_img_url = (
|
754 |
-
$s99_mobile_img_url = (
|
755 |
-
$s99_desktop_img_height = (
|
756 |
-
$s99_desktop_img_width = (
|
757 |
-
$s99_mobile_img_height = (
|
758 |
-
$s99_mobile_img_width = (
|
759 |
?>
|
760 |
<ul class="collapsible" data-collapsible="accordion">
|
761 |
<li>
|
762 |
-
<div class="collapsible-header"
|
763 |
<div class="collapsible-body">
|
764 |
|
765 |
<!-- Image URL - Desktop -->
|
@@ -769,7 +910,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
769 |
</div> -->
|
770 |
<div class="input-field col s12">
|
771 |
<input name="ht_ctc_s99[s99_dekstop_img_url]" value="<?php echo $s99_dekstop_img_url ?>" id="s99_dekstop_img_url" type="text" class="" >
|
772 |
-
<label for="s99_dekstop_img_url"
|
773 |
</div>
|
774 |
</div>
|
775 |
|
@@ -780,51 +921,51 @@ class HT_CTC_Admin_Customize_Styles {
|
|
780 |
</div> -->
|
781 |
<div class="input-field col s12">
|
782 |
<input name="ht_ctc_s99[s99_mobile_img_url]" value="<?php echo $s99_mobile_img_url ?>" id="s99_mobile_img_url" type="text" class="" >
|
783 |
-
<label for="s99_mobile_img_url"
|
784 |
</div>
|
785 |
</div>
|
786 |
|
787 |
<!-- Desktop - Image Height -->
|
788 |
<div class="row">
|
789 |
<div class="col s6">
|
790 |
-
<p
|
791 |
</div>
|
792 |
<div class="input-field col s6">
|
793 |
<input name="ht_ctc_s99[s99_desktop_img_height]" value="<?php echo $s99_desktop_img_height ?>" id="s99_desktop_img_height" type="text" class="" >
|
794 |
-
<label for="s99_desktop_img_height"
|
795 |
</div>
|
796 |
</div>
|
797 |
|
798 |
<!-- Desktop - Image Width -->
|
799 |
<div class="row">
|
800 |
<div class="col s6">
|
801 |
-
<p
|
802 |
</div>
|
803 |
<div class="input-field col s6">
|
804 |
<input name="ht_ctc_s99[s99_desktop_img_width]" value="<?php echo $s99_desktop_img_width ?>" id="s99_desktop_img_width" type="text" class="" >
|
805 |
-
<label for="s99_desktop_img_width"
|
806 |
</div>
|
807 |
</div>
|
808 |
|
809 |
<!-- Mobile - Image Height -->
|
810 |
<div class="row">
|
811 |
<div class="col s6">
|
812 |
-
<p
|
813 |
</div>
|
814 |
<div class="input-field col s6">
|
815 |
<input name="ht_ctc_s99[s99_mobile_img_height]" value="<?php echo $s99_mobile_img_height ?>" id="s99_mobile_img_height" type="text" class="" >
|
816 |
-
<label for="s99_mobile_img_height"
|
817 |
</div>
|
818 |
</div>
|
819 |
|
820 |
<!-- Mobile - Image Width -->
|
821 |
<div class="row">
|
822 |
<div class="col s6">
|
823 |
-
<p
|
824 |
</div>
|
825 |
<div class="input-field col s6">
|
826 |
<input name="ht_ctc_s99[s99_mobile_img_width]" value="<?php echo $s99_mobile_img_width ?>" id="s99_mobile_img_width" type="text" class="" >
|
827 |
-
<label for="s99_mobile_img_width"
|
828 |
</div>
|
829 |
</div>
|
830 |
|
@@ -845,22 +986,110 @@ class HT_CTC_Admin_Customize_Styles {
|
|
845 |
function ht_ctc_othersettings_cb() {
|
846 |
|
847 |
$options = get_option('ht_ctc_othersettings');
|
|
|
848 |
?>
|
849 |
|
850 |
-
<ul class="collapsible" data-collapsible="accordion">
|
851 |
-
<li>
|
852 |
-
<div class="collapsible-header"
|
853 |
<div class="collapsible-body">
|
854 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
855 |
<?php
|
856 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
857 |
// Facebook Analytics
|
858 |
if ( isset( $options['fb_analytics'] ) ) {
|
859 |
?>
|
860 |
<p>
|
861 |
<label>
|
862 |
<input name="ht_ctc_othersettings[fb_analytics]" type="checkbox" value="1" <?php checked( $options['fb_analytics'], 1 ); ?> id="fb_analytics" />
|
863 |
-
<span
|
864 |
</label>
|
865 |
</p>
|
866 |
<?php
|
@@ -869,15 +1098,40 @@ class HT_CTC_Admin_Customize_Styles {
|
|
869 |
<p>
|
870 |
<label>
|
871 |
<input name="ht_ctc_othersettings[fb_analytics]" type="checkbox" value="1" id="fb_analytics" />
|
872 |
-
<span
|
873 |
</label>
|
874 |
</p>
|
875 |
<?php
|
876 |
}
|
877 |
?>
|
878 |
-
<p class="description"> This feature is <b
|
879 |
-
<p class="description"> If Facebook Analytics installed - creates an Event there - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/facebook-analytics/"
|
880 |
<br><br><br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
881 |
|
882 |
|
883 |
|
@@ -890,6 +1144,78 @@ class HT_CTC_Admin_Customize_Styles {
|
|
890 |
}
|
891 |
|
892 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
893 |
}
|
894 |
|
895 |
$ht_ctc_admin_customize_styles = new HT_CTC_Admin_Customize_Styles();
|
16 |
|
17 |
add_submenu_page(
|
18 |
'click-to-chat',
|
19 |
+
'Customize',
|
20 |
+
'Customize',
|
21 |
'manage_options',
|
22 |
'click-to-chat-customize-styles',
|
23 |
array( $this, 'settings_page' )
|
87 |
|
88 |
public function main_settings_section_cb() {
|
89 |
?>
|
90 |
+
<h1>Customize</h1>
|
91 |
<?php
|
92 |
}
|
93 |
|
99 |
?>
|
100 |
<ul class="collapsible" data-collapsible="accordion">
|
101 |
<li>
|
102 |
+
<div class="collapsible-header"><?php _e( 'Style 1', 'click-to-chat-for-whatsapp' ); ?></div>
|
103 |
<div class="collapsible-body">
|
104 |
|
105 |
<!-- not make empty table -->
|
106 |
<input name="ht_ctc_s1[hello]" value="hello" id="" type="text" class="hide" >
|
107 |
|
108 |
+
<p class="description"><?php _e( 'Style-1 is a button that appears like themes button', 'click-to-chat-for-whatsapp' ); ?></p>
|
109 |
|
110 |
</div>
|
111 |
</div>
|
121 |
function ht_ctc_s2_cb() {
|
122 |
|
123 |
$options = get_option('ht_ctc_s2');
|
124 |
+
$s2_img_size = ( isset( $options['s2_img_size']) ) ? esc_attr( $options['s2_img_size'] ) : '';
|
125 |
?>
|
126 |
<ul class="collapsible" data-collapsible="accordion">
|
127 |
<li>
|
128 |
+
<div class="collapsible-header"><?php _e( 'Style 2', 'click-to-chat-for-whatsapp' ); ?></div>
|
129 |
<div class="collapsible-body">
|
130 |
|
131 |
|
132 |
<!-- img size -->
|
133 |
<div class="row">
|
134 |
<div class="col s6">
|
135 |
+
<p><?php _e( 'Image Size', 'click-to-chat-for-whatsapp' ); ?></p>
|
136 |
</div>
|
137 |
<div class="input-field col s6">
|
138 |
<input name="ht_ctc_s2[s2_img_size]" value="<?php echo $s2_img_size ?>" id="s2_img_size" type="text" class="" >
|
139 |
+
<label for="s2_img_size"><?php _e( 'Image Size', 'click-to-chat-for-whatsapp' ); ?></label>
|
140 |
</div>
|
141 |
</div>
|
142 |
|
155 |
function ht_ctc_s3_cb() {
|
156 |
|
157 |
$options = get_option('ht_ctc_s3');
|
158 |
+
|
159 |
+
$select_s3_type = ( isset( $options['s3_type']) ) ? esc_attr( $options['s3_type'] ) : '1';
|
160 |
+
|
161 |
+
$s3_img_size = ( isset( $options['s3_img_size']) ) ? esc_attr( $options['s3_img_size'] ) : '';
|
162 |
+
|
163 |
+
$s3_extend_img_size = ( isset( $options['s3_extend_img_size']) ) ? esc_attr( $options['s3_extend_img_size'] ) : '';
|
164 |
+
$s3_padding = ( isset( $options['s3_padding']) ) ? esc_attr( $options['s3_padding'] ) : '';
|
165 |
+
|
166 |
+
$s3_bg_color = ( isset( $options['s3_bg_color']) ) ? esc_attr( $options['s3_bg_color'] ) : '';
|
167 |
+
$s3_bg_color_hover = ( isset( $options['s3_bg_color_hover']) ) ? esc_attr( $options['s3_bg_color_hover'] ) : '';
|
168 |
+
|
169 |
+
// has sometimes js in not updating - can remove this later
|
170 |
+
$s3_extend_display = "";
|
171 |
+
if ( 'simple' == $select_s3_type ) {
|
172 |
+
// hide extend features
|
173 |
+
$s3_extend_display = "display: none;";
|
174 |
+
}
|
175 |
+
|
176 |
?>
|
177 |
<ul class="collapsible" data-collapsible="accordion">
|
178 |
<li>
|
179 |
+
<div class="collapsible-header"><?php _e( 'Style 3', 'click-to-chat-for-whatsapp' ); ?></div>
|
180 |
<div class="collapsible-body">
|
181 |
|
182 |
+
<!-- Simple / Extend -->
|
183 |
+
<div class="row">
|
184 |
+
<div class="col s6">
|
185 |
+
<p><?php _e( 'Style-3: Simple/Extend', 'click-to-chat-for-whatsapp' ); ?></p>
|
186 |
+
</div>
|
187 |
+
<div class="input-field col s6">
|
188 |
+
<select name="ht_ctc_s3[s3_type]" class="select_style_3_type">
|
189 |
+
<option value="simple" <?php echo $select_s3_type == 'simple' ? 'SELECTED' : ''; ?> >Simple</option>
|
190 |
+
<option value="extend" <?php echo $select_s3_type == 'extend' ? 'SELECTED' : ''; ?> >Extend</option>
|
191 |
+
</select>
|
192 |
+
</div>
|
193 |
+
</div>
|
194 |
+
|
195 |
+
|
196 |
<!-- img size -->
|
197 |
<div class="row">
|
198 |
<div class="col s6">
|
199 |
+
<p><?php _e( 'Image Size', 'click-to-chat-for-whatsapp' ); ?></p>
|
200 |
</div>
|
201 |
<div class="input-field col s6">
|
202 |
<input name="ht_ctc_s3[s3_img_size]" value="<?php echo $s3_img_size ?>" id="s3_img_size" type="text" class="" >
|
203 |
+
<label for="s3_img_size"><?php _e( 'Image Size (Default: 50px )', 'click-to-chat-for-whatsapp' ); ?></label>
|
204 |
</div>
|
205 |
</div>
|
206 |
|
207 |
+
<!-- extend settings -->
|
208 |
+
<div class="s3_type_extend" style="<?php echo $s3_extend_display ?>">
|
209 |
+
|
210 |
+
<!-- padding -->
|
211 |
+
<div class="row">
|
212 |
+
<div class="col s6">
|
213 |
+
<p><?php _e( 'Padding', 'click-to-chat-for-whatsapp' ); ?></p>
|
214 |
+
</div>
|
215 |
+
<div class="input-field col s6">
|
216 |
+
<input name="ht_ctc_s3[s3_padding]" value="<?php echo $s3_padding ?>" id="s3_padding" type="text" class="" >
|
217 |
+
<label for="s3_padding"><?php _e( 'Padding (Default: 20px )', 'click-to-chat-for-whatsapp' ); ?></label>
|
218 |
+
</div>
|
219 |
+
</div>
|
220 |
+
|
221 |
+
<!-- background color -->
|
222 |
+
<div class="row">
|
223 |
+
<div class="col s6">
|
224 |
+
<p><?php _e( 'Background Color', 'click-to-chat-for-whatsapp' ); ?></p>
|
225 |
+
</div>
|
226 |
+
<div class="input-field col s6">
|
227 |
+
<input class="ht-ctc-color" name="ht_ctc_s3[s3_bg_color]" data-default-color="#25D366" value="<?php echo $s3_bg_color ?>" id="s3_bg_color" type="text">
|
228 |
+
</div>
|
229 |
+
</div>
|
230 |
+
|
231 |
+
<!-- background color hover -->
|
232 |
+
<div class="row">
|
233 |
+
<div class="col s6">
|
234 |
+
<p><?php _e( 'Background Color on Hover', 'click-to-chat-for-whatsapp' ); ?></p>
|
235 |
+
</div>
|
236 |
+
<div class="input-field col s6">
|
237 |
+
<input class="ht-ctc-color" name="ht_ctc_s3[s3_bg_color_hover]" data-default-color="#25D366" value="<?php echo $s3_bg_color_hover ?>" id="s3_bg_color_hover" type="text">
|
238 |
+
<p class="description"><?php _e( 'E.g. Colors: #25D366, #20b038', 'click-to-chat-for-whatsapp' ); ?> </p>
|
239 |
+
</div>
|
240 |
+
</div>
|
241 |
+
<?php
|
242 |
+
|
243 |
+
// shadow
|
244 |
+
if ( isset( $options['s3_box_shadow'] ) ) {
|
245 |
+
?>
|
246 |
+
<p>
|
247 |
+
<label>
|
248 |
+
<input name="ht_ctc_s3[s3_box_shadow]" type="checkbox" value="1" <?php checked( $options['s3_box_shadow'], 1 ); ?> id="s3_box_shadow" />
|
249 |
+
<span><?php _e( 'Shadow', 'click-to-chat-for-whatsapp' ); ?></span>
|
250 |
+
</label>
|
251 |
+
</p>
|
252 |
+
<?php
|
253 |
+
} else {
|
254 |
+
?>
|
255 |
+
<p>
|
256 |
+
<label>
|
257 |
+
<input name="ht_ctc_s3[s3_box_shadow]" type="checkbox" value="1" id="s3_box_shadow" />
|
258 |
+
<span><?php _e( 'Shadow', 'click-to-chat-for-whatsapp' ); ?></span>
|
259 |
+
</label>
|
260 |
+
</p>
|
261 |
+
<?php
|
262 |
+
}
|
263 |
+
|
264 |
+
// shadow on hover
|
265 |
+
if ( isset( $options['s3_box_shadow_hover'] ) ) {
|
266 |
+
?>
|
267 |
+
<p>
|
268 |
+
<label>
|
269 |
+
<input name="ht_ctc_s3[s3_box_shadow_hover]" type="checkbox" value="1" <?php checked( $options['s3_box_shadow_hover'], 1 ); ?> id="s3_box_shadow_hover" />
|
270 |
+
<span><?php _e( 'Shadow on Hover', 'click-to-chat-for-whatsapp' ); ?></span>
|
271 |
+
</label>
|
272 |
+
</p>
|
273 |
+
<?php
|
274 |
+
} else {
|
275 |
+
?>
|
276 |
+
<p>
|
277 |
+
<label>
|
278 |
+
<input name="ht_ctc_s3[s3_box_shadow_hover]" type="checkbox" value="1" id="s3_box_shadow_hover" />
|
279 |
+
<span><?php _e( 'Shadow on Hover', 'click-to-chat-for-whatsapp' ); ?></span>
|
280 |
+
</label>
|
281 |
+
</p>
|
282 |
+
<?php
|
283 |
+
}
|
284 |
+
?>
|
285 |
+
|
286 |
+
|
287 |
+
</div>
|
288 |
+
|
289 |
</div>
|
290 |
</div>
|
291 |
</li>
|
300 |
function ht_ctc_s4_cb() {
|
301 |
|
302 |
$options = get_option('ht_ctc_s4');
|
303 |
+
$s4_text_color = ( isset( $options['s4_text_color']) ) ? esc_attr( $options['s4_text_color'] ) : '';
|
304 |
+
$s4_bg_color = ( isset( $options['s4_bg_color']) ) ? esc_attr( $options['s4_bg_color'] ) : '';
|
305 |
+
$s4_img_url = ( isset( $options['s4_img_url']) ) ? esc_attr( $options['s4_img_url'] ) : '';
|
306 |
+
$s4_img_size = ( isset( $options['s4_img_size']) ) ? esc_attr( $options['s4_img_size'] ) : '';
|
307 |
+
$select_s4_img_position = ( isset( $options['s4_img_position']) ) ? esc_attr( $options['s4_img_position'] ) : '';
|
308 |
?>
|
309 |
<ul class="collapsible" data-collapsible="accordion">
|
310 |
<li>
|
314 |
<!-- text color -->
|
315 |
<div class="row">
|
316 |
<div class="col s6">
|
317 |
+
<p><?php _e( 'Text Color', 'click-to-chat-for-whatsapp' ); ?></p>
|
318 |
</div>
|
319 |
<div class="input-field col s6">
|
320 |
<input class="ht-ctc-color" name="ht_ctc_s4[s4_text_color]" data-default-color="#7f7d7d" value="<?php echo $s4_text_color ?>" id="s4_text_color" type="text">
|
324 |
<!-- background color -->
|
325 |
<div class="row">
|
326 |
<div class="col s6">
|
327 |
+
<p><?php _e( 'Background Color', 'click-to-chat-for-whatsapp' ); ?></p>
|
328 |
</div>
|
329 |
<div class="input-field col s6">
|
330 |
<input id="s4_bg_color" class="ht-ctc-color" data-default-color="#e4e4e4" name="ht_ctc_s4[s4_bg_color]" value="<?php echo $s4_bg_color ?>" type="text" style="height: 1.375rem;" >
|
331 |
</div>
|
332 |
</div>
|
333 |
|
334 |
+
<!-- Image position -->
|
335 |
+
<div class="row">
|
336 |
+
<div class="col s6">
|
337 |
+
<p><?php _e( 'Image Position', 'click-to-chat-for-whatsapp' ); ?></p>
|
338 |
+
</div>
|
339 |
+
<div class="input-field col s6">
|
340 |
+
<select name="ht_ctc_s4[s4_img_position]" class="select-2">
|
341 |
+
<option value="left" <?php echo $select_s4_img_position == 'left' ? 'SELECTED' : ''; ?> >Left</option>
|
342 |
+
<option value="right" <?php echo $select_s4_img_position == 'right' ? 'SELECTED' : ''; ?> >Right</option>
|
343 |
+
</select>
|
344 |
+
</div>
|
345 |
+
</div>
|
346 |
+
|
347 |
<!-- image url -->
|
348 |
<div class="row">
|
349 |
<div class="col s6">
|
350 |
+
<p><?php _e( 'Image URL', 'click-to-chat-for-whatsapp' ); ?></p>
|
351 |
</div>
|
352 |
<div class="input-field col s6">
|
353 |
<input name="ht_ctc_s4[s4_img_url]" value="<?php echo $s4_img_url ?>" id="s4_img_url" type="text" class="" >
|
354 |
+
<label for="s4_img_url"><?php _e( 'Image URL(leave blank for default image)', 'click-to-chat-for-whatsapp' ); ?></label>
|
355 |
</div>
|
356 |
</div>
|
357 |
|
358 |
+
<!-- img size -->
|
359 |
+
<div class="row">
|
360 |
+
<div class="col s6">
|
361 |
+
<p><?php _e( 'Image Size', 'click-to-chat-for-whatsapp' ); ?></p>
|
362 |
+
</div>
|
363 |
+
<div class="input-field col s6">
|
364 |
+
<input name="ht_ctc_s4[s4_img_size]" value="<?php echo $s4_img_size ?>" id="s4_img_size" type="text" class="" >
|
365 |
+
<label for="s4_img_size"><?php _e( 'Image Size (default 32px)', 'click-to-chat-for-whatsapp' ); ?></label>
|
366 |
+
<p class="description"><?php _e( '(possible, keep the value less then or equal to 32px)', 'click-to-chat-for-whatsapp' ); ?></p>
|
367 |
+
</div>
|
368 |
+
</div>
|
369 |
|
370 |
|
371 |
</div>
|
382 |
function ht_ctc_s5_cb() {
|
383 |
|
384 |
$options = get_option('ht_ctc_s5');
|
385 |
+
$s5_line_1 = ( isset( $options['s5_line_1']) ) ? esc_attr( $options['s5_line_1'] ) : '';
|
386 |
+
$s5_line_2 = ( isset( $options['s5_line_2']) ) ? esc_attr( $options['s5_line_2'] ) : '';
|
387 |
+
$s5_line_1_color = ( isset( $options['s5_line_1_color']) ) ? esc_attr( $options['s5_line_1_color'] ) : '';
|
388 |
+
$s5_line_2_color = ( isset( $options['s5_line_2_color']) ) ? esc_attr( $options['s5_line_2_color'] ) : '';
|
389 |
+
$s5_background_color = ( isset( $options['s5_background_color']) ) ? esc_attr( $options['s5_background_color'] ) : '';
|
390 |
+
$s5_border_color = ( isset( $options['s5_border_color']) ) ? esc_attr( $options['s5_border_color'] ) : '';
|
391 |
+
$s5_img = ( isset( $options['s5_img']) ) ? esc_attr( $options['s5_img'] ) : '';
|
392 |
+
$s5_img_height = ( isset( $options['s5_img_height']) ) ? esc_attr( $options['s5_img_height'] ) : '';
|
393 |
+
$s5_img_width = ( isset( $options['s5_img_width']) ) ? esc_attr( $options['s5_img_width'] ) : '';
|
394 |
+
$s5_content_height = ( isset( $options['s5_content_height']) ) ? esc_attr( $options['s5_content_height'] ) : '';
|
395 |
+
$s5_content_width = ( isset( $options['s5_content_width']) ) ? esc_attr( $options['s5_content_width'] ) : '';
|
396 |
+
$select_s5_img_position = ( isset( $options['s5_img_position']) ) ? esc_attr( $options['s5_img_position'] ) : '';
|
397 |
?>
|
398 |
<ul class="collapsible" data-collapsible="accordion">
|
399 |
<li>
|
400 |
+
<div class="collapsible-header"><?php _e( 'Style 5', 'click-to-chat-for-whatsapp' ); ?></div>
|
401 |
<div class="collapsible-body">
|
402 |
|
403 |
<!-- s5_line_1 -->
|
404 |
<div class="row">
|
405 |
<div class="col s6">
|
406 |
+
<p><?php _e( 'Line 1', 'click-to-chat-for-whatsapp' ); ?></p>
|
407 |
</div>
|
408 |
<div class="input-field col s6">
|
409 |
<input name="ht_ctc_s5[s5_line_1]" value="<?php echo $s5_line_1 ?>" id="s5_line_1" type="text" class="" >
|
410 |
+
<label for="s5_line_1"><?php _e( 'Line 1', 'click-to-chat-for-whatsapp' ); ?></label>
|
411 |
</div>
|
412 |
</div>
|
413 |
|
414 |
<!-- s5_line_2 -->
|
415 |
<div class="row">
|
416 |
<div class="col s6">
|
417 |
+
<p><?php _e( 'Line 2', 'click-to-chat-for-whatsapp' ); ?></p>
|
418 |
</div>
|
419 |
<div class="input-field col s6">
|
420 |
<input name="ht_ctc_s5[s5_line_2]" value="<?php echo $s5_line_2 ?>" id="s5_line_2" type="text" class="" >
|
421 |
+
<label for="s5_line_2"><?php _e( 'Line 2', 'click-to-chat-for-whatsapp' ); ?></label>
|
422 |
</div>
|
423 |
</div>
|
424 |
|
425 |
<!-- s5_line_1_color -->
|
426 |
<div class="row">
|
427 |
<div class="col s6">
|
428 |
+
<p><?php _e( 'Line 1 - Text Color', 'click-to-chat-for-whatsapp' ); ?></p>
|
429 |
</div>
|
430 |
<div class="input-field col s6">
|
431 |
<input class="ht-ctc-color" name="ht_ctc_s5[s5_line_1_color]" data-default-color="#000000" value="<?php echo $s5_line_1_color ?>" id="s5_line_1_color" type="text">
|
435 |
<!-- s5_line_2_color -->
|
436 |
<div class="row">
|
437 |
<div class="col s6">
|
438 |
+
<p><?php _e( 'Line 2 - Text Color', 'click-to-chat-for-whatsapp' ); ?></p>
|
439 |
</div>
|
440 |
<div class="input-field col s6">
|
441 |
<input class="ht-ctc-color" name="ht_ctc_s5[s5_line_2_color]" data-default-color="#000000" value="<?php echo $s5_line_2_color ?>" id="s5_line_2_color" type="text">
|
445 |
<!-- s5_background_color -->
|
446 |
<div class="row">
|
447 |
<div class="col s6">
|
448 |
+
<p><?php _e( 'Content Box Background Color', 'click-to-chat-for-whatsapp' ); ?></p>
|
449 |
</div>
|
450 |
<div class="input-field col s6">
|
451 |
<input class="ht-ctc-color" name="ht_ctc_s5[s5_background_color]" data-default-color="#ffffff" value="<?php echo $s5_background_color ?>" id="s5_background_color" type="text">
|
455 |
<!-- s5_border_color -->
|
456 |
<div class="row">
|
457 |
<div class="col s6">
|
458 |
+
<p><?php _e( 'Content Box Border Color', 'click-to-chat-for-whatsapp' ); ?></p>
|
459 |
</div>
|
460 |
<div class="input-field col s6">
|
461 |
<input class="ht-ctc-color" name="ht_ctc_s5[s5_border_color]" data-default-color="#dddddd" value="<?php echo $s5_border_color ?>" id="s5_border_color" type="text">
|
465 |
<!-- s5_img -->
|
466 |
<div class="row">
|
467 |
<div class="col s6">
|
468 |
+
<p><?php _e( 'Image URL', 'click-to-chat-for-whatsapp' ); ?></p>
|
469 |
</div>
|
470 |
<div class="input-field col s6">
|
471 |
<input name="ht_ctc_s5[s5_img]" value="<?php echo $s5_img ?>" id="s5_img" type="text" class="" >
|
476 |
<!-- s5_img_height -->
|
477 |
<div class="row">
|
478 |
<div class="col s6">
|
479 |
+
<p><?php _e( 'Image Height', 'click-to-chat-for-whatsapp' ); ?></p>
|
480 |
</div>
|
481 |
<div class="input-field col s6">
|
482 |
<input name="ht_ctc_s5[s5_img_height]" value="<?php echo $s5_img_height ?>" id="s5_img_height" type="text" class="" >
|
483 |
+
<label for="s5_img_height"><?php _e( 'Image Height', 'click-to-chat-for-whatsapp' ); ?></label>
|
484 |
</div>
|
485 |
</div>
|
486 |
|
487 |
<!-- s5_img_width -->
|
488 |
<div class="row">
|
489 |
<div class="col s6">
|
490 |
+
<p><?php _e( 'Image Width', 'click-to-chat-for-whatsapp' ); ?></p>
|
491 |
</div>
|
492 |
<div class="input-field col s6">
|
493 |
<input name="ht_ctc_s5[s5_img_width]" value="<?php echo $s5_img_width ?>" id="s5_img_width" type="text" class="" >
|
494 |
+
<label for="s5_img_width"><?php _e( 'Image Width', 'click-to-chat-for-whatsapp' ); ?></label>
|
495 |
</div>
|
496 |
</div>
|
497 |
|
498 |
<!-- s5_content_height -->
|
499 |
<div class="row">
|
500 |
<div class="col s6">
|
501 |
+
<p><?php _e( 'Content Box Height', 'click-to-chat-for-whatsapp' ); ?></p>
|
502 |
</div>
|
503 |
<div class="input-field col s6">
|
504 |
<input name="ht_ctc_s5[s5_content_height]" value="<?php echo $s5_content_height ?>" id="s5_content_height" type="text" class="" >
|
505 |
+
<label for="s5_content_height"><?php _e( 'Content Box Height', 'click-to-chat-for-whatsapp' ); ?></label>
|
506 |
</div>
|
507 |
</div>
|
508 |
|
509 |
<!-- s5_content_width -->
|
510 |
<div class="row">
|
511 |
<div class="col s6">
|
512 |
+
<p><?php _e( 'Content Box Width', 'click-to-chat-for-whatsapp' ); ?></p>
|
513 |
</div>
|
514 |
<div class="input-field col s6">
|
515 |
<input name="ht_ctc_s5[s5_content_width]" value="<?php echo $s5_content_width ?>" id="s5_content_width" type="text" class="" >
|
516 |
+
<label for="s5_content_width"><?php _e( 'Content Box Width', 'click-to-chat-for-whatsapp' ); ?></label>
|
517 |
</div>
|
518 |
</div>
|
519 |
|
520 |
<!-- s5_img_position -->
|
521 |
<div class="row">
|
522 |
<div class="col s6">
|
523 |
+
<p><?php _e( 'Image Position', 'click-to-chat-for-whatsapp' ); ?></p>
|
524 |
</div>
|
525 |
<div class="input-field col s6">
|
526 |
<select name="ht_ctc_s5[s5_img_position]" class="select-2">
|
527 |
+
<option value="right" <?php echo $select_s5_img_position == 'right' ? 'SELECTED' : ''; ?> ><?php _e( 'Right', 'click-to-chat-for-whatsapp' ); ?></option>
|
528 |
+
<option value="left" <?php echo $select_s5_img_position == 'left' ? 'SELECTED' : ''; ?> ><?php _e( 'Left', 'click-to-chat-for-whatsapp' ); ?></option>
|
529 |
</select>
|
530 |
+
<p class="description"><?php _e( 'If style position/located: Right to screen then select Right, if Left to screen then select Left', 'click-to-chat-for-whatsapp' ); ?></p>
|
531 |
</div>
|
532 |
</div>
|
533 |
|
547 |
function ht_ctc_s6_cb() {
|
548 |
|
549 |
$options = get_option('ht_ctc_s6');
|
550 |
+
$s6_txt_color = ( isset( $options['s6_txt_color']) ) ? esc_attr( $options['s6_txt_color'] ) : '';
|
551 |
+
$s6_txt_color_on_hover = ( isset( $options['s6_txt_color_on_hover']) ) ? esc_attr( $options['s6_txt_color_on_hover'] ) : '';
|
552 |
+
$text_decoration_value = ( isset( $options['s6_txt_decoration']) ) ? esc_attr( $options['s6_txt_decoration'] ) : '';
|
553 |
+
$text_decoration_hover_value = ( isset( $options['s6_txt_decoration_on_hover']) ) ? esc_attr( $options['s6_txt_decoration_on_hover'] ) : '';
|
554 |
?>
|
555 |
<ul class="collapsible" data-collapsible="accordion">
|
556 |
<li>
|
560 |
<!-- text color -->
|
561 |
<div class="row">
|
562 |
<div class="col s6">
|
563 |
+
<p><?php _e( 'Text Color', 'click-to-chat-for-whatsapp' ); ?></p>
|
564 |
</div>
|
565 |
<div class="input-field col s6">
|
566 |
<!-- <input id="s6_txt_color" class="ht-ctc-color" data-default-color="#006ccc" name="ht_ctc_s6[s6_txt_color]" value="<?php echo $s6_txt_color ?>" type="text" style="height: 1.375rem;" > -->
|
572 |
<!-- text color on hover -->
|
573 |
<div class="row">
|
574 |
<div class="col s6">
|
575 |
+
<p><?php _e( 'Text Color on Hover', 'click-to-chat-for-whatsapp' ); ?></p>
|
576 |
</div>
|
577 |
<div class="input-field col s6">
|
578 |
<!-- <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 $s6_txt_color_on_hover ?>" type="text" style="height: 1.375rem;" > -->
|
583 |
<!-- Text Decoration - none/initial/underline/overline/... -->
|
584 |
<div class="row">
|
585 |
<div class="col s6">
|
586 |
+
<p><?php _e( 'Text Decoration', 'click-to-chat-for-whatsapp' ); ?></p>
|
587 |
</div>
|
588 |
<div class="input-field col s6">
|
589 |
<select name="ht_ctc_s6[s6_txt_decoration]" class="select-2">
|
600 |
<!-- Text Decoration when hover - none/initial/underline/overline/... -->
|
601 |
<div class="row">
|
602 |
<div class="col s6">
|
603 |
+
<p><?php _e( 'Text Decoration when Hover', 'click-to-chat-for-whatsapp' ); ?></p>
|
604 |
</div>
|
605 |
<div class="input-field col s6">
|
606 |
<select name="ht_ctc_s6[s6_txt_decoration_on_hover]" class="select-2">
|
627 |
function ht_ctc_s7_cb() {
|
628 |
|
629 |
$options = get_option('ht_ctc_s7');
|
630 |
+
$s7_icon_size = ( isset( $options['s7_icon_size']) ) ? esc_attr( $options['s7_icon_size'] ) : '';
|
631 |
+
$s7_icon_color = ( isset( $options['s7_icon_color']) ) ? esc_attr( $options['s7_icon_color'] ) : '';
|
632 |
+
$s7_icon_color_hover = ( isset( $options['s7_icon_color_hover']) ) ? esc_attr( $options['s7_icon_color_hover'] ) : '';
|
633 |
+
$s7_border_size = ( isset( $options['s7_border_size']) ) ? esc_attr( $options['s7_border_size'] ) : '';
|
634 |
+
$s7_border_color = ( isset( $options['s7_border_color']) ) ? esc_attr( $options['s7_border_color'] ) : '';
|
635 |
+
$s7_border_color_hover = ( isset( $options['s7_border_color_hover']) ) ? esc_attr( $options['s7_border_color_hover'] ) : '';
|
636 |
+
$s7_border_radius = ( isset( $options['s7_border_radius']) ) ? esc_attr( $options['s7_border_radius'] ) : '';
|
637 |
?>
|
638 |
<ul class="collapsible" data-collapsible="accordion">
|
639 |
<li>
|
640 |
+
<div class="collapsible-header"><?php _e( 'Style 7', 'click-to-chat-for-whatsapp' ); ?></div>
|
641 |
<div class="collapsible-body">
|
642 |
|
643 |
<!-- s7_icon_size -->
|
644 |
<div class="row">
|
645 |
<div class="col s6">
|
646 |
+
<p><?php _e( 'Icon Size', 'click-to-chat-for-whatsapp' ); ?></p>
|
647 |
</div>
|
648 |
<div class="input-field col s6">
|
649 |
<input name="ht_ctc_s7[s7_icon_size]" value="<?php echo $s7_icon_size ?>" id="s7_icon_size" type="text" class="" >
|
650 |
+
<label for="s7_icon_size"><?php _e( 'Icon Size', 'click-to-chat-for-whatsapp' ); ?></label>
|
651 |
</div>
|
652 |
</div>
|
653 |
|
654 |
<!-- s7_icon_color -->
|
655 |
<div class="row">
|
656 |
<div class="col s6">
|
657 |
+
<p><?php _e( 'Icon Color', 'click-to-chat-for-whatsapp' ); ?></p>
|
658 |
</div>
|
659 |
<div class="input-field col s6">
|
660 |
<input id="s7_icon_color" class="ht-ctc-color" data-default-color="#ffffff" name="ht_ctc_s7[s7_icon_color]" value="<?php echo $s7_icon_color ?>" type="text" style="height: 1.375rem;" >
|
664 |
<!-- s7_icon_color_hover -->
|
665 |
<div class="row">
|
666 |
<div class="col s6">
|
667 |
+
<p><?php _e( 'Icon Color on Hover', 'click-to-chat-for-whatsapp' ); ?></p>
|
668 |
</div>
|
669 |
<div class="input-field col s6">
|
670 |
<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 $s7_icon_color_hover ?>" type="text" style="height: 1.375rem;" >
|
674 |
<!-- s7_border_size -->
|
675 |
<div class="row">
|
676 |
<div class="col s6">
|
677 |
+
<p><?php _e( 'Border Padding Size', 'click-to-chat-for-whatsapp' ); ?></p>
|
678 |
</div>
|
679 |
<div class="input-field col s6">
|
680 |
<input name="ht_ctc_s7[s7_border_size]" value="<?php echo $s7_border_size ?>" id="s7_border_size" type="text" class="" >
|
681 |
+
<label for="s7_border_size"><?php _e( 'Border Padding Size', 'click-to-chat-for-whatsapp' ); ?></label>
|
682 |
+
<p class="description"><?php _e( 'E.g. 12px', 'click-to-chat-for-whatsapp' ); ?></p>
|
683 |
</div>
|
684 |
</div>
|
685 |
|
686 |
<!-- s7_border_color -->
|
687 |
<div class="row">
|
688 |
<div class="col s6">
|
689 |
+
<p><?php _e( 'Background Color', 'click-to-chat-for-whatsapp' ); ?></p>
|
690 |
</div>
|
691 |
<div class="input-field col s6">
|
692 |
+
<input id="s7_border_color" class="ht-ctc-color" data-default-color="#25d366" name="ht_ctc_s7[s7_border_color]" value="<?php echo $s7_border_color ?>" type="text" style="height: 1.375rem;" >
|
693 |
</div>
|
694 |
</div>
|
695 |
|
696 |
<!-- s7_border_color_hover -->
|
697 |
<div class="row">
|
698 |
<div class="col s6">
|
699 |
+
<p><?php _e( 'Background Color on Hover', 'click-to-chat-for-whatsapp' ); ?></p>
|
700 |
</div>
|
701 |
<div class="input-field col s6">
|
702 |
+
<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 $s7_border_color_hover ?>" type="text" style="height: 1.375rem;" >
|
703 |
</div>
|
704 |
</div>
|
705 |
|
706 |
<!-- s7_border_radius -->
|
707 |
<div class="row">
|
708 |
<div class="col s6">
|
709 |
+
<p><?php _e( 'Border radius', 'click-to-chat-for-whatsapp' ); ?></p>
|
710 |
</div>
|
711 |
<div class="input-field col s6">
|
712 |
<input name="ht_ctc_s7[s7_border_radius]" value="<?php echo $s7_border_radius ?>" id="s7_border_radius" type="text" class="" >
|
713 |
+
<label for="s7_border_radius"><?php _e( 'Border radius', 'click-to-chat-for-whatsapp' ); ?></label>
|
714 |
+
<p class="description"><?php _e( 'E.g. 10px, 50% ( for round border add 50% )', 'click-to-chat-for-whatsapp' ); ?></p>
|
715 |
</div>
|
716 |
</div>
|
717 |
+
<br>
|
718 |
+
<p class="description"><?php _e( 'To display icon only - clear background-color. (May need to change icon color to display in plain background)', 'click-to-chat-for-whatsapp' ); ?> </p>
|
719 |
|
720 |
</div>
|
721 |
</div>
|
732 |
function ht_ctc_s8_cb() {
|
733 |
|
734 |
$options = get_option('ht_ctc_s8');
|
735 |
+
$s8_txt_color = ( isset( $options['s8_txt_color']) ) ? esc_attr( $options['s8_txt_color'] ) : '';
|
736 |
+
$s8_txt_color_on_hover = ( isset( $options['s8_txt_color_on_hover']) ) ? esc_attr( $options['s8_txt_color_on_hover'] ) : '';
|
737 |
+
$s8_bg_color = ( isset( $options['s8_bg_color']) ) ? esc_attr( $options['s8_bg_color'] ) : '';
|
738 |
+
$s8_bg_color_on_hover = ( isset( $options['s8_bg_color_on_hover']) ) ? esc_attr( $options['s8_bg_color_on_hover'] ) : '';
|
739 |
+
$s8_icon_color = ( isset( $options['s8_icon_color']) ) ? esc_attr( $options['s8_icon_color'] ) : '';
|
740 |
+
$s8_icon_color_on_hover = ( isset( $options['s8_icon_color_on_hover']) ) ? esc_attr( $options['s8_icon_color_on_hover'] ) : '';
|
741 |
+
$icon_position_value = ( isset( $options['s8_icon_position']) ) ? esc_attr( $options['s8_icon_position'] ) : '';
|
742 |
+
$s8_text_size = ( isset( $options['s8_text_size']) ) ? esc_attr( $options['s8_text_size'] ) : '';
|
743 |
+
$s8_icon_size = ( isset( $options['s8_icon_size']) ) ? esc_attr( $options['s8_icon_size'] ) : '';
|
744 |
+
$s8_btn_size = ( isset( $options['s8_btn_size']) ) ? esc_attr( $options['s8_btn_size'] ) : '';
|
745 |
?>
|
746 |
<ul class="collapsible" data-collapsible="accordion">
|
747 |
<li>
|
748 |
+
<div class="collapsible-header"><?php _e( 'Style 8', 'click-to-chat-for-whatsapp' ); ?></div>
|
749 |
<div class="collapsible-body">
|
750 |
|
751 |
|
752 |
<!-- text color -->
|
753 |
<div class="row">
|
754 |
<div class="col s6">
|
755 |
+
<p><?php _e( 'Text Color', 'click-to-chat-for-whatsapp' ); ?></p>
|
756 |
</div>
|
757 |
<div class="input-field col s6">
|
758 |
<input id="s8_txt_color" class="ht-ctc-color" data-default-color="#ffffff" name="ht_ctc_s8[s8_txt_color]" value="<?php echo $s8_txt_color ?>" type="text" style="height: 1.375rem;" >
|
764 |
<!-- text color on hover -->
|
765 |
<div class="row">
|
766 |
<div class="col s6">
|
767 |
+
<p><?php _e( 'Text Color on Hover', 'click-to-chat-for-whatsapp' ); ?></p>
|
768 |
</div>
|
769 |
<div class="input-field col s6">
|
770 |
<input id="s8_txt_color_on_hover" class="ht-ctc-color" data-default-color="#ffffff" name="ht_ctc_s8[s8_txt_color_on_hover]" value="<?php echo $s8_txt_color_on_hover ?>" type="text" style="height: 1.375rem;" >
|
776 |
<!-- background color -->
|
777 |
<div class="row">
|
778 |
<div class="col s6">
|
779 |
+
<p><?php _e( 'Background Color', 'click-to-chat-for-whatsapp' ); ?></p>
|
780 |
</div>
|
781 |
<div class="input-field col s6">
|
782 |
<input id="s8_bg_color" class="ht-ctc-color" data-default-color="#26a69a" name="ht_ctc_s8[s8_bg_color]" value="<?php echo $s8_bg_color ?>" type="text" style="height: 1.375rem;" >
|
788 |
<!-- background color on hover -->
|
789 |
<div class="row">
|
790 |
<div class="col s6">
|
791 |
+
<p><?php _e( 'Background Color on Hover', 'click-to-chat-for-whatsapp' ); ?></p>
|
792 |
</div>
|
793 |
<div class="input-field col s6">
|
794 |
<input id="s8_bg_color_on_hover" class="ht-ctc-color" data-default-color="#26a69a" name="ht_ctc_s8[s8_bg_color_on_hover]" value="<?php echo $s8_bg_color_on_hover ?>" type="text" style="height: 1.375rem;" >
|
800 |
<!-- icon color -->
|
801 |
<div class="row">
|
802 |
<div class="col s6">
|
803 |
+
<p><?php _e( 'Icon Color', 'click-to-chat-for-whatsapp' ); ?></p>
|
804 |
</div>
|
805 |
<div class="input-field col s6">
|
806 |
<input id="s8_icon_color" class="ht-ctc-color" data-default-color="#ffffff" name="ht_ctc_s8[s8_icon_color]" value="<?php echo $s8_icon_color ?>" type="text" style="height: 1.375rem;" >
|
812 |
<!-- icon color on hover -->
|
813 |
<div class="row">
|
814 |
<div class="col s6">
|
815 |
+
<p><?php _e( 'Icon Color on Hover', 'click-to-chat-for-whatsapp' ); ?></p>
|
816 |
</div>
|
817 |
<div class="input-field col s6">
|
818 |
<input id="s8_icon_color_on_hover" class="ht-ctc-color" data-default-color="#ffffff" name="ht_ctc_s8[s8_icon_color_on_hover]" value="<?php echo $s8_icon_color_on_hover ?>" type="text" style="height: 1.375rem;" >
|
826 |
<!-- icon position - left/right -->
|
827 |
<div class="row">
|
828 |
<div class="col s6">
|
829 |
+
<p><?php _e( 'Icon Position', 'click-to-chat-for-whatsapp' ); ?></p>
|
830 |
</div>
|
831 |
<div class="input-field col s6">
|
832 |
<select name="ht_ctc_s8[s8_icon_position]" class="select-2">
|
842 |
<!-- Text Size -->
|
843 |
<div class="row">
|
844 |
<div class="col s6">
|
845 |
+
<p><?php _e( 'Text Size', 'click-to-chat-for-whatsapp' ); ?></p>
|
846 |
</div>
|
847 |
<div class="input-field col s6">
|
848 |
<input name="ht_ctc_s8[s8_text_size]" value="<?php echo $s8_text_size ?>" id="s8_text_size" type="text" class="" >
|
849 |
+
<label for="s8_text_size"><?php _e( 'Text Size - E.g. 12px', 'click-to-chat-for-whatsapp' ); ?></label>
|
850 |
+
<span class="helper-text"><?php _e( 'Leave blank for default settings', 'click-to-chat-for-whatsapp' ); ?></span>
|
851 |
</div>
|
852 |
</div>
|
853 |
|
858 |
</div>
|
859 |
<div class="input-field col s6">
|
860 |
<input name="ht_ctc_s8[s8_icon_size]" value="<?php echo $s8_icon_size ?>" id="s8_icon_size" type="text" class="" >
|
861 |
+
<label for="s8_icon_size"><?php _e( 'Icon Size - E.g. 16px', 'click-to-chat-for-whatsapp' ); ?></label>
|
862 |
+
<span class="helper-text"><?php _e( 'Leave blank for default settings', 'click-to-chat-for-whatsapp' ); ?></span>
|
863 |
</div>
|
864 |
</div>
|
865 |
|
866 |
<!-- button size - btn, btn-large -->
|
867 |
<div class="row">
|
868 |
<div class="col s6">
|
869 |
+
<p><?php _e( 'Button Size', 'click-to-chat-for-whatsapp' ); ?></p>
|
870 |
</div>
|
871 |
<div class="input-field col s6">
|
872 |
<select name="ht_ctc_s8[s8_btn_size]" class="select-2">
|
873 |
+
<option value="btn" <?php echo $s8_btn_size == 'btn' ? 'SELECTED' : ''; ?> ><?php _e( 'Normal', 'click-to-chat-for-whatsapp' ); ?></option>
|
874 |
+
<option value="btn-large" <?php echo $s8_btn_size == 'btn-large' ? 'SELECTED' : ''; ?> ><?php _e( 'Large', 'click-to-chat-for-whatsapp' ); ?></option>
|
875 |
</select>
|
876 |
</div>
|
877 |
</div>
|
891 |
function ht_ctc_s99_cb() {
|
892 |
|
893 |
$options = get_option('ht_ctc_s99');
|
894 |
+
$s99_dekstop_img_url = ( isset( $options['s99_dekstop_img_url']) ) ? esc_attr( $options['s99_dekstop_img_url'] ) : '';
|
895 |
+
$s99_mobile_img_url = ( isset( $options['s99_mobile_img_url']) ) ? esc_attr( $options['s99_mobile_img_url'] ) : '';
|
896 |
+
$s99_desktop_img_height = ( isset( $options['s99_desktop_img_height']) ) ? esc_attr( $options['s99_desktop_img_height'] ) : '';
|
897 |
+
$s99_desktop_img_width = ( isset( $options['s99_desktop_img_width']) ) ? esc_attr( $options['s99_desktop_img_width'] ) : '';
|
898 |
+
$s99_mobile_img_height = ( isset( $options['s99_mobile_img_height']) ) ? esc_attr( $options['s99_mobile_img_height'] ) : '';
|
899 |
+
$s99_mobile_img_width = ( isset( $options['s99_mobile_img_width']) ) ? esc_attr( $options['s99_mobile_img_width'] ) : '';
|
900 |
?>
|
901 |
<ul class="collapsible" data-collapsible="accordion">
|
902 |
<li>
|
903 |
+
<div class="collapsible-header"><?php _e( 'Style 99 - Own Image / GIF', 'click-to-chat-for-whatsapp' ); ?></div>
|
904 |
<div class="collapsible-body">
|
905 |
|
906 |
<!-- Image URL - Desktop -->
|
910 |
</div> -->
|
911 |
<div class="input-field col s12">
|
912 |
<input name="ht_ctc_s99[s99_dekstop_img_url]" value="<?php echo $s99_dekstop_img_url ?>" id="s99_dekstop_img_url" type="text" class="" >
|
913 |
+
<label for="s99_dekstop_img_url"><?php _e( 'Image URL - Desktop', 'click-to-chat-for-whatsapp' ); ?></label>
|
914 |
</div>
|
915 |
</div>
|
916 |
|
921 |
</div> -->
|
922 |
<div class="input-field col s12">
|
923 |
<input name="ht_ctc_s99[s99_mobile_img_url]" value="<?php echo $s99_mobile_img_url ?>" id="s99_mobile_img_url" type="text" class="" >
|
924 |
+
<label for="s99_mobile_img_url"><?php _e( 'Image URL - Mobile', 'click-to-chat-for-whatsapp' ); ?></label>
|
925 |
</div>
|
926 |
</div>
|
927 |
|
928 |
<!-- Desktop - Image Height -->
|
929 |
<div class="row">
|
930 |
<div class="col s6">
|
931 |
+
<p><?php _e( 'Desktop - Image Height', 'click-to-chat-for-whatsapp' ); ?></p>
|
932 |
</div>
|
933 |
<div class="input-field col s6">
|
934 |
<input name="ht_ctc_s99[s99_desktop_img_height]" value="<?php echo $s99_desktop_img_height ?>" id="s99_desktop_img_height" type="text" class="" >
|
935 |
+
<label for="s99_desktop_img_height"><?php _e( 'Desktop - Image Height', 'click-to-chat-for-whatsapp' ); ?></label>
|
936 |
</div>
|
937 |
</div>
|
938 |
|
939 |
<!-- Desktop - Image Width -->
|
940 |
<div class="row">
|
941 |
<div class="col s6">
|
942 |
+
<p><?php _e( 'Desktop - Image Width', 'click-to-chat-for-whatsapp' ); ?></p>
|
943 |
</div>
|
944 |
<div class="input-field col s6">
|
945 |
<input name="ht_ctc_s99[s99_desktop_img_width]" value="<?php echo $s99_desktop_img_width ?>" id="s99_desktop_img_width" type="text" class="" >
|
946 |
+
<label for="s99_desktop_img_width"><?php _e( 'Desktop - Image Width', 'click-to-chat-for-whatsapp' ); ?></label>
|
947 |
</div>
|
948 |
</div>
|
949 |
|
950 |
<!-- Mobile - Image Height -->
|
951 |
<div class="row">
|
952 |
<div class="col s6">
|
953 |
+
<p><?php _e( 'Mobile - Image Height', 'click-to-chat-for-whatsapp' ); ?></p>
|
954 |
</div>
|
955 |
<div class="input-field col s6">
|
956 |
<input name="ht_ctc_s99[s99_mobile_img_height]" value="<?php echo $s99_mobile_img_height ?>" id="s99_mobile_img_height" type="text" class="" >
|
957 |
+
<label for="s99_mobile_img_height"><?php _e( 'Mobile - Image Height', 'click-to-chat-for-whatsapp' ); ?></label>
|
958 |
</div>
|
959 |
</div>
|
960 |
|
961 |
<!-- Mobile - Image Width -->
|
962 |
<div class="row">
|
963 |
<div class="col s6">
|
964 |
+
<p><?php _e( 'Mobile - Image Width', 'click-to-chat-for-whatsapp' ); ?></p>
|
965 |
</div>
|
966 |
<div class="input-field col s6">
|
967 |
<input name="ht_ctc_s99[s99_mobile_img_width]" value="<?php echo $s99_mobile_img_width ?>" id="s99_mobile_img_width" type="text" class="" >
|
968 |
+
<label for="s99_mobile_img_width"><?php _e( 'Mobile - Image Width', 'click-to-chat-for-whatsapp' ); ?></label>
|
969 |
</div>
|
970 |
</div>
|
971 |
|
986 |
function ht_ctc_othersettings_cb() {
|
987 |
|
988 |
$options = get_option('ht_ctc_othersettings');
|
989 |
+
$dbrow = 'ht_ctc_othersettings';
|
990 |
?>
|
991 |
|
992 |
+
<ul class="collapsible" data-collapsible="accordion" id="ht_ctc_othersettings">
|
993 |
+
<li class="active">
|
994 |
+
<div class="collapsible-header"><?php _e( 'Other settings', 'click-to-chat-for-whatsapp' ); ?></div>
|
995 |
<div class="collapsible-body">
|
996 |
+
|
997 |
+
<!-- not make empty table -->
|
998 |
+
<input name="ht_ctc_othersettings[hello]" value="hello" id="" type="hidden" class="hide" >
|
999 |
+
|
1000 |
+
<?php
|
1001 |
+
// cache issue while selecting styles
|
1002 |
+
if ( isset( $options['select_styles_issue'] ) ) {
|
1003 |
+
?>
|
1004 |
+
<p id="styles_issue">
|
1005 |
+
<label>
|
1006 |
+
<input name="<?php echo $dbrow ?>[select_styles_issue]" type="checkbox" value="1" <?php checked( $options['select_styles_issue'], 1 ); ?> id="select_styles_issue" />
|
1007 |
+
<!-- <span>Style for device is not as expected(due to cache)</span> -->
|
1008 |
+
<span><?php _e( 'Check this only, If styles for mobile, desktop not selected as expected(due to cache)', 'click-to-chat-for-whatsapp' ); ?></span>
|
1009 |
+
</label>
|
1010 |
+
</p>
|
1011 |
+
<?php
|
1012 |
+
} else {
|
1013 |
+
?>
|
1014 |
+
<p id="styles_issue">
|
1015 |
+
<label>
|
1016 |
+
<input name="<?php echo $dbrow ?>[select_styles_issue]" type="checkbox" value="1" id="select_styles_issue" />
|
1017 |
+
<span><?php _e( 'Check this only, If styles for mobile, desktop not selected as expected(due to cache)', 'click-to-chat-for-whatsapp' ); ?></span>
|
1018 |
+
</label>
|
1019 |
+
</p>
|
1020 |
+
<?php
|
1021 |
+
}
|
1022 |
+
?>
|
1023 |
+
<p class="description"> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/select-styles/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
|
1024 |
+
<br>
|
1025 |
<?php
|
1026 |
|
1027 |
+
// enable group
|
1028 |
+
if ( isset( $options['enable_group'] ) ) {
|
1029 |
+
?>
|
1030 |
+
<p>
|
1031 |
+
<label>
|
1032 |
+
<input name="ht_ctc_othersettings[enable_group]" type="checkbox" value="1" <?php checked( $options['enable_group'], 1 ); ?> id="enable_group" />
|
1033 |
+
<span><?php _e( 'Enable Group Features', 'click-to-chat-for-whatsapp' ); ?></span>
|
1034 |
+
</label>
|
1035 |
+
<p class="description"> - <a href="<?php echo admin_url( 'admin.php?page=click-to-chat-group-feature' ); ?>"><?php _e( 'Group Settings page', 'click-to-chat-for-whatsapp' ); ?></a> </p>
|
1036 |
+
</p>
|
1037 |
+
<?php
|
1038 |
+
} else {
|
1039 |
+
?>
|
1040 |
+
<p>
|
1041 |
+
<label>
|
1042 |
+
<input name="ht_ctc_othersettings[enable_group]" type="checkbox" value="1" id="enable_group" />
|
1043 |
+
<span><?php _e( 'Enable Group Features', 'click-to-chat-for-whatsapp' ); ?></span>
|
1044 |
+
</label>
|
1045 |
+
</p>
|
1046 |
+
<p class="description"> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/enable-group"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
|
1047 |
+
<?php
|
1048 |
+
}
|
1049 |
+
?>
|
1050 |
+
<br>
|
1051 |
+
<?php
|
1052 |
+
|
1053 |
+
|
1054 |
+
// enable share
|
1055 |
+
if ( isset( $options['enable_share'] ) ) {
|
1056 |
+
?>
|
1057 |
+
<p>
|
1058 |
+
<label>
|
1059 |
+
<input name="ht_ctc_othersettings[enable_share]" type="checkbox" value="1" <?php checked( $options['enable_share'], 1 ); ?> id="enable_share" />
|
1060 |
+
<span><?php _e( 'Enable Share Features', 'click-to-chat-for-whatsapp' ); ?></span>
|
1061 |
+
</label>
|
1062 |
+
<p class="description"> - <a href="<?php echo admin_url( 'admin.php?page=click-to-chat-share-feature' ); ?>"><?php _e( 'Share Settings page', 'click-to-chat-for-whatsapp' ); ?></a> </p>
|
1063 |
+
</p>
|
1064 |
+
<?php
|
1065 |
+
} else {
|
1066 |
+
?>
|
1067 |
+
<p>
|
1068 |
+
<label>
|
1069 |
+
<input name="ht_ctc_othersettings[enable_share]" type="checkbox" value="1" id="enable_share" />
|
1070 |
+
<span><?php _e( 'Enable Share Features', 'click-to-chat-for-whatsapp' ); ?></span>
|
1071 |
+
</label>
|
1072 |
+
</p>
|
1073 |
+
<p class="description"> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/enable-share"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
|
1074 |
+
<?php
|
1075 |
+
}
|
1076 |
+
?>
|
1077 |
+
<br>
|
1078 |
+
|
1079 |
+
<!-- chat -->
|
1080 |
+
<p class="description"><?php _e( "Chat settings are enabled by default and can't disbale. If like to hide chat on all pages select", 'click-to-chat-for-whatsapp' ); ?> <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat#showhide_settings' ); ?>"><?php _e( 'show on selected pages', 'click-to-chat-for-whatsapp' ); ?></a> </p>
|
1081 |
+
<p class="description"> - <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat' ); ?>"><?php _e( 'Chat Settings page', 'click-to-chat-for-whatsapp' ); ?></a> <br> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/enable-chat"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
|
1082 |
+
</p>
|
1083 |
+
<br>
|
1084 |
+
|
1085 |
+
<?php
|
1086 |
// Facebook Analytics
|
1087 |
if ( isset( $options['fb_analytics'] ) ) {
|
1088 |
?>
|
1089 |
<p>
|
1090 |
<label>
|
1091 |
<input name="ht_ctc_othersettings[fb_analytics]" type="checkbox" value="1" <?php checked( $options['fb_analytics'], 1 ); ?> id="fb_analytics" />
|
1092 |
+
<span><?php _e( 'Facebook Analytics', 'click-to-chat-for-whatsapp' ); ?></span>
|
1093 |
</label>
|
1094 |
</p>
|
1095 |
<?php
|
1098 |
<p>
|
1099 |
<label>
|
1100 |
<input name="ht_ctc_othersettings[fb_analytics]" type="checkbox" value="1" id="fb_analytics" />
|
1101 |
+
<span><?php _e( 'Facebook Analytics', 'click-to-chat-for-whatsapp' ); ?></span>
|
1102 |
</label>
|
1103 |
</p>
|
1104 |
<?php
|
1105 |
}
|
1106 |
?>
|
1107 |
+
<p class="description"> <?php _e( 'This feature is', 'click-to-chat-for-whatsapp' ); ?> <b><?php _e( 'depreacted', 'click-to-chat-for-whatsapp' ); ?></b> <?php _e( 'in the favor of Facebook Pixel', 'click-to-chat-for-whatsapp' ); ?></p>
|
1108 |
+
<p class="description"> <?php _e( 'If Facebook Analytics installed - creates an Event there', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/facebook-analytics/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
|
1109 |
<br><br><br>
|
1110 |
+
|
1111 |
+
<?php
|
1112 |
+
|
1113 |
+
// delete options
|
1114 |
+
if ( isset( $options['delete_options'] ) ) {
|
1115 |
+
?>
|
1116 |
+
<p>
|
1117 |
+
<label>
|
1118 |
+
<input name="ht_ctc_othersettings[delete_options]" type="checkbox" value="1" <?php checked( $options['delete_options'], 1 ); ?> id="delete_options" />
|
1119 |
+
<span><?php _e( 'Delete this plugin settings when uninstalls', 'click-to-chat-for-whatsapp' ); ?></span>
|
1120 |
+
</label>
|
1121 |
+
</p>
|
1122 |
+
<?php
|
1123 |
+
} else {
|
1124 |
+
?>
|
1125 |
+
<p>
|
1126 |
+
<label>
|
1127 |
+
<input name="ht_ctc_othersettings[delete_options]" type="checkbox" value="1" id="delete_options" />
|
1128 |
+
<span><?php _e( 'Delete this plugin settings when uninstalls', 'click-to-chat-for-whatsapp' ); ?></span>
|
1129 |
+
</label>
|
1130 |
+
</p>
|
1131 |
+
<?php
|
1132 |
+
}
|
1133 |
+
|
1134 |
+
?>
|
1135 |
|
1136 |
|
1137 |
|
1144 |
}
|
1145 |
|
1146 |
|
1147 |
+
|
1148 |
+
|
1149 |
+
|
1150 |
+
/**
|
1151 |
+
* Sanitize each setting field as needed
|
1152 |
+
*
|
1153 |
+
* @param array $input Contains all settings fields as array keys
|
1154 |
+
*/
|
1155 |
+
public function options_sanitize( $input ) {
|
1156 |
+
|
1157 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
1158 |
+
wp_die( 'not allowed to modify - please contact admin ' );
|
1159 |
+
}
|
1160 |
+
|
1161 |
+
$new_input = array();
|
1162 |
+
|
1163 |
+
$add_suffix = array(
|
1164 |
+
's2_img_size',
|
1165 |
+
's3_img_size',
|
1166 |
+
's3_padding',
|
1167 |
+
's4_img_size',
|
1168 |
+
's5_img_height',
|
1169 |
+
's5_img_width',
|
1170 |
+
's5_content_height',
|
1171 |
+
's5_content_width',
|
1172 |
+
's7_icon_size',
|
1173 |
+
's7_border_size',
|
1174 |
+
's7_border_radius',
|
1175 |
+
's8_text_size',
|
1176 |
+
's8_icon_size',
|
1177 |
+
's99_desktop_img_height',
|
1178 |
+
's99_desktop_img_width',
|
1179 |
+
's99_mobile_img_height',
|
1180 |
+
's99_mobile_img_width',
|
1181 |
+
);
|
1182 |
+
|
1183 |
+
foreach ($input as $key => $value) {
|
1184 |
+
if( isset( $input[$key] ) ) {
|
1185 |
+
|
1186 |
+
if ( in_array( $key, $add_suffix ) ) {
|
1187 |
+
if ( is_numeric($input[$key]) ) {
|
1188 |
+
$input[$key] = $input[$key] . 'px';
|
1189 |
+
}
|
1190 |
+
if ( 's5_img_height' == $key || 's5_img_width' == $key || 's5_content_height' == $key ) {
|
1191 |
+
$input[$key] = ('' == $input[$key]) ? '70px' : $input[$key];
|
1192 |
+
}
|
1193 |
+
if ( 's5_content_width' == $key ) {
|
1194 |
+
$input[$key] = ('' == $input[$key]) ? '270px' : $input[$key];
|
1195 |
+
}
|
1196 |
+
if ( 's7_icon_size' == $key ) {
|
1197 |
+
$input[$key] = ('' == $input[$key]) ? '28px' : $input[$key];
|
1198 |
+
}
|
1199 |
+
if ( 's7_border_size' == $key ) {
|
1200 |
+
$input[$key] = ('' == $input[$key]) ? '12px' : $input[$key];
|
1201 |
+
}
|
1202 |
+
if ( 's7_border_radius' == $key ) {
|
1203 |
+
$input[$key] = ('' == $input[$key]) ? '4px' : $input[$key];
|
1204 |
+
}
|
1205 |
+
$new_input[$key] = sanitize_text_field( $input[$key] );
|
1206 |
+
} else {
|
1207 |
+
$new_input[$key] = sanitize_text_field( $input[$key] );
|
1208 |
+
}
|
1209 |
+
|
1210 |
+
}
|
1211 |
+
}
|
1212 |
+
|
1213 |
+
|
1214 |
+
return $new_input;
|
1215 |
+
}
|
1216 |
+
|
1217 |
+
|
1218 |
+
|
1219 |
}
|
1220 |
|
1221 |
$ht_ctc_admin_customize_styles = new HT_CTC_Admin_Customize_Styles();
|
new/admin/class-ht-ctc-admin-group-page.php
CHANGED
@@ -66,13 +66,13 @@ class HT_CTC_Admin_Group_Page {
|
|
66 |
|
67 |
add_settings_section( 'ht_ctc_main_page_settings_sections_add', '', array( $this, 'main_settings_section_cb' ), 'ht_ctc_group_page_settings_sections_do' );
|
68 |
|
69 |
-
add_settings_field( 'group_id', 'WhatsApp Group ID', array( $this, 'group_id_cb' ), 'ht_ctc_group_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
|
70 |
-
add_settings_field( 'group_cta', 'Call to Action', array( $this, 'group_cta_cb' ), 'ht_ctc_group_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
|
71 |
|
72 |
-
add_settings_field( '
|
73 |
-
add_settings_field( '
|
74 |
-
|
75 |
-
add_settings_field( 'group_show_hide', 'Show/Hide', array( $this, 'group_show_hide_cb' ), 'ht_ctc_group_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
|
76 |
add_settings_field( 'group_shortcode_cb', '', array( $this, 'group_shortcode_cb' ), 'ht_ctc_group_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
|
77 |
|
78 |
|
@@ -88,13 +88,13 @@ class HT_CTC_Admin_Group_Page {
|
|
88 |
// WhatsApp Group ID.
|
89 |
function group_id_cb() {
|
90 |
$options = get_option('ht_ctc_group');
|
91 |
-
$value = (
|
92 |
?>
|
93 |
<div class="row">
|
94 |
<div class="input-field col s12">
|
95 |
<input name="ht_ctc_group[group_id]" value="<?php echo $value ?>" id="whatsapp_group_id" type="text" class="input-margin">
|
96 |
-
<label for="whatsapp_group_id"
|
97 |
-
<p class="description"
|
98 |
</div>
|
99 |
</div>
|
100 |
<?php
|
@@ -103,140 +103,52 @@ class HT_CTC_Admin_Group_Page {
|
|
103 |
// call to action
|
104 |
function group_cta_cb() {
|
105 |
$options = get_option('ht_ctc_group');
|
106 |
-
$value = (
|
107 |
?>
|
108 |
<div class="row">
|
109 |
<div class="input-field col s12">
|
110 |
<input name="ht_ctc_group[call_to_action]" value="<?php echo $value ?>" id="call_to_action" type="text" class="input-margin">
|
111 |
-
<label for="call_to_action"
|
112 |
-
<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/"
|
113 |
</div>
|
114 |
</div>
|
115 |
<?php
|
116 |
}
|
117 |
|
118 |
|
119 |
-
|
120 |
-
|
121 |
-
function group_ctc_desktop_style_cb() {
|
122 |
-
$options = get_option('ht_ctc_group');
|
123 |
-
$style_value = ( '' == $options ) ? '' : esc_attr( $options['style_desktop'] );
|
124 |
-
?>
|
125 |
-
<div class="row">
|
126 |
-
<div class="input-field col s12" style="margin-bottom: 0px;">
|
127 |
-
<select name="ht_ctc_group[style_desktop]" class="select-2">
|
128 |
-
<option value="1" <?php echo $style_value == 1 ? 'SELECTED' : ''; ?> >Style-1</option>
|
129 |
-
<option value="2" <?php echo $style_value == 2 ? 'SELECTED' : ''; ?> >Style-2</option>
|
130 |
-
<option value="3" <?php echo $style_value == 3 ? 'SELECTED' : ''; ?> >Style-3</option>
|
131 |
-
<option value="4" <?php echo $style_value == 4 ? 'SELECTED' : ''; ?> >Style-4</option>
|
132 |
-
<option value="5" <?php echo $style_value == 5 ? 'SELECTED' : ''; ?> >Style-5</option>
|
133 |
-
<option value="6" <?php echo $style_value == 6 ? 'SELECTED' : ''; ?> >Style-6</option>
|
134 |
-
<option value="7" <?php echo $style_value == 7 ? 'SELECTED' : ''; ?> >Style-7</option>
|
135 |
-
<option value="8" <?php echo $style_value == 8 ? 'SELECTED' : ''; ?> >Style-8</option>
|
136 |
-
<option value="99" <?php echo $style_value == 99 ? 'SELECTED' : ''; ?> >Style-99 (Add your own image / GIF)</option>
|
137 |
-
</select>
|
138 |
-
<label>Select Style for Desktop</label>
|
139 |
-
</div>
|
140 |
-
</div>
|
141 |
-
|
142 |
-
<p class="description"> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/list-of-styles/">List of syles</a> </p>
|
143 |
-
<p class="description">Can customize each style - <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>"><?php _e( 'Customize Styles' , 'click-to-chat-for-whatsapp' ) ?></a> </p>
|
144 |
-
|
145 |
-
<?php
|
146 |
-
}
|
147 |
-
|
148 |
-
|
149 |
-
// Mobile - select style
|
150 |
-
function group_ctc_mobile_style_cb() {
|
151 |
$options = get_option('ht_ctc_group');
|
152 |
-
$
|
153 |
-
|
154 |
-
<div class="row" style="margin-bottom: 0px;">
|
155 |
-
<div class="input-field col s12">
|
156 |
-
<select name="ht_ctc_group[style_mobile]" class="select-2">
|
157 |
-
<option value="1" <?php echo $style_value == 1 ? 'SELECTED' : ''; ?> >Style-1</option>
|
158 |
-
<option value="2" <?php echo $style_value == 2 ? 'SELECTED' : ''; ?> >Style-2</option>
|
159 |
-
<option value="3" <?php echo $style_value == 3 ? 'SELECTED' : ''; ?> >Style-3</option>
|
160 |
-
<option value="4" <?php echo $style_value == 4 ? 'SELECTED' : ''; ?> >Style-4</option>
|
161 |
-
<option value="5" <?php echo $style_value == 5 ? 'SELECTED' : ''; ?> >Style-5</option>
|
162 |
-
<option value="6" <?php echo $style_value == 6 ? 'SELECTED' : ''; ?> >Style-6</option>
|
163 |
-
<option value="7" <?php echo $style_value == 7 ? 'SELECTED' : ''; ?> >Style-7</option>
|
164 |
-
<option value="8" <?php echo $style_value == 8 ? 'SELECTED' : ''; ?> >Style-8</option>
|
165 |
-
<option value="99" <?php echo $style_value == 99 ? 'SELECTED' : ''; ?> >Style-99 (Add your own image / GIF)</option>
|
166 |
-
</select>
|
167 |
-
<label>Select Style for Mobile</label>
|
168 |
-
</div>
|
169 |
-
</div>
|
170 |
-
|
171 |
|
172 |
-
|
173 |
}
|
174 |
|
175 |
|
176 |
-
//
|
177 |
-
function
|
178 |
$options = get_option('ht_ctc_group');
|
179 |
-
|
180 |
-
$
|
181 |
-
|
182 |
-
|
183 |
-
$side_2_value = ( '' == $options ) ? '' : esc_attr( $options['side_2_value'] );
|
184 |
-
?>
|
185 |
-
<!-- side - 1 -->
|
186 |
-
<div class="row">
|
187 |
-
<div class="input-field col s6">
|
188 |
-
<select name="ht_ctc_group[side_1]" class="select-2">
|
189 |
-
<option value="bottom" <?php echo $side_1 == 'bottom' ? 'SELECTED' : ''; ?> >bottom</option>
|
190 |
-
<option value="top" <?php echo $side_1 == 'top' ? 'SELECTED' : ''; ?> >top</option>
|
191 |
-
</select>
|
192 |
-
<label>top / bottom </label>
|
193 |
-
</div>
|
194 |
-
|
195 |
-
<div class="input-field col s6">
|
196 |
-
<input name="ht_ctc_group[side_1_value]" value="<?php echo $side_1_value ?>" id="side_1_value" type="text" class="input-margin">
|
197 |
-
<label for="side_1_value">e.g. 10px</label>
|
198 |
-
</div>
|
199 |
-
</div>
|
200 |
-
|
201 |
-
<!-- side - 2 -->
|
202 |
-
<div class="row">
|
203 |
-
<div class="input-field col s6">
|
204 |
-
<select name="ht_ctc_group[side_2]" class="select-2">
|
205 |
-
<option value="right" <?php echo $side_2 == 'right' ? 'SELECTED' : ''; ?> >right</option>
|
206 |
-
<option value="left" <?php echo $side_2 == 'left' ? 'SELECTED' : ''; ?> >left</option>
|
207 |
-
</select>
|
208 |
-
<label>right / left </label>
|
209 |
-
</div>
|
210 |
-
|
211 |
-
<div class="input-field col s6">
|
212 |
-
<input name="ht_ctc_group[side_2_value]" value="<?php echo $side_2_value ?>" id="side_2_value" type="text" class="input-margin">
|
213 |
-
<label for="side_2_value">e.g. 10px</label>
|
214 |
-
</div>
|
215 |
-
</div>
|
216 |
-
|
217 |
-
<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>
|
218 |
-
<?php
|
219 |
}
|
220 |
|
221 |
|
222 |
-
|
223 |
-
|
224 |
// show/hide
|
225 |
function group_show_hide_cb() {
|
226 |
-
|
227 |
-
$dbrow = 'ht_ctc_group';
|
228 |
$options = get_option('ht_ctc_group');
|
|
|
|
|
229 |
|
230 |
include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-show-hide.php';
|
231 |
-
|
232 |
}
|
233 |
|
234 |
|
235 |
-
|
236 |
-
|
237 |
function group_shortcode_cb() {
|
238 |
?>
|
239 |
-
<p class="description"
|
240 |
<?php
|
241 |
}
|
242 |
|
@@ -258,15 +170,7 @@ class HT_CTC_Admin_Group_Page {
|
|
258 |
|
259 |
foreach ($input as $key => $value) {
|
260 |
|
261 |
-
if ( 'side_1_value' == $key ) {
|
262 |
-
if ( is_numeric($input[$key]) ) {
|
263 |
-
$input[$key] = $input[$key] . 'px';
|
264 |
-
}
|
265 |
-
if ( '' == $input[$key] ) {
|
266 |
-
$input[$key] = '0px';
|
267 |
-
}
|
268 |
-
$new_input[$key] = sanitize_text_field( $input[$key] );
|
269 |
-
} elseif ( 'side_2_value' == $key ) {
|
270 |
if ( is_numeric($input[$key]) ) {
|
271 |
$input[$key] = $input[$key] . 'px';
|
272 |
}
|
@@ -274,7 +178,7 @@ class HT_CTC_Admin_Group_Page {
|
|
274 |
$input[$key] = '0px';
|
275 |
}
|
276 |
$new_input[$key] = sanitize_text_field( $input[$key] );
|
277 |
-
}
|
278 |
$new_input[$key] = sanitize_text_field( $input[$key] );
|
279 |
}
|
280 |
|
@@ -285,6 +189,13 @@ class HT_CTC_Admin_Group_Page {
|
|
285 |
// }
|
286 |
}
|
287 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
288 |
|
289 |
return $new_input;
|
290 |
}
|
66 |
|
67 |
add_settings_section( 'ht_ctc_main_page_settings_sections_add', '', array( $this, 'main_settings_section_cb' ), 'ht_ctc_group_page_settings_sections_do' );
|
68 |
|
69 |
+
add_settings_field( 'group_id', __( 'WhatsApp Group ID', 'click-to-chat-for-whatsapp'), array( $this, 'group_id_cb' ), 'ht_ctc_group_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
|
70 |
+
add_settings_field( 'group_cta', __( 'Call to Action', 'click-to-chat-for-whatsapp'), array( $this, 'group_cta_cb' ), 'ht_ctc_group_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
|
71 |
|
72 |
+
add_settings_field( 'group_ctc_desktop', __( 'Desktop', 'click-to-chat-for-whatsapp'), array( $this, 'group_ctc_desktop_cb' ), 'ht_ctc_group_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
|
73 |
+
add_settings_field( 'group_ctc_mobile', __( 'Mobile', 'click-to-chat-for-whatsapp'), array( $this, 'group_ctc_mobile_cb' ), 'ht_ctc_group_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
|
74 |
+
|
75 |
+
add_settings_field( 'group_show_hide', __( 'Show/Hide', 'click-to-chat-for-whatsapp'), array( $this, 'group_show_hide_cb' ), 'ht_ctc_group_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
|
76 |
add_settings_field( 'group_shortcode_cb', '', array( $this, 'group_shortcode_cb' ), 'ht_ctc_group_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
|
77 |
|
78 |
|
88 |
// WhatsApp Group ID.
|
89 |
function group_id_cb() {
|
90 |
$options = get_option('ht_ctc_group');
|
91 |
+
$value = ( isset( $options['group_id']) ) ? esc_attr( $options['group_id'] ) : '';
|
92 |
?>
|
93 |
<div class="row">
|
94 |
<div class="input-field col s12">
|
95 |
<input name="ht_ctc_group[group_id]" value="<?php echo $value ?>" id="whatsapp_group_id" type="text" class="input-margin">
|
96 |
+
<label for="whatsapp_group_id"><?php _e( 'WhatsApp Group ID', 'click-to-chat-for-whatsapp' ); ?>.</label>
|
97 |
+
<p class="description"><?php _e( 'Enter WhatsApp Group ID. E.g. 9EHLsEsOeJk6AVtE8AvXiA', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/find-whatsapp-group-id/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
|
98 |
</div>
|
99 |
</div>
|
100 |
<?php
|
103 |
// call to action
|
104 |
function group_cta_cb() {
|
105 |
$options = get_option('ht_ctc_group');
|
106 |
+
$value = ( isset( $options['call_to_action']) ) ? esc_attr( $options['call_to_action'] ) : '';
|
107 |
?>
|
108 |
<div class="row">
|
109 |
<div class="input-field col s12">
|
110 |
<input name="ht_ctc_group[call_to_action]" value="<?php echo $value ?>" id="call_to_action" type="text" class="input-margin">
|
111 |
+
<label for="call_to_action"><?php _e( 'Call to Action', 'click-to-chat-for-whatsapp' ); ?></label>
|
112 |
+
<p class="description"> <?php _e( 'Text that appears along with WhatsApp icon/button', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/call-to-action/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
|
113 |
</div>
|
114 |
</div>
|
115 |
<?php
|
116 |
}
|
117 |
|
118 |
|
119 |
+
// Desktop
|
120 |
+
function group_ctc_desktop_cb() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
$options = get_option('ht_ctc_group');
|
122 |
+
$dbrow = 'ht_ctc_group';
|
123 |
+
$type = 'group';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
|
125 |
+
include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-desktop.php';
|
126 |
}
|
127 |
|
128 |
|
129 |
+
// Mobile
|
130 |
+
function group_ctc_mobile_cb() {
|
131 |
$options = get_option('ht_ctc_group');
|
132 |
+
$dbrow = 'ht_ctc_group';
|
133 |
+
$type = 'group';
|
134 |
+
|
135 |
+
include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-mobile.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
}
|
137 |
|
138 |
|
|
|
|
|
139 |
// show/hide
|
140 |
function group_show_hide_cb() {
|
|
|
|
|
141 |
$options = get_option('ht_ctc_group');
|
142 |
+
$dbrow = 'ht_ctc_group';
|
143 |
+
$type = 'group';
|
144 |
|
145 |
include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-show-hide.php';
|
|
|
146 |
}
|
147 |
|
148 |
|
|
|
|
|
149 |
function group_shortcode_cb() {
|
150 |
?>
|
151 |
+
<p class="description"><?php _e( 'Shortcodes for Group Chat', 'click-to-chat-for-whatsapp' ); ?>: [ht-ctc-group] - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/shortcodes-group">more info</a></p>
|
152 |
<?php
|
153 |
}
|
154 |
|
170 |
|
171 |
foreach ($input as $key => $value) {
|
172 |
|
173 |
+
if ( 'side_1_value' == $key || 'side_2_value' == $key || 'mobile_side_1_value' == $key || 'mobile_side_2_value' == $key ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
if ( is_numeric($input[$key]) ) {
|
175 |
$input[$key] = $input[$key] . 'px';
|
176 |
}
|
178 |
$input[$key] = '0px';
|
179 |
}
|
180 |
$new_input[$key] = sanitize_text_field( $input[$key] );
|
181 |
+
} else {
|
182 |
$new_input[$key] = sanitize_text_field( $input[$key] );
|
183 |
}
|
184 |
|
189 |
// }
|
190 |
}
|
191 |
|
192 |
+
// l10n
|
193 |
+
foreach ($input as $key => $value) {
|
194 |
+
if ( 'group_id' == $key || 'call_to_action' == $key ) {
|
195 |
+
do_action( 'wpml_register_single_string', 'Click to Chat for WhatsApp', $key.'__group', $input[$key] );
|
196 |
+
}
|
197 |
+
}
|
198 |
+
|
199 |
|
200 |
return $new_input;
|
201 |
}
|
new/admin/class-ht-ctc-admin-main-page.php
CHANGED
@@ -56,88 +56,7 @@ class HT_CTC_Admin_Main_Page {
|
|
56 |
|
57 |
<!-- sidebar content -->
|
58 |
<div class="col s12 m12 l7 xl4 ht-cc-admin-sidebar sticky-sidebar">
|
59 |
-
|
60 |
-
<!-- <p>
|
61 |
-
Please let us know if you have any suggestions or feedback!! <br>
|
62 |
-
<a href="http://api.whatsapp.com/send?phone=919494429789&text=<?php echo get_bloginfo('url'); ?>%0AHi%20HoliThemes,%0AI%20have%20a%20Suggestion/Feedback:" target="_blank">WhatsApp</a> <br>
|
63 |
-
mail: wp@holithemes.com
|
64 |
-
</p> -->
|
65 |
-
|
66 |
-
<div class="col s12 m8 l12 xl12">
|
67 |
-
<div class="row">
|
68 |
-
|
69 |
-
<ul class="collapsible popout">
|
70 |
-
|
71 |
-
<!-- <li>
|
72 |
-
<div class="collapsible-header">Show/Hide on Selected pages, devices</div>
|
73 |
-
<div class="collapsible-body">
|
74 |
-
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/show-only-on-selected-pages/">Show only on selected pages</a></p>
|
75 |
-
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/hide-only-on-selected-pages/">Hide only on selected pages</a> </p>
|
76 |
-
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/show-hide-on-mobile-desktop/">Show/Hide on Mobile/Desktop</a></p>
|
77 |
-
</div>
|
78 |
-
</li> -->
|
79 |
-
|
80 |
-
<!-- <li>
|
81 |
-
<div class="collapsible-header">I Make Changes and Nothing Happens</div>
|
82 |
-
<div class="collapsible-body">
|
83 |
-
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/clear-cache/">Clear Cache:</a> <br>
|
84 |
-
  - Cache plugins <br>
|
85 |
-
  - Server cache <br>
|
86 |
-
  - Browser Cache
|
87 |
-
</p>
|
88 |
-
</div>
|
89 |
-
</li> -->
|
90 |
-
|
91 |
-
<!-- <li>
|
92 |
-
<div class="collapsible-header">Positon to place</div>
|
93 |
-
<div class="collapsible-body">
|
94 |
-
<p class="description">Center to the Screen</p>
|
95 |
-
<p class="description">Different postion for mobile, desktop (pro)</p>
|
96 |
-
</div>
|
97 |
-
</li> -->
|
98 |
-
|
99 |
-
<li class="active">
|
100 |
-
<div class="collapsible-header">Contact Us</div>
|
101 |
-
<div class="collapsible-body">
|
102 |
-
<p class="description">Please let us know if you have any suggestions or feedback!! <br><br> <a href="http://api.whatsapp.com/send?phone=919494429789&text=<?php echo get_bloginfo('url'); ?>%0AHi%20HoliThemes,%0AI%20have%20a%20Suggestion/Feedback:" target="_blank">WhatsApp</a></p>
|
103 |
-
<p class="description">mail: wp@holithemes.com</p>
|
104 |
-
</div>
|
105 |
-
</li>
|
106 |
-
|
107 |
-
<!-- <li>
|
108 |
-
<div class="collapsible-header">HoliThemes On</div>
|
109 |
-
<div class="collapsible-body">
|
110 |
-
<p class="description"><a href="https://www.facebook.com/holithemes/" target="_blank">Facebook</a></p>
|
111 |
-
<p class="description"><a href="https://www.youtube.com/channel/UC2Tf_WB9PWffO2B3tswWCGw" target="_blank">YouTube</a></p>
|
112 |
-
<p class="description"><a href="https://twitter.com/holithemes" target="_blank">Twitter</a></p>
|
113 |
-
<p class="description"><a href="https://www.instagram.com/holithemes/" target="_blank">Instagram</a></p>
|
114 |
-
<p class="description"><a href="https://www.linkedin.com/company/holithemes" target="_blank">LinkedIn</a></p>
|
115 |
-
</div>
|
116 |
-
</li> -->
|
117 |
-
|
118 |
-
<!-- <div class="collapsible-header">Support Us</div>
|
119 |
-
<div class="collapsible-body">
|
120 |
-
<p class="description">If you like the plugin support us by giving 5 star rating</p>
|
121 |
-
</div>
|
122 |
-
</li> -->
|
123 |
-
|
124 |
-
</ul>
|
125 |
-
|
126 |
-
</div>
|
127 |
-
</div>
|
128 |
-
|
129 |
-
<!-- <div class="col s12 m8">
|
130 |
-
<div class="collection with-header">
|
131 |
-
<div class="collection-header"><bold>HoliThemes On</bold></div>
|
132 |
-
<a target="_blank" href="https://www.facebook.com/holithemes/" class="collection-item">Facebook</a>
|
133 |
-
<a target="_blank" href="https://twitter.com/holithemes" class="collection-item">Twitter</a>
|
134 |
-
<a target="_blank" href="https://www.instagram.com/holithemes/" class="collection-item">Instagram</a>
|
135 |
-
<a target="_blank" href="https://www.youtube.com/channel/UC2Tf_WB9PWffO2B3tswWCGw" class="collection-item">YouTube</a>
|
136 |
-
<a target="_blank" href="https://www.linkedin.com/company/holithemes" class="collection-item">LinkedIn</a>
|
137 |
-
</div>
|
138 |
-
</div> -->
|
139 |
-
|
140 |
-
</div>
|
141 |
</div>
|
142 |
|
143 |
</div>
|
@@ -164,34 +83,31 @@ class HT_CTC_Admin_Main_Page {
|
|
164 |
|
165 |
|
166 |
// chat feautes
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
|
172 |
-
|
173 |
-
|
174 |
-
add_settings_field( 'number', 'WhatsApp Number', array( $this, 'number_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
|
175 |
-
add_settings_field( 'prefilled', 'Pre-Filled Message', array( $this, 'prefilled_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
|
176 |
-
add_settings_field( 'cta', 'Call to Action', array( $this, 'cta_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
|
177 |
-
add_settings_field( 'ctc_desktop_style', 'Style for Desktop', array( $this, 'ctc_desktop_style_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
|
178 |
-
add_settings_field( 'ctc_mobile_style', 'Style for Mobile', array( $this, 'ctc_mobile_style_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
|
179 |
-
add_settings_field( 'ctc_position', 'Position to place', array( $this, 'ctc_position_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
|
180 |
-
add_settings_field( 'ctc_webandapi', 'Web WhatsApp', array( $this, 'ctc_webandapi_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
|
181 |
-
add_settings_field( 'ctc_show_hide', 'Display', array( $this, 'ctc_show_hide_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
|
182 |
-
add_settings_field( 'chat_shortcode', '', array( $this, 'chat_shortcode_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
|
183 |
-
|
184 |
}
|
185 |
-
|
186 |
|
187 |
|
188 |
-
// main settings - options
|
189 |
-
// switch options
|
190 |
register_setting( 'ht_ctc_main_page_settings_fields', 'ht_ctc_main_options' , array( $this, 'options_sanitize' ) );
|
191 |
add_settings_section( 'ht_ctc_main_page_settings_sections_add', '', array( $this, 'main_settings_section_cb' ), 'ht_ctc_main_page_settings_sections_do' );
|
192 |
|
193 |
add_settings_field( 'ctc_enable_features', 'Enable Features', array( $this, 'ctc_enable_features_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
|
194 |
|
|
|
195 |
$ccw_options = get_option('ccw_options');
|
196 |
if ( isset( $ccw_options['number'] ) ) {
|
197 |
// display this setting page only if user switched from previous interface.. ( for new users no switch option )
|
@@ -202,12 +118,17 @@ class HT_CTC_Admin_Main_Page {
|
|
202 |
}
|
203 |
|
204 |
|
|
|
|
|
|
|
|
|
|
|
205 |
|
206 |
public function chat_settings_section_cb() {
|
207 |
?>
|
208 |
<h1>Click to Chat ( New Interface )</h1>
|
209 |
<br>
|
210 |
-
<h1>Chat Settings</h1>
|
211 |
<?php
|
212 |
}
|
213 |
|
@@ -215,15 +136,15 @@ class HT_CTC_Admin_Main_Page {
|
|
215 |
// WhatsApp number
|
216 |
function number_cb() {
|
217 |
$options = get_option('ht_ctc_chat_options');
|
218 |
-
$value = (
|
219 |
?>
|
220 |
<div class="row">
|
221 |
<div class="input-field col s12">
|
222 |
<input name="ht_ctc_chat_options[number]" value="<?php echo $value ?>" id="whatsapp_number" type="text" class="input-margin tooltipped" data-position="top" data-tooltip="Country Code and Number">
|
223 |
-
<label for="whatsapp_number"
|
224 |
<!-- <span class="helper-text">Country code + number</span> -->
|
225 |
-
<p class="description"
|
226 |
-
<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/"
|
227 |
</div>
|
228 |
</div>
|
229 |
<?php
|
@@ -232,7 +153,7 @@ class HT_CTC_Admin_Main_Page {
|
|
232 |
// pre-filled - message
|
233 |
function prefilled_cb() {
|
234 |
$options = get_option('ht_ctc_chat_options');
|
235 |
-
$value = (
|
236 |
$blogname = HT_CTC_BLOG_NAME;
|
237 |
$placeholder = "Hello $blogname!! \nName: \nLike to know more information about {{title}}, {{url}}";
|
238 |
?>
|
@@ -240,8 +161,8 @@ class HT_CTC_Admin_Main_Page {
|
|
240 |
<div class="input-field col s12">
|
241 |
<!-- <input name="ht_ctc_chat_options[pre_filled]" value="<?php // echo esc_attr( $options['pre_filled'] ) ?>" id="pre_filled" type="text" class="input-margin"> -->
|
242 |
<textarea style="min-height: 84px;" placeholder="<?php echo $placeholder ?>" name="ht_ctc_chat_options[pre_filled]" id="pre_filled" class="materialize-textarea input-margin"><?php echo $value ?></textarea>
|
243 |
-
<label for="pre_filled"
|
244 |
-
<p class="description"
|
245 |
</div>
|
246 |
</div>
|
247 |
<?php
|
@@ -250,147 +171,29 @@ class HT_CTC_Admin_Main_Page {
|
|
250 |
// call to action
|
251 |
function cta_cb() {
|
252 |
$options = get_option('ht_ctc_chat_options');
|
253 |
-
$value = (
|
254 |
?>
|
255 |
<div class="row">
|
256 |
<div class="input-field col s12">
|
257 |
<input name="ht_ctc_chat_options[call_to_action]" value="<?php echo $value ?>" id="call_to_action" type="text" class="input-margin">
|
258 |
-
<label for="call_to_action"
|
259 |
-
<p class="description"
|
260 |
-
|
261 |
-
</div>
|
262 |
-
<?php
|
263 |
-
}
|
264 |
-
|
265 |
-
|
266 |
-
// Desktop - select style
|
267 |
-
function ctc_desktop_style_cb() {
|
268 |
-
$options = get_option('ht_ctc_chat_options');
|
269 |
-
$style_value = ( '' == $options ) ? '' : esc_attr( $options['style_desktop'] );
|
270 |
-
?>
|
271 |
-
<div class="row">
|
272 |
-
<div class="input-field col s12" style="margin-bottom: 0px;">
|
273 |
-
<select name="ht_ctc_chat_options[style_desktop]" class="select-2">
|
274 |
-
<option value="1" <?php echo $style_value == 1 ? 'SELECTED' : ''; ?> >Style-1</option>
|
275 |
-
<option value="2" <?php echo $style_value == 2 ? 'SELECTED' : ''; ?> >Style-2</option>
|
276 |
-
<option value="3" <?php echo $style_value == 3 ? 'SELECTED' : ''; ?> >Style-3</option>
|
277 |
-
<option value="4" <?php echo $style_value == 4 ? 'SELECTED' : ''; ?> >Style-4</option>
|
278 |
-
<option value="5" <?php echo $style_value == 5 ? 'SELECTED' : ''; ?> >Style-5</option>
|
279 |
-
<option value="6" <?php echo $style_value == 6 ? 'SELECTED' : ''; ?> >Style-6</option>
|
280 |
-
<option value="7" <?php echo $style_value == 7 ? 'SELECTED' : ''; ?> >Style-7</option>
|
281 |
-
<option value="8" <?php echo $style_value == 8 ? 'SELECTED' : ''; ?> >Style-8</option>
|
282 |
-
<option value="99" <?php echo $style_value == 99 ? 'SELECTED' : ''; ?> >Style-99 (Add your own image / GIF)</option>
|
283 |
-
</select>
|
284 |
-
<label>Select Style for Desktop</label>
|
285 |
-
</div>
|
286 |
-
</div>
|
287 |
-
|
288 |
-
<!-- <p class="description"><a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/list-of-styles/"><span class="dashicons dashicons-list-view"></span> List of styles</a> </p>
|
289 |
-
<p class="description">Customize the styles ( Click to Chat -> <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>"><span class="dashicons dashicons-admin-customizer"></span>Customize Styles</a> ) </p> -->
|
290 |
-
<?php
|
291 |
-
}
|
292 |
-
|
293 |
-
|
294 |
-
// Mobile - select style
|
295 |
-
function ctc_mobile_style_cb() {
|
296 |
-
$options = get_option('ht_ctc_chat_options');
|
297 |
-
$style_value = ( '' == $options ) ? '' : esc_attr( $options['style_mobile'] );
|
298 |
-
?>
|
299 |
-
<div class="row" style="margin-bottom: 0px;">
|
300 |
-
<div class="input-field col s12">
|
301 |
-
<select name="ht_ctc_chat_options[style_mobile]" class="select-2">
|
302 |
-
<option value="1" <?php echo $style_value == 1 ? 'SELECTED' : ''; ?> >Style-1</option>
|
303 |
-
<option value="2" <?php echo $style_value == 2 ? 'SELECTED' : ''; ?> >Style-2</option>
|
304 |
-
<option value="3" <?php echo $style_value == 3 ? 'SELECTED' : ''; ?> >Style-3</option>
|
305 |
-
<option value="4" <?php echo $style_value == 4 ? 'SELECTED' : ''; ?> >Style-4</option>
|
306 |
-
<option value="5" <?php echo $style_value == 5 ? 'SELECTED' : ''; ?> >Style-5</option>
|
307 |
-
<option value="6" <?php echo $style_value == 6 ? 'SELECTED' : ''; ?> >Style-6</option>
|
308 |
-
<option value="7" <?php echo $style_value == 7 ? 'SELECTED' : ''; ?> >Style-7</option>
|
309 |
-
<option value="8" <?php echo $style_value == 8 ? 'SELECTED' : ''; ?> >Style-8</option>
|
310 |
-
<option value="99" <?php echo $style_value == 99 ? 'SELECTED' : ''; ?> >Style-99 (Add your own image / GIF)</option>
|
311 |
-
</select>
|
312 |
-
<label>Select Style for Mobile</label>
|
313 |
</div>
|
314 |
</div>
|
315 |
-
|
316 |
-
<p class="description"><a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/list-of-styles/">
|
317 |
-
<!-- <span class="dashicons dashicons-list-view"></span> -->
|
318 |
-
List of styles</a> </p>
|
319 |
-
<p class="description">Customize the styles ( Click to Chat -> <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">
|
320 |
-
<!-- <span class="dashicons dashicons-admin-customizer"></span> -->
|
321 |
-
Customize Styles</a> ) </p>
|
322 |
-
<br>
|
323 |
<?php
|
324 |
}
|
325 |
|
326 |
-
|
327 |
-
// position to place
|
328 |
-
function ctc_position_cb() {
|
329 |
-
$options = get_option('ht_ctc_chat_options');
|
330 |
-
$side_1 = ( '' == $options ) ? '' : esc_attr( $options['side_1'] );
|
331 |
-
$side_1_value = ( '' == $options ) ? '' : esc_attr( $options['side_1_value'] );
|
332 |
-
$side_2 = ( '' == $options ) ? '' : esc_attr( $options['side_2'] );
|
333 |
-
$side_2_value = ( '' == $options ) ? '' : esc_attr( $options['side_2_value'] );
|
334 |
-
|
335 |
-
?>
|
336 |
-
<!-- side - 1 -->
|
337 |
-
<div class="row">
|
338 |
-
<div class="input-field col s6">
|
339 |
-
<select name="ht_ctc_chat_options[side_1]" class="select-2">
|
340 |
-
<option value="bottom" <?php echo $side_1 == 'bottom' ? 'SELECTED' : ''; ?> >bottom</option>
|
341 |
-
<option value="top" <?php echo $side_1 == 'top' ? 'SELECTED' : ''; ?> >top</option>
|
342 |
-
</select>
|
343 |
-
<label>top / bottom </label>
|
344 |
-
</div>
|
345 |
-
<div class="input-field col s6">
|
346 |
-
<input name="ht_ctc_chat_options[side_1_value]" value="<?php echo $side_1_value ?>" id="side_1_value" type="text" class="input-margin">
|
347 |
-
<label for="side_1_value">e.g. 10px</label>
|
348 |
-
</div>
|
349 |
-
</div>
|
350 |
-
|
351 |
-
|
352 |
-
<!-- side - 2 -->
|
353 |
-
<div class="row">
|
354 |
-
<div class="input-field col s6">
|
355 |
-
<select name="ht_ctc_chat_options[side_2]" class="select-2">
|
356 |
-
<option value="right" <?php echo $side_2 == 'right' ? 'SELECTED' : ''; ?> >right</option>
|
357 |
-
<option value="left" <?php echo $side_2 == 'left' ? 'SELECTED' : ''; ?> >left</option>
|
358 |
-
</select>
|
359 |
-
<label>right / left</label>
|
360 |
-
</div>
|
361 |
-
|
362 |
-
<div class="input-field col s6">
|
363 |
-
<input name="ht_ctc_chat_options[side_2_value]" value="<?php echo $side_2_value ?>" id="side_2_value" type="text" class="input-margin">
|
364 |
-
<label for="side_2_value">e.g. 10px</label>
|
365 |
-
</div>
|
366 |
-
</div>
|
367 |
-
|
368 |
-
<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>
|
369 |
-
<?php
|
370 |
-
}
|
371 |
-
|
372 |
-
|
373 |
// If checked web / api whatsapp link. If unchecked wa.me links
|
374 |
function ctc_webandapi_cb() {
|
375 |
$options = get_option('ht_ctc_chat_options');
|
376 |
|
377 |
-
?>
|
378 |
-
<ul class="collapsible">
|
379 |
-
<li>
|
380 |
-
<div class="collapsible-header">Web WhatsApp</div>
|
381 |
-
<div class="collapsible-body">
|
382 |
-
|
383 |
-
<!-- <p class="description">keep this uncheck, If in mobile WhatsApp App is not opening (issue caused: if cache plugins not detectng the devices)</p> -->
|
384 |
-
<!-- <br> -->
|
385 |
-
|
386 |
-
<?php
|
387 |
-
|
388 |
if ( isset( $options['webandapi'] ) ) {
|
389 |
?>
|
390 |
<p>
|
391 |
<label>
|
392 |
<input name="ht_ctc_chat_options[webandapi]" type="checkbox" value="1" <?php checked( $options['webandapi'], 1 ); ?> id="webandapi" />
|
393 |
-
<span
|
394 |
</label>
|
395 |
</p>
|
396 |
<?php
|
@@ -399,41 +202,53 @@ class HT_CTC_Admin_Main_Page {
|
|
399 |
<p>
|
400 |
<label>
|
401 |
<input name="ht_ctc_chat_options[webandapi]" type="checkbox" value="1" id="webandapi" />
|
402 |
-
<span
|
403 |
</label>
|
404 |
</p>
|
405 |
<?php
|
406 |
}
|
407 |
?>
|
|
|
408 |
<br>
|
409 |
-
<p class="description">If checked opens Web.WhatsApp directly on Desktop and in mobile WhatsApp App - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/web-whatsapp/">more info</a> </p>
|
410 |
-
<br>
|
411 |
-
<p class="description"><strong>uncheck</strong> this option, if <strong>cache plugins</strong> on this website not detecting the devices</p>
|
412 |
-
<p class="description"></p>
|
413 |
-
|
414 |
-
</div>
|
415 |
-
</li>
|
416 |
-
<ul>
|
417 |
|
418 |
<?php
|
419 |
}
|
420 |
-
|
421 |
|
422 |
-
// show/hide
|
423 |
-
function ctc_show_hide_cb() {
|
424 |
|
|
|
|
|
|
|
425 |
$dbrow = 'ht_ctc_chat_options';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
426 |
$options = get_option('ht_ctc_chat_options');
|
|
|
|
|
|
|
|
|
|
|
427 |
|
428 |
-
include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-show-hide.php';
|
429 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
430 |
}
|
431 |
|
432 |
|
433 |
|
434 |
function chat_shortcode_cb() {
|
435 |
?>
|
436 |
-
<p class="description"
|
437 |
<?php
|
438 |
}
|
439 |
|
@@ -447,7 +262,7 @@ class HT_CTC_Admin_Main_Page {
|
|
447 |
*/
|
448 |
public function main_settings_section_cb() {
|
449 |
?>
|
450 |
-
<h1
|
451 |
<?php
|
452 |
}
|
453 |
|
@@ -463,7 +278,7 @@ class HT_CTC_Admin_Main_Page {
|
|
463 |
|
464 |
<ul class="collapsible">
|
465 |
<li>
|
466 |
-
<div class="collapsible-header"
|
467 |
<div class="collapsible-body">
|
468 |
|
469 |
<!-- not make empty table -->
|
@@ -471,85 +286,7 @@ class HT_CTC_Admin_Main_Page {
|
|
471 |
|
472 |
<?php
|
473 |
|
474 |
-
|
475 |
-
if ( isset( $options['enable_chat'] ) ) {
|
476 |
-
?>
|
477 |
-
<p>
|
478 |
-
<label>
|
479 |
-
<input name="ht_ctc_main_options[enable_chat]" type="checkbox" value="1" <?php checked( $options['enable_chat'], 1 ); ?> id="enable_chat" />
|
480 |
-
<span>Enable WhatsApp Chat Features</span>
|
481 |
-
</label>
|
482 |
-
<!-- <p class="description"> - <a href="<?php echo admin_url( 'admin.php?page=click-to-chat-chat-feature' ); ?>">Chat Settings page</a> </p> -->
|
483 |
-
</p>
|
484 |
-
<?php
|
485 |
-
} else {
|
486 |
-
?>
|
487 |
-
<p>
|
488 |
-
<label>
|
489 |
-
<input name="ht_ctc_main_options[enable_chat]" type="checkbox" value="1" id="enable_chat" />
|
490 |
-
<span>Enable WhatsApp Chat Features</span>
|
491 |
-
</label>
|
492 |
-
</p>
|
493 |
-
<?php
|
494 |
-
}
|
495 |
-
?>
|
496 |
-
<p class="description"> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/enable-chat">more info</a> </p>
|
497 |
-
<br>
|
498 |
-
<?php
|
499 |
-
|
500 |
-
|
501 |
-
// enable group
|
502 |
-
if ( isset( $options['enable_group'] ) ) {
|
503 |
-
?>
|
504 |
-
<p>
|
505 |
-
<label>
|
506 |
-
<input name="ht_ctc_main_options[enable_group]" type="checkbox" value="1" <?php checked( $options['enable_group'], 1 ); ?> id="enable_group" />
|
507 |
-
<span>Enable Group Features</span>
|
508 |
-
</label>
|
509 |
-
<p class="description"> - <a href="<?php echo admin_url( 'admin.php?page=click-to-chat-group-feature' ); ?>">Group Settings page</a> </p>
|
510 |
-
</p>
|
511 |
-
<?php
|
512 |
-
} else {
|
513 |
-
?>
|
514 |
-
<p>
|
515 |
-
<label>
|
516 |
-
<input name="ht_ctc_main_options[enable_group]" type="checkbox" value="1" id="enable_group" />
|
517 |
-
<span>Enable Group Features</span>
|
518 |
-
</label>
|
519 |
-
</p>
|
520 |
-
<?php
|
521 |
-
}
|
522 |
-
?>
|
523 |
-
<p class="description"> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/enable-group">more info</a> </p>
|
524 |
-
<br>
|
525 |
-
<?php
|
526 |
-
|
527 |
-
|
528 |
-
// enable share
|
529 |
-
if ( isset( $options['enable_share'] ) ) {
|
530 |
-
?>
|
531 |
-
<p>
|
532 |
-
<label>
|
533 |
-
<input name="ht_ctc_main_options[enable_share]" type="checkbox" value="1" <?php checked( $options['enable_share'], 1 ); ?> id="enable_share" />
|
534 |
-
<span>Enable Share Features</span>
|
535 |
-
</label>
|
536 |
-
<p class="description"> - <a href="<?php echo admin_url( 'admin.php?page=click-to-chat-share-feature' ); ?>">Share Settings page</a> </p>
|
537 |
-
</p>
|
538 |
-
<?php
|
539 |
-
} else {
|
540 |
-
?>
|
541 |
-
<p>
|
542 |
-
<label>
|
543 |
-
<input name="ht_ctc_main_options[enable_share]" type="checkbox" value="1" id="enable_share" />
|
544 |
-
<span>Enable Share Features</span>
|
545 |
-
</label>
|
546 |
-
</p>
|
547 |
-
<?php
|
548 |
-
}
|
549 |
-
?>
|
550 |
-
<p class="description"> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/enable-share">more info</a> </p>
|
551 |
-
<br>
|
552 |
-
<?php
|
553 |
|
554 |
// Google Analytics
|
555 |
if ( isset( $options['google_analytics'] ) ) {
|
@@ -557,7 +294,7 @@ class HT_CTC_Admin_Main_Page {
|
|
557 |
<p>
|
558 |
<label>
|
559 |
<input name="ht_ctc_main_options[google_analytics]" type="checkbox" value="1" <?php checked( $options['google_analytics'], 1 ); ?> id="google_analytics" />
|
560 |
-
<span
|
561 |
</label>
|
562 |
</p>
|
563 |
<?php
|
@@ -566,13 +303,13 @@ class HT_CTC_Admin_Main_Page {
|
|
566 |
<p>
|
567 |
<label>
|
568 |
<input name="ht_ctc_main_options[google_analytics]" type="checkbox" value="1" id="google_analytics" />
|
569 |
-
<span
|
570 |
</label>
|
571 |
</p>
|
572 |
<?php
|
573 |
}
|
574 |
?>
|
575 |
-
<p class="description"
|
576 |
<br>
|
577 |
|
578 |
|
@@ -584,7 +321,7 @@ class HT_CTC_Admin_Main_Page {
|
|
584 |
<p>
|
585 |
<label>
|
586 |
<input name="ht_ctc_main_options[fb_pixel]" type="checkbox" value="1" <?php checked( $options['fb_pixel'], 1 ); ?> id="fb_pixel" />
|
587 |
-
<span
|
588 |
</label>
|
589 |
</p>
|
590 |
<?php
|
@@ -593,15 +330,18 @@ class HT_CTC_Admin_Main_Page {
|
|
593 |
<p>
|
594 |
<label>
|
595 |
<input name="ht_ctc_main_options[fb_pixel]" type="checkbox" value="1" id="fb_pixel" />
|
596 |
-
<span
|
597 |
</label>
|
598 |
</p>
|
599 |
<?php
|
600 |
}
|
601 |
?>
|
602 |
-
<p class="description"
|
603 |
<br>
|
604 |
|
|
|
|
|
|
|
605 |
|
606 |
</div>
|
607 |
</div>
|
@@ -621,10 +361,10 @@ class HT_CTC_Admin_Main_Page {
|
|
621 |
<!-- <br><br><br><br><br><br><br><br> -->
|
622 |
<ul class="collapsible">
|
623 |
<li>
|
624 |
-
<div class="collapsible-header"
|
625 |
<div class="collapsible-body">
|
626 |
|
627 |
-
<p class="description"
|
628 |
<br><br>
|
629 |
<div class="row">
|
630 |
<div class="input-field col s12" style="margin-bottom: 0px;">
|
@@ -632,7 +372,7 @@ class HT_CTC_Admin_Main_Page {
|
|
632 |
<option value="no" <?php echo $interface_value == 'no' ? 'SELECTED' : ''; ?> >Previous Interface</option>
|
633 |
<option value="yes" <?php echo $interface_value == 'yes' ? 'SELECTED' : ''; ?> >New Interface</option>
|
634 |
</select>
|
635 |
-
<label
|
636 |
</div>
|
637 |
<!-- <p class="description">If you are convenient with the previous interface in comparison to the new one, please switch to previous interface</p> -->
|
638 |
</div>
|
@@ -668,15 +408,7 @@ class HT_CTC_Admin_Main_Page {
|
|
668 |
if ( 'pre_filled' == $key ) {
|
669 |
// $new_input[$key] = esc_textarea( $input[$key] );
|
670 |
$new_input[$key] = sanitize_textarea_field( $input[$key] );
|
671 |
-
} elseif ( 'side_1_value' == $key ) {
|
672 |
-
if ( is_numeric($input[$key]) ) {
|
673 |
-
$input[$key] = $input[$key] . 'px';
|
674 |
-
}
|
675 |
-
if ( '' == $input[$key] ) {
|
676 |
-
$input[$key] = '0px';
|
677 |
-
}
|
678 |
-
$new_input[$key] = sanitize_text_field( $input[$key] );
|
679 |
-
} elseif ( 'side_2_value' == $key ) {
|
680 |
if ( is_numeric($input[$key]) ) {
|
681 |
$input[$key] = $input[$key] . 'px';
|
682 |
}
|
@@ -690,6 +422,13 @@ class HT_CTC_Admin_Main_Page {
|
|
690 |
}
|
691 |
}
|
692 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
693 |
|
694 |
return $new_input;
|
695 |
}
|
56 |
|
57 |
<!-- sidebar content -->
|
58 |
<div class="col s12 m12 l7 xl4 ht-cc-admin-sidebar sticky-sidebar">
|
59 |
+
<?php include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-sidebar-content.php'; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
</div>
|
61 |
|
62 |
</div>
|
83 |
|
84 |
|
85 |
// chat feautes
|
86 |
+
register_setting( 'ht_ctc_main_page_settings_fields', 'ht_ctc_chat_options' , array( $this, 'options_sanitize' ) );
|
87 |
+
|
88 |
+
add_settings_section( 'ht_ctc_chat_page_settings_sections_add', '', array( $this, 'chat_settings_section_cb' ), 'ht_ctc_main_page_settings_sections_do' );
|
89 |
+
|
90 |
+
add_settings_field( 'number', __( 'WhatsApp Number', 'click-to-chat-for-whatsapp'), array( $this, 'number_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
|
91 |
+
add_settings_field( 'prefilled', __( 'Pre-Filled Message', 'click-to-chat-for-whatsapp'), array( $this, 'prefilled_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
|
92 |
+
add_settings_field( 'cta', __( 'Call to Action', 'click-to-chat-for-whatsapp'), array( $this, 'cta_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
|
93 |
+
add_settings_field( 'ctc_webandapi', __( 'Web WhatsApp', 'click-to-chat-for-whatsapp'), array( $this, 'ctc_webandapi_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
|
94 |
+
add_settings_field( 'ctc_desktop', __( 'Dekstop', 'click-to-chat-for-whatsapp'), array( $this, 'ctc_desktop_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
|
95 |
+
add_settings_field( 'ctc_mobile', __( 'Mobile', 'click-to-chat-for-whatsapp'), array( $this, 'ctc_mobile_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
|
96 |
+
add_settings_field( 'ctc_show_hide', __( 'Display Settings', 'click-to-chat-for-whatsapp'), array( $this, 'ctc_show_hide_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
|
97 |
|
98 |
+
if ( class_exists( 'WooCommerce' ) ) {
|
99 |
+
add_settings_field( 'ctc_woo', 'WooCommerce', array( $this, 'ctc_woo_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
}
|
101 |
+
add_settings_field( 'chat_shortcode', '', array( $this, 'chat_shortcode_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
|
102 |
|
103 |
|
104 |
+
// main settings - global options - analytics ..
|
|
|
105 |
register_setting( 'ht_ctc_main_page_settings_fields', 'ht_ctc_main_options' , array( $this, 'options_sanitize' ) );
|
106 |
add_settings_section( 'ht_ctc_main_page_settings_sections_add', '', array( $this, 'main_settings_section_cb' ), 'ht_ctc_main_page_settings_sections_do' );
|
107 |
|
108 |
add_settings_field( 'ctc_enable_features', 'Enable Features', array( $this, 'ctc_enable_features_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
|
109 |
|
110 |
+
// switch options
|
111 |
$ccw_options = get_option('ccw_options');
|
112 |
if ( isset( $ccw_options['number'] ) ) {
|
113 |
// display this setting page only if user switched from previous interface.. ( for new users no switch option )
|
118 |
}
|
119 |
|
120 |
|
121 |
+
// WooCommerce related settings
|
122 |
+
public function ctc_woo_cb() {
|
123 |
+
do_action('ht_ctc_ah_admin_chat_woo_settings');
|
124 |
+
}
|
125 |
+
|
126 |
|
127 |
public function chat_settings_section_cb() {
|
128 |
?>
|
129 |
<h1>Click to Chat ( New Interface )</h1>
|
130 |
<br>
|
131 |
+
<h1 id="chat_settings">Chat Settings</h1>
|
132 |
<?php
|
133 |
}
|
134 |
|
136 |
// WhatsApp number
|
137 |
function number_cb() {
|
138 |
$options = get_option('ht_ctc_chat_options');
|
139 |
+
$value = ( isset( $options['number']) ) ? esc_attr( $options['number'] ) : '';
|
140 |
?>
|
141 |
<div class="row">
|
142 |
<div class="input-field col s12">
|
143 |
<input name="ht_ctc_chat_options[number]" value="<?php echo $value ?>" id="whatsapp_number" type="text" class="input-margin tooltipped" data-position="top" data-tooltip="Country Code and Number">
|
144 |
+
<label for="whatsapp_number"><?php _e( 'WhatsApp Number with Country Code', 'click-to-chat-for-whatsapp' ); ?></label>
|
145 |
<!-- <span class="helper-text">Country code + number</span> -->
|
146 |
+
<p class="description"><?php _e( "Enter 'WhatsApp' or 'WhatsApp business' number with country code", 'click-to-chat-for-whatsapp' ); ?>
|
147 |
+
<br> <?php _e( '( E.g. 916123456789 - herein e.g. 91 is country code, 6123456789 is the mobile number )', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/whatsapp-number/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> ) </p>
|
148 |
</div>
|
149 |
</div>
|
150 |
<?php
|
153 |
// pre-filled - message
|
154 |
function prefilled_cb() {
|
155 |
$options = get_option('ht_ctc_chat_options');
|
156 |
+
$value = ( isset( $options['pre_filled']) ) ? esc_attr( $options['pre_filled'] ) : '';
|
157 |
$blogname = HT_CTC_BLOG_NAME;
|
158 |
$placeholder = "Hello $blogname!! \nName: \nLike to know more information about {{title}}, {{url}}";
|
159 |
?>
|
161 |
<div class="input-field col s12">
|
162 |
<!-- <input name="ht_ctc_chat_options[pre_filled]" value="<?php // echo esc_attr( $options['pre_filled'] ) ?>" id="pre_filled" type="text" class="input-margin"> -->
|
163 |
<textarea style="min-height: 84px;" placeholder="<?php echo $placeholder ?>" name="ht_ctc_chat_options[pre_filled]" id="pre_filled" class="materialize-textarea input-margin"><?php echo $value ?></textarea>
|
164 |
+
<label for="pre_filled"><?php _e( 'Pre-filled message', 'click-to-chat-for-whatsapp' ); ?></label>
|
165 |
+
<p class="description"><?php _e( "Text that appears in the WhatsApp Chat window. Add variables {site}, {url}, {title} to replace with site name, current webpage URL, Post title", 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/pre-filled-message/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
|
166 |
</div>
|
167 |
</div>
|
168 |
<?php
|
171 |
// call to action
|
172 |
function cta_cb() {
|
173 |
$options = get_option('ht_ctc_chat_options');
|
174 |
+
$value = ( isset( $options['call_to_action']) ) ? esc_attr( $options['call_to_action'] ) : '';
|
175 |
?>
|
176 |
<div class="row">
|
177 |
<div class="input-field col s12">
|
178 |
<input name="ht_ctc_chat_options[call_to_action]" value="<?php echo $value ?>" id="call_to_action" type="text" class="input-margin">
|
179 |
+
<label for="call_to_action"><?php _e( 'Call to Action', 'click-to-chat-for-whatsapp' ); ?></label>
|
180 |
+
<p class="description"><?php _e( 'Text that appears along with WhatsApp icon/button', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/call-to-action/">more info</a> </p>
|
181 |
+
<p class="description"><?php _e( 'Style 1, 4, 6, 8 displays by default, Style 2, 5, 7 displays only on hover. Style-99 its your own image', 'click-to-chat-for-whatsapp' ); ?></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
</div>
|
183 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
<?php
|
185 |
}
|
186 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
// If checked web / api whatsapp link. If unchecked wa.me links
|
188 |
function ctc_webandapi_cb() {
|
189 |
$options = get_option('ht_ctc_chat_options');
|
190 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
191 |
if ( isset( $options['webandapi'] ) ) {
|
192 |
?>
|
193 |
<p>
|
194 |
<label>
|
195 |
<input name="ht_ctc_chat_options[webandapi]" type="checkbox" value="1" <?php checked( $options['webandapi'], 1 ); ?> id="webandapi" />
|
196 |
+
<span><?php _e( 'Web WhatsApp on Desktop', 'click-to-chat-for-whatsapp' ); ?></span>
|
197 |
</label>
|
198 |
</p>
|
199 |
<?php
|
202 |
<p>
|
203 |
<label>
|
204 |
<input name="ht_ctc_chat_options[webandapi]" type="checkbox" value="1" id="webandapi" />
|
205 |
+
<span><?php _e( 'Web WhatsApp on Desktop', 'click-to-chat-for-whatsapp' ); ?></span>
|
206 |
</label>
|
207 |
</p>
|
208 |
<?php
|
209 |
}
|
210 |
?>
|
211 |
+
<p class="description"><?php _e( 'If checked opens Web.WhatsApp directly on Desktop and in mobile WhatsApp App', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/web-whatsapp/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
|
212 |
<br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
|
214 |
<?php
|
215 |
}
|
|
|
216 |
|
|
|
|
|
217 |
|
218 |
+
// Dekstop
|
219 |
+
function ctc_desktop_cb() {
|
220 |
+
$options = get_option('ht_ctc_chat_options');
|
221 |
$dbrow = 'ht_ctc_chat_options';
|
222 |
+
$type = 'chat';
|
223 |
+
|
224 |
+
include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-desktop.php';
|
225 |
+
}
|
226 |
+
|
227 |
+
|
228 |
+
// Mobile
|
229 |
+
function ctc_mobile_cb() {
|
230 |
$options = get_option('ht_ctc_chat_options');
|
231 |
+
$dbrow = 'ht_ctc_chat_options';
|
232 |
+
$type = 'chat';
|
233 |
+
|
234 |
+
include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-mobile.php';
|
235 |
+
}
|
236 |
|
|
|
237 |
|
238 |
+
// show/hide
|
239 |
+
function ctc_show_hide_cb() {
|
240 |
+
$options = get_option('ht_ctc_chat_options');
|
241 |
+
$dbrow = 'ht_ctc_chat_options';
|
242 |
+
$type = 'chat';
|
243 |
+
|
244 |
+
include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-show-hide.php';
|
245 |
}
|
246 |
|
247 |
|
248 |
|
249 |
function chat_shortcode_cb() {
|
250 |
?>
|
251 |
+
<p class="description card-panel" style="padding: 18px;"> <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/shortcodes-chat">Shortcodes for Chat: </a>[ht-ctc-chat]</p>
|
252 |
<?php
|
253 |
}
|
254 |
|
262 |
*/
|
263 |
public function main_settings_section_cb() {
|
264 |
?>
|
265 |
+
<h1><?php _e( 'Enable features', 'click-to-chat-for-whatsapp' ); ?></h1>
|
266 |
<?php
|
267 |
}
|
268 |
|
278 |
|
279 |
<ul class="collapsible">
|
280 |
<li>
|
281 |
+
<div class="collapsible-header"><?php _e( 'Enable features', 'click-to-chat-for-whatsapp' ); ?></div>
|
282 |
<div class="collapsible-body">
|
283 |
|
284 |
<!-- not make empty table -->
|
286 |
|
287 |
<?php
|
288 |
|
289 |
+
do_action('ht_ctc_ah_admin_main_before_enable');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
|
291 |
// Google Analytics
|
292 |
if ( isset( $options['google_analytics'] ) ) {
|
294 |
<p>
|
295 |
<label>
|
296 |
<input name="ht_ctc_main_options[google_analytics]" type="checkbox" value="1" <?php checked( $options['google_analytics'], 1 ); ?> id="google_analytics" />
|
297 |
+
<span><?php _e( 'Google Analytics', 'click-to-chat-for-whatsapp' ); ?></span>
|
298 |
</label>
|
299 |
</p>
|
300 |
<?php
|
303 |
<p>
|
304 |
<label>
|
305 |
<input name="ht_ctc_main_options[google_analytics]" type="checkbox" value="1" id="google_analytics" />
|
306 |
+
<span><?php _e( 'Google Analytics', 'click-to-chat-for-whatsapp' ); ?></span>
|
307 |
</label>
|
308 |
</p>
|
309 |
<?php
|
310 |
}
|
311 |
?>
|
312 |
+
<p class="description"><?php _e( 'If Google Analytics installed creates an Event there', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/google-analytics/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
|
313 |
<br>
|
314 |
|
315 |
|
321 |
<p>
|
322 |
<label>
|
323 |
<input name="ht_ctc_main_options[fb_pixel]" type="checkbox" value="1" <?php checked( $options['fb_pixel'], 1 ); ?> id="fb_pixel" />
|
324 |
+
<span><?php _e( 'Facebook Pixel', 'click-to-chat-for-whatsapp' ); ?></span>
|
325 |
</label>
|
326 |
</p>
|
327 |
<?php
|
330 |
<p>
|
331 |
<label>
|
332 |
<input name="ht_ctc_main_options[fb_pixel]" type="checkbox" value="1" id="fb_pixel" />
|
333 |
+
<span><?php _e( 'Facebook Pixel', 'click-to-chat-for-whatsapp' ); ?></span>
|
334 |
</label>
|
335 |
</p>
|
336 |
<?php
|
337 |
}
|
338 |
?>
|
339 |
+
<p class="description"><?php _e( 'If Facebook Pixel installed creates an Event there', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/facebook-pixel/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
|
340 |
<br>
|
341 |
|
342 |
+
<?php
|
343 |
+
do_action('ht_ctc_ah_admin_main_after_enable');
|
344 |
+
?>
|
345 |
|
346 |
</div>
|
347 |
</div>
|
361 |
<!-- <br><br><br><br><br><br><br><br> -->
|
362 |
<ul class="collapsible">
|
363 |
<li>
|
364 |
+
<div class="collapsible-header"><?php _e( 'Switch Interface', 'click-to-chat-for-whatsapp' ); ?></div>
|
365 |
<div class="collapsible-body">
|
366 |
|
367 |
+
<p class="description"><?php _e( 'If you are convenient with the previous interface in comparison to the new one, please switch to previous interface', 'click-to-chat-for-whatsapp' ); ?></p>
|
368 |
<br><br>
|
369 |
<div class="row">
|
370 |
<div class="input-field col s12" style="margin-bottom: 0px;">
|
372 |
<option value="no" <?php echo $interface_value == 'no' ? 'SELECTED' : ''; ?> >Previous Interface</option>
|
373 |
<option value="yes" <?php echo $interface_value == 'yes' ? 'SELECTED' : ''; ?> >New Interface</option>
|
374 |
</select>
|
375 |
+
<label><?php _e( 'Switch Interface', 'click-to-chat-for-whatsapp' ); ?></label>
|
376 |
</div>
|
377 |
<!-- <p class="description">If you are convenient with the previous interface in comparison to the new one, please switch to previous interface</p> -->
|
378 |
</div>
|
408 |
if ( 'pre_filled' == $key ) {
|
409 |
// $new_input[$key] = esc_textarea( $input[$key] );
|
410 |
$new_input[$key] = sanitize_textarea_field( $input[$key] );
|
411 |
+
} elseif ( 'side_1_value' == $key || 'side_2_value' == $key || 'mobile_side_1_value' == $key || 'mobile_side_2_value' == $key ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
412 |
if ( is_numeric($input[$key]) ) {
|
413 |
$input[$key] = $input[$key] . 'px';
|
414 |
}
|
422 |
}
|
423 |
}
|
424 |
|
425 |
+
// l10n
|
426 |
+
foreach ($input as $key => $value) {
|
427 |
+
if ( 'number' == $key || 'pre_filled' == $key || 'call_to_action' == $key || 'woo_pre_filled' == $key || 'woo_call_to_action' == $key ) {
|
428 |
+
do_action( 'wpml_register_single_string', 'Click to Chat for WhatsApp', $key, $input[$key] );
|
429 |
+
}
|
430 |
+
}
|
431 |
+
|
432 |
|
433 |
return $new_input;
|
434 |
}
|
new/admin/class-ht-ctc-admin-scripts.php
CHANGED
@@ -18,7 +18,7 @@ class HT_CTC_Admin_Scripts {
|
|
18 |
function register_scripts_admin($hook) {
|
19 |
|
20 |
// true/false
|
21 |
-
$load_js_bottom = apply_filters( 'ht_ctc_fh_load_js_bottom',
|
22 |
|
23 |
// hook ..
|
24 |
if( 'toplevel_page_click-to-chat' == $hook || 'click-to-chat_page_click-to-chat-chat-feature' == $hook || 'click-to-chat_page_click-to-chat-group-feature' == $hook || 'click-to-chat_page_click-to-chat-share-feature' == $hook || 'click-to-chat_page_click-to-chat-customize-styles' == $hook ) {
|
18 |
function register_scripts_admin($hook) {
|
19 |
|
20 |
// true/false
|
21 |
+
$load_js_bottom = apply_filters( 'ht_ctc_fh_load_js_bottom', false );
|
22 |
|
23 |
// hook ..
|
24 |
if( 'toplevel_page_click-to-chat' == $hook || 'click-to-chat_page_click-to-chat-chat-feature' == $hook || 'click-to-chat_page_click-to-chat-group-feature' == $hook || 'click-to-chat_page_click-to-chat-share-feature' == $hook || 'click-to-chat_page_click-to-chat-customize-styles' == $hook ) {
|
new/admin/class-ht-ctc-admin-share-page.php
CHANGED
@@ -66,14 +66,14 @@ class HT_CTC_Admin_Share_Page {
|
|
66 |
|
67 |
add_settings_section( 'ht_ctc_main_page_settings_sections_add', '', array( $this, 'main_settings_section_cb' ), 'ht_ctc_share_page_settings_sections_do' );
|
68 |
|
69 |
-
add_settings_field( 'share_text', 'Share Text', array( $this, 'share_text_cb' ), 'ht_ctc_share_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
|
70 |
-
add_settings_field( 'share_cta', 'Call to Action', array( $this, 'share_cta_cb' ), 'ht_ctc_share_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
|
71 |
-
|
72 |
-
|
73 |
-
add_settings_field( '
|
74 |
-
add_settings_field( '
|
75 |
-
|
76 |
-
add_settings_field( 'share_show_hide', 'Show/Hide', array( $this, 'share_show_hide_cb' ), 'ht_ctc_share_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
|
77 |
add_settings_field( 'share_shortcode', '', array( $this, 'share_shortcode_cb' ), 'ht_ctc_share_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
|
78 |
|
79 |
|
@@ -81,7 +81,7 @@ class HT_CTC_Admin_Share_Page {
|
|
81 |
|
82 |
public function main_settings_section_cb() {
|
83 |
?>
|
84 |
-
<h1
|
85 |
<?php
|
86 |
}
|
87 |
|
@@ -89,13 +89,13 @@ class HT_CTC_Admin_Share_Page {
|
|
89 |
// WhatsApp share ID.
|
90 |
function share_text_cb() {
|
91 |
$options = get_option('ht_ctc_share');
|
92 |
-
$value = (
|
93 |
?>
|
94 |
<div class="row">
|
95 |
<div class="input-field col s12">
|
96 |
<input name="ht_ctc_share[share_text]" value="<?php echo $value ?>" id="whatsapp_share_text" type="text" class="input-margin">
|
97 |
-
<label for="whatsapp_share_text"
|
98 |
-
<p class="description"
|
99 |
</div>
|
100 |
</div>
|
101 |
<?php
|
@@ -104,141 +104,29 @@ class HT_CTC_Admin_Share_Page {
|
|
104 |
// call to action
|
105 |
function share_cta_cb() {
|
106 |
$options = get_option('ht_ctc_share');
|
107 |
-
$value = (
|
108 |
?>
|
109 |
<div class="row">
|
110 |
<div class="input-field col s12">
|
111 |
<input name="ht_ctc_share[call_to_action]" value="<?php echo $value ?>" id="call_to_action" type="text" class="input-margin">
|
112 |
-
<label for="call_to_action"
|
113 |
-
<p class="description"
|
114 |
</div>
|
115 |
</div>
|
116 |
<?php
|
117 |
}
|
118 |
|
119 |
|
120 |
-
|
121 |
-
// Desktop - select style
|
122 |
-
function share_ctc_desktop_style_cb() {
|
123 |
-
$options = get_option('ht_ctc_share');
|
124 |
-
$style_value = ( '' == $options ) ? '' : esc_attr( $options['style_desktop'] );
|
125 |
-
?>
|
126 |
-
<div class="row">
|
127 |
-
<div class="input-field col s12" style="margin-bottom: 0px;">
|
128 |
-
<select name="ht_ctc_share[style_desktop]" class="select-2">
|
129 |
-
<option value="1" <?php echo $style_value == 1 ? 'SELECTED' : ''; ?> >Style-1</option>
|
130 |
-
<option value="2" <?php echo $style_value == 2 ? 'SELECTED' : ''; ?> >Style-2</option>
|
131 |
-
<option value="3" <?php echo $style_value == 3 ? 'SELECTED' : ''; ?> >Style-3</option>
|
132 |
-
<option value="4" <?php echo $style_value == 4 ? 'SELECTED' : ''; ?> >Style-4</option>
|
133 |
-
<option value="5" <?php echo $style_value == 5 ? 'SELECTED' : ''; ?> >Style-5</option>
|
134 |
-
<option value="6" <?php echo $style_value == 6 ? 'SELECTED' : ''; ?> >Style-6</option>
|
135 |
-
<option value="7" <?php echo $style_value == 7 ? 'SELECTED' : ''; ?> >Style-7</option>
|
136 |
-
<option value="8" <?php echo $style_value == 8 ? 'SELECTED' : ''; ?> >Style-8</option>
|
137 |
-
<option value="99" <?php echo $style_value == 99 ? 'SELECTED' : ''; ?> >Style-99 (Add your own image / GIF)</option>
|
138 |
-
</select>
|
139 |
-
<label>Select Style for Desktop</label>
|
140 |
-
</div>
|
141 |
-
</div>
|
142 |
-
|
143 |
-
<p class="description"> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/list-of-styles/">List of syles</a> </p>
|
144 |
-
<p class="description">Can customize each style - <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>"><?php _e( 'Customize Styles' , 'click-to-chat-for-whatsapp' ) ?></a> </p>
|
145 |
-
|
146 |
-
<?php
|
147 |
-
}
|
148 |
-
|
149 |
-
|
150 |
-
// Mobile - select style
|
151 |
-
function share_ctc_mobile_style_cb() {
|
152 |
-
$options = get_option('ht_ctc_share');
|
153 |
-
$style_value = ( '' == $options ) ? '' : esc_attr( $options['style_mobile'] );
|
154 |
-
?>
|
155 |
-
<div class="row" style="margin-bottom: 0px;">
|
156 |
-
<div class="input-field col s12">
|
157 |
-
<select name="ht_ctc_share[style_mobile]" class="select-2">
|
158 |
-
<option value="1" <?php echo $style_value == 1 ? 'SELECTED' : ''; ?> >Style-1</option>
|
159 |
-
<option value="2" <?php echo $style_value == 2 ? 'SELECTED' : ''; ?> >Style-2</option>
|
160 |
-
<option value="3" <?php echo $style_value == 3 ? 'SELECTED' : ''; ?> >Style-3</option>
|
161 |
-
<option value="4" <?php echo $style_value == 4 ? 'SELECTED' : ''; ?> >Style-4</option>
|
162 |
-
<option value="5" <?php echo $style_value == 5 ? 'SELECTED' : ''; ?> >Style-5</option>
|
163 |
-
<option value="6" <?php echo $style_value == 6 ? 'SELECTED' : ''; ?> >Style-6</option>
|
164 |
-
<option value="7" <?php echo $style_value == 7 ? 'SELECTED' : ''; ?> >Style-7</option>
|
165 |
-
<option value="8" <?php echo $style_value == 8 ? 'SELECTED' : ''; ?> >Style-8</option>
|
166 |
-
<option value="99" <?php echo $style_value == 99 ? 'SELECTED' : ''; ?> >Style-99 (Add your own image / GIF)</option>
|
167 |
-
</select>
|
168 |
-
<label>Select Style for Mobile</label>
|
169 |
-
</div>
|
170 |
-
</div>
|
171 |
-
|
172 |
-
<?php
|
173 |
-
}
|
174 |
-
|
175 |
-
|
176 |
-
// position to place
|
177 |
-
function share_ctc_position_cb() {
|
178 |
-
$options = get_option('ht_ctc_share');
|
179 |
-
|
180 |
-
$side_1 = ( '' == $options ) ? '' : esc_attr( $options['side_1'] );
|
181 |
-
$side_2 = ( '' == $options ) ? '' : esc_attr( $options['side_2'] );
|
182 |
-
$side_1_value = ( '' == $options ) ? '' : esc_attr( $options['side_1_value'] );
|
183 |
-
$side_2_value = ( '' == $options ) ? '' : esc_attr( $options['side_2_value'] );
|
184 |
-
?>
|
185 |
-
<!-- side - 1 -->
|
186 |
-
<div class="row">
|
187 |
-
<div class="input-field col s6">
|
188 |
-
<select name="ht_ctc_share[side_1]" class="select-2">
|
189 |
-
<option value="bottom" <?php echo $side_1 == 'bottom' ? 'SELECTED' : ''; ?> >bottom</option>
|
190 |
-
<option value="top" <?php echo $side_1 == 'top' ? 'SELECTED' : ''; ?> >top</option>
|
191 |
-
</select>
|
192 |
-
<label>top / bottom </label>
|
193 |
-
</div>
|
194 |
-
|
195 |
-
<div class="input-field col s6">
|
196 |
-
<input name="ht_ctc_share[side_1_value]" value="<?php echo $side_1_value ?>" id="side_1_value" type="text" class="input-margin">
|
197 |
-
<label for="side_1_value">e.g. 10px</label>
|
198 |
-
</div>
|
199 |
-
</div>
|
200 |
-
|
201 |
-
<!-- side - 2 -->
|
202 |
-
<div class="row">
|
203 |
-
<div class="input-field col s6">
|
204 |
-
<select name="ht_ctc_share[side_2]" class="select-2">
|
205 |
-
<option value="right" <?php echo $side_2 == 'right' ? 'SELECTED' : ''; ?> >right</option>
|
206 |
-
<option value="left" <?php echo $side_2 == 'left' ? 'SELECTED' : ''; ?> >left</option>
|
207 |
-
</select>
|
208 |
-
<label>right / left </label>
|
209 |
-
</div>
|
210 |
-
|
211 |
-
<div class="input-field col s6">
|
212 |
-
<input name="ht_ctc_share[side_2_value]" value="<?php echo $side_2_value ?>" id="side_2_value" type="text" class="input-margin">
|
213 |
-
<label for="side_2_value">e.g. 10px</label>
|
214 |
-
</div>
|
215 |
-
</div>
|
216 |
-
|
217 |
-
<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>
|
218 |
-
<?php
|
219 |
-
}
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
// If checked web / api whatsapp link. If unchecked wa.me links
|
225 |
function share_ctc_webandapi_cb() {
|
226 |
$options = get_option('ht_ctc_share');
|
227 |
|
228 |
-
?>
|
229 |
-
<ul class="collapsible">
|
230 |
-
<li>
|
231 |
-
<div class="collapsible-header">Web WhatsApp</div>
|
232 |
-
<div class="collapsible-body">
|
233 |
-
|
234 |
-
<?php
|
235 |
-
|
236 |
if ( isset( $options['webandapi'] ) ) {
|
237 |
?>
|
238 |
<p>
|
239 |
<label>
|
240 |
<input name="ht_ctc_share[webandapi]" type="checkbox" value="1" <?php checked( $options['webandapi'], 1 ); ?> id="webandapi" />
|
241 |
-
<span
|
242 |
</label>
|
243 |
</p>
|
244 |
<?php
|
@@ -247,42 +135,52 @@ class HT_CTC_Admin_Share_Page {
|
|
247 |
<p>
|
248 |
<label>
|
249 |
<input name="ht_ctc_share[webandapi]" type="checkbox" value="1" id="webandapi" />
|
250 |
-
<span
|
251 |
</label>
|
252 |
</p>
|
253 |
<?php
|
254 |
}
|
255 |
?>
|
|
|
256 |
<br>
|
257 |
-
<p class="description">If checked opens Web.WhatsApp directly on Desktop and in mobile WhatsApp App - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/web-whatsapp/">more info</a> </p>
|
258 |
-
<br>
|
259 |
-
<p class="description"><strong>uncheck</strong> this option, if <strong>cache plugins</strong> on this website not detecting the devices</p>
|
260 |
-
<p class="description"></p>
|
261 |
-
|
262 |
-
</div>
|
263 |
-
</li>
|
264 |
-
<ul>
|
265 |
|
266 |
<?php
|
267 |
}
|
268 |
|
269 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
|
271 |
|
272 |
// show/hide
|
273 |
function share_show_hide_cb() {
|
274 |
-
|
275 |
-
$dbrow = 'ht_ctc_share';
|
276 |
$options = get_option('ht_ctc_share');
|
|
|
|
|
277 |
|
278 |
include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-show-hide.php';
|
279 |
-
|
280 |
}
|
281 |
|
282 |
|
283 |
function share_shortcode_cb() {
|
284 |
?>
|
285 |
-
<p class="description"
|
286 |
<?php
|
287 |
}
|
288 |
|
@@ -307,7 +205,7 @@ class HT_CTC_Admin_Share_Page {
|
|
307 |
|
308 |
foreach ($input as $key => $value) {
|
309 |
|
310 |
-
if ( 'side_1_value' == $key ) {
|
311 |
if ( is_numeric($input[$key]) ) {
|
312 |
$input[$key] = $input[$key] . 'px';
|
313 |
}
|
@@ -315,15 +213,7 @@ class HT_CTC_Admin_Share_Page {
|
|
315 |
$input[$key] = '0px';
|
316 |
}
|
317 |
$new_input[$key] = sanitize_text_field( $input[$key] );
|
318 |
-
}
|
319 |
-
if ( is_numeric($input[$key]) ) {
|
320 |
-
$input[$key] = $input[$key] . 'px';
|
321 |
-
}
|
322 |
-
if ( '' == $input[$key] ) {
|
323 |
-
$input[$key] = '0px';
|
324 |
-
}
|
325 |
-
$new_input[$key] = sanitize_text_field( $input[$key] );
|
326 |
-
} elseif( isset( $input[$key] ) ) {
|
327 |
$new_input[$key] = sanitize_text_field( $input[$key] );
|
328 |
}
|
329 |
|
@@ -333,6 +223,13 @@ class HT_CTC_Admin_Share_Page {
|
|
333 |
// }
|
334 |
}
|
335 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
336 |
|
337 |
return $new_input;
|
338 |
}
|
66 |
|
67 |
add_settings_section( 'ht_ctc_main_page_settings_sections_add', '', array( $this, 'main_settings_section_cb' ), 'ht_ctc_share_page_settings_sections_do' );
|
68 |
|
69 |
+
add_settings_field( 'share_text', __( 'Share Text', 'click-to-chat-for-whatsapp'), array( $this, 'share_text_cb' ), 'ht_ctc_share_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
|
70 |
+
add_settings_field( 'share_cta', __( 'Call to Action', 'click-to-chat-for-whatsapp'), array( $this, 'share_cta_cb' ), 'ht_ctc_share_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
|
71 |
+
add_settings_field( 'share_ctc_webandapi', __( 'Web WhatsApp', 'click-to-chat-for-whatsapp'), array( $this, 'share_ctc_webandapi_cb' ), 'ht_ctc_share_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
|
72 |
+
|
73 |
+
add_settings_field( 'share_ctc_desktop', __( 'Desktop', 'click-to-chat-for-whatsapp'), array( $this, 'share_ctc_desktop_cb' ), 'ht_ctc_share_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
|
74 |
+
add_settings_field( 'share_ctc_mobile', __( 'Mobile', 'click-to-chat-for-whatsapp'), array( $this, 'share_ctc_mobile_cb' ), 'ht_ctc_share_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
|
75 |
+
|
76 |
+
add_settings_field( 'share_show_hide', __( 'Show/Hide', 'click-to-chat-for-whatsapp'), array( $this, 'share_show_hide_cb' ), 'ht_ctc_share_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
|
77 |
add_settings_field( 'share_shortcode', '', array( $this, 'share_shortcode_cb' ), 'ht_ctc_share_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
|
78 |
|
79 |
|
81 |
|
82 |
public function main_settings_section_cb() {
|
83 |
?>
|
84 |
+
<h1><?php _e( 'Share', 'click-to-chat-for-whatsapp' ); ?></h1>
|
85 |
<?php
|
86 |
}
|
87 |
|
89 |
// WhatsApp share ID.
|
90 |
function share_text_cb() {
|
91 |
$options = get_option('ht_ctc_share');
|
92 |
+
$value = ( isset( $options['share_text']) ) ? esc_attr( $options['share_text'] ) : '';
|
93 |
?>
|
94 |
<div class="row">
|
95 |
<div class="input-field col s12">
|
96 |
<input name="ht_ctc_share[share_text]" value="<?php echo $value ?>" id="whatsapp_share_text" type="text" class="input-margin">
|
97 |
+
<label for="whatsapp_share_text"><?php _e( 'Share Text', 'click-to-chat-for-whatsapp' ); ?></label>
|
98 |
+
<p class="description"><?php _e( "Placeholder {{url}} returns current webpage URL", 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/share-text/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> ) </p>
|
99 |
</div>
|
100 |
</div>
|
101 |
<?php
|
104 |
// call to action
|
105 |
function share_cta_cb() {
|
106 |
$options = get_option('ht_ctc_share');
|
107 |
+
$value = ( isset( $options['call_to_action']) ) ? esc_attr( $options['call_to_action'] ) : '';
|
108 |
?>
|
109 |
<div class="row">
|
110 |
<div class="input-field col s12">
|
111 |
<input name="ht_ctc_share[call_to_action]" value="<?php echo $value ?>" id="call_to_action" type="text" class="input-margin">
|
112 |
+
<label for="call_to_action"><?php _e( 'Call to Action', 'click-to-chat-for-whatsapp' ); ?></label>
|
113 |
+
<p class="description"><?php _e( 'Text that appears along with WhatsApp icon/button', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/call-to-action/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
|
114 |
</div>
|
115 |
</div>
|
116 |
<?php
|
117 |
}
|
118 |
|
119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
// If checked web / api whatsapp link. If unchecked wa.me links
|
121 |
function share_ctc_webandapi_cb() {
|
122 |
$options = get_option('ht_ctc_share');
|
123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
if ( isset( $options['webandapi'] ) ) {
|
125 |
?>
|
126 |
<p>
|
127 |
<label>
|
128 |
<input name="ht_ctc_share[webandapi]" type="checkbox" value="1" <?php checked( $options['webandapi'], 1 ); ?> id="webandapi" />
|
129 |
+
<span><?php _e( 'Web WhatsApp on Desktop', 'click-to-chat-for-whatsapp' ); ?></span>
|
130 |
</label>
|
131 |
</p>
|
132 |
<?php
|
135 |
<p>
|
136 |
<label>
|
137 |
<input name="ht_ctc_share[webandapi]" type="checkbox" value="1" id="webandapi" />
|
138 |
+
<span><?php _e( 'Web WhatsApp on Desktop', 'click-to-chat-for-whatsapp' ); ?></span>
|
139 |
</label>
|
140 |
</p>
|
141 |
<?php
|
142 |
}
|
143 |
?>
|
144 |
+
<p class="description"><?php _e( 'If checked opens Web.WhatsApp directly on Desktop and in mobile WhatsApp App', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/web-whatsapp/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
|
145 |
<br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
|
147 |
<?php
|
148 |
}
|
149 |
|
150 |
|
151 |
+
// Desktop
|
152 |
+
function share_ctc_desktop_cb() {
|
153 |
+
$options = get_option('ht_ctc_share');
|
154 |
+
$dbrow = 'ht_ctc_share';
|
155 |
+
$type = 'share';
|
156 |
+
|
157 |
+
include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-desktop.php';
|
158 |
+
}
|
159 |
+
|
160 |
+
|
161 |
+
// Mobile
|
162 |
+
function share_ctc_mobile_cb() {
|
163 |
+
$options = get_option('ht_ctc_share');
|
164 |
+
$dbrow = 'ht_ctc_share';
|
165 |
+
$type = 'share';
|
166 |
+
|
167 |
+
include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-mobile.php';
|
168 |
+
}
|
169 |
|
170 |
|
171 |
// show/hide
|
172 |
function share_show_hide_cb() {
|
|
|
|
|
173 |
$options = get_option('ht_ctc_share');
|
174 |
+
$dbrow = 'ht_ctc_share';
|
175 |
+
$type = 'share';
|
176 |
|
177 |
include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-show-hide.php';
|
|
|
178 |
}
|
179 |
|
180 |
|
181 |
function share_shortcode_cb() {
|
182 |
?>
|
183 |
+
<p class="description"><?php _e( 'Shortcodes for Share', 'click-to-chat-for-whatsapp' ); ?>: [ht-ctc-share] - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/shortcodes-share"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a></p>
|
184 |
<?php
|
185 |
}
|
186 |
|
205 |
|
206 |
foreach ($input as $key => $value) {
|
207 |
|
208 |
+
if ( 'side_1_value' == $key || 'side_2_value' == $key || 'mobile_side_1_value' == $key || 'mobile_side_2_value' == $key ) {
|
209 |
if ( is_numeric($input[$key]) ) {
|
210 |
$input[$key] = $input[$key] . 'px';
|
211 |
}
|
213 |
$input[$key] = '0px';
|
214 |
}
|
215 |
$new_input[$key] = sanitize_text_field( $input[$key] );
|
216 |
+
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
$new_input[$key] = sanitize_text_field( $input[$key] );
|
218 |
}
|
219 |
|
223 |
// }
|
224 |
}
|
225 |
|
226 |
+
// l10n
|
227 |
+
foreach ($input as $key => $value) {
|
228 |
+
if ( 'share_text' == $key || 'call_to_action' == $key ) {
|
229 |
+
do_action( 'wpml_register_single_string', 'Click to Chat for WhatsApp', $key.'__share', $input[$key] );
|
230 |
+
}
|
231 |
+
}
|
232 |
+
|
233 |
|
234 |
return $new_input;
|
235 |
}
|
new/admin/class-ht-ctc-db.php
CHANGED
@@ -53,28 +53,34 @@ class HT_CTC_DB {
|
|
53 |
}
|
54 |
|
55 |
|
56 |
-
|
57 |
/**
|
58 |
* table name: "ht_ctc_othersettings"
|
59 |
*
|
60 |
* other settings
|
61 |
*
|
62 |
* checkboxes ..
|
|
|
|
|
63 |
* fb_analytics facebook analytics using js sdk
|
64 |
*
|
65 |
*/
|
66 |
public function ht_ctc_othersettings() {
|
67 |
|
68 |
$values = array(
|
69 |
-
'hello' => '
|
70 |
);
|
71 |
|
72 |
$ht_ctc_main_options = get_option('ht_ctc_main_options');
|
73 |
if ( isset ( $ht_ctc_main_options['fb_analytics'] ) ) {
|
74 |
-
$
|
75 |
-
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
|
|
78 |
}
|
79 |
|
80 |
$db_values = get_option( 'ht_ctc_othersettings', array() );
|
@@ -92,9 +98,7 @@ class HT_CTC_DB {
|
|
92 |
* enable options ..
|
93 |
*
|
94 |
* checkboxes ..
|
95 |
-
*
|
96 |
-
* enable_group enable_group_chat
|
97 |
-
* enable_share enable_share
|
98 |
*
|
99 |
* google_analytics enable Google analytics
|
100 |
* fb_pixel enable Facebook Pixel
|
@@ -103,7 +107,7 @@ class HT_CTC_DB {
|
|
103 |
public function ht_ctc_main_options() {
|
104 |
|
105 |
$values = array(
|
106 |
-
'
|
107 |
);
|
108 |
|
109 |
$db_values = get_option( 'ht_ctc_main_options', array() );
|
@@ -122,11 +126,6 @@ class HT_CTC_DB {
|
|
122 |
*
|
123 |
* checkboxes ..
|
124 |
* hide/show options ..
|
125 |
-
*
|
126 |
-
* cache_issue
|
127 |
-
*
|
128 |
-
* enable_share
|
129 |
-
* enable_group
|
130 |
*
|
131 |
* webandapi if checked ? web/api.whatsapp(mobile,desktop) : wa.me
|
132 |
*
|
@@ -137,12 +136,11 @@ class HT_CTC_DB {
|
|
137 |
'number' => '',
|
138 |
'pre_filled' => '',
|
139 |
'call_to_action' => 'WhatsApp us',
|
140 |
-
'style_desktop' => '
|
141 |
'style_mobile' => '2',
|
142 |
|
143 |
'side_1' => 'bottom',
|
144 |
'side_1_value' => '10px',
|
145 |
-
|
146 |
'side_2' => 'right',
|
147 |
'side_2_value' => '10px',
|
148 |
|
@@ -154,6 +152,19 @@ class HT_CTC_DB {
|
|
154 |
|
155 |
);
|
156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
$db_values = get_option( 'ht_ctc_chat_options', array() );
|
158 |
$update_values = array_merge($values, $db_values);
|
159 |
update_option('ht_ctc_chat_options', $update_values);
|
@@ -175,21 +186,14 @@ class HT_CTC_DB {
|
|
175 |
'group_id' => '',
|
176 |
'call_to_action' => 'WhatsApp Group',
|
177 |
|
178 |
-
'style_desktop' => '
|
179 |
'style_mobile' => '2',
|
180 |
|
181 |
'side_1' => 'bottom',
|
182 |
'side_1_value' => '10px',
|
183 |
-
|
184 |
'side_2' => 'left',
|
185 |
'side_2_value' => '10px',
|
186 |
|
187 |
-
'side_1_mobile' => 'bottom',
|
188 |
-
'side_1_mobile_value' => '10px',
|
189 |
-
|
190 |
-
'side_2_mobile' => 'left',
|
191 |
-
'side_2_mobile_value' => '10px',
|
192 |
-
|
193 |
'show_or_hide' => 'hide',
|
194 |
'list_hideon_pages' => '',
|
195 |
'list_hideon_cat' => '',
|
@@ -198,6 +202,19 @@ class HT_CTC_DB {
|
|
198 |
|
199 |
);
|
200 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
$db_values = get_option( 'ht_ctc_group', array() );
|
202 |
$update_values = array_merge($values, $db_values);
|
203 |
update_option('ht_ctc_group', $update_values);
|
@@ -226,16 +243,9 @@ class HT_CTC_DB {
|
|
226 |
|
227 |
'side_1' => 'top',
|
228 |
'side_1_value' => '10px',
|
229 |
-
|
230 |
'side_2' => 'right',
|
231 |
'side_2_value' => '10px',
|
232 |
|
233 |
-
'side_1_mobile' => 'top',
|
234 |
-
'side_1_mobile_value' => '10px',
|
235 |
-
|
236 |
-
'side_2_mobile' => 'right',
|
237 |
-
'side_2_mobile_value' => '10px',
|
238 |
-
|
239 |
'show_or_hide' => 'hide',
|
240 |
'list_hideon_pages' => '',
|
241 |
'list_hideon_cat' => '',
|
@@ -243,6 +253,18 @@ class HT_CTC_DB {
|
|
243 |
'list_showon_cat' => '',
|
244 |
);
|
245 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
$db_values = get_option( 'ht_ctc_share', array() );
|
247 |
$update_values = array_merge($values, $db_values);
|
248 |
update_option('ht_ctc_share', $update_values);
|
@@ -310,21 +332,6 @@ class HT_CTC_DB {
|
|
310 |
|
311 |
$interface = 'yes';
|
312 |
|
313 |
-
$first_version = get_option('ht_ctc_one_time');
|
314 |
-
if ( isset ( $first_version['first_version'] ) ) {
|
315 |
-
if ( '1.8' == $first_version['first_version'] || '1.8.1' == $first_version['first_version'] || '1.8.2' == $first_version['first_version'] ) {
|
316 |
-
$ccw_options = get_option('ccw_options');
|
317 |
-
if ( isset ( $ccw_options['number'] ) ) {
|
318 |
-
if ( isset ( $ccw_options['switch_to_new'] ) ) {
|
319 |
-
$interface = 'yes';
|
320 |
-
} else {
|
321 |
-
$interface = 'no';
|
322 |
-
}
|
323 |
-
}
|
324 |
-
}
|
325 |
-
}
|
326 |
-
|
327 |
-
// plugin details
|
328 |
$values = array(
|
329 |
'interface' => $interface,
|
330 |
);
|
@@ -395,6 +402,9 @@ public function ht_ctc_s2() {
|
|
395 |
/**
|
396 |
* name: ht_ctc_s3
|
397 |
*
|
|
|
|
|
|
|
398 |
* Style-3
|
399 |
* icon
|
400 |
*/
|
@@ -402,10 +412,23 @@ public function ht_ctc_s3() {
|
|
402 |
|
403 |
$style_3 = array(
|
404 |
|
405 |
-
'
|
|
|
406 |
|
407 |
);
|
408 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
409 |
$db_values = get_option( 'ht_ctc_s3', array() );
|
410 |
$update_values = array_merge($style_3, $db_values);
|
411 |
update_option('ht_ctc_s3', $update_values);
|
@@ -422,23 +445,13 @@ public function ht_ctc_s3() {
|
|
422 |
*/
|
423 |
public function ht_ctc_s4() {
|
424 |
|
425 |
-
// if first installed version is 1.8 - then drop and add the style_4
|
426 |
-
$first_version = get_option('ht_ctc_one_time');
|
427 |
-
if ( isset ( $first_version['first_version'] ) ) {
|
428 |
-
if ( '1.8' == $first_version['first_version'] || '1.8.1' == $first_version['first_version'] || '1.8.0.1' == $first_version['first_version'] ) {
|
429 |
-
$s4 = get_option('ht_ctc_s4');
|
430 |
-
if ( !is_array( $s4 ) ) {
|
431 |
-
delete_option('ht_ctc_s4');
|
432 |
-
}
|
433 |
-
}
|
434 |
-
}
|
435 |
-
|
436 |
$style_4 = array(
|
437 |
|
438 |
's4_text_color' => '#7f7d7d',
|
439 |
's4_bg_color' => '#e4e4e4',
|
440 |
's4_img_url' => '',
|
441 |
-
|
|
|
442 |
);
|
443 |
|
444 |
$db_values = get_option( 'ht_ctc_s4', array() );
|
53 |
}
|
54 |
|
55 |
|
56 |
+
|
57 |
/**
|
58 |
* table name: "ht_ctc_othersettings"
|
59 |
*
|
60 |
* other settings
|
61 |
*
|
62 |
* checkboxes ..
|
63 |
+
* enable_group enable_group chat
|
64 |
+
* enable_share enable_share
|
65 |
* fb_analytics facebook analytics using js sdk
|
66 |
*
|
67 |
*/
|
68 |
public function ht_ctc_othersettings() {
|
69 |
|
70 |
$values = array(
|
71 |
+
'hello' => 'world',
|
72 |
);
|
73 |
|
74 |
$ht_ctc_main_options = get_option('ht_ctc_main_options');
|
75 |
if ( isset ( $ht_ctc_main_options['fb_analytics'] ) ) {
|
76 |
+
$values['fb_analytics'] = '1';
|
77 |
+
}
|
78 |
+
|
79 |
+
if ( isset ( $ht_ctc_main_options['enable_group'] ) ) {
|
80 |
+
$values['enable_group'] = '1';
|
81 |
+
}
|
82 |
+
if ( isset ( $ht_ctc_main_options['enable_share'] ) ) {
|
83 |
+
$values['enable_share'] = '1';
|
84 |
}
|
85 |
|
86 |
$db_values = get_option( 'ht_ctc_othersettings', array() );
|
98 |
* enable options ..
|
99 |
*
|
100 |
* checkboxes ..
|
101 |
+
*
|
|
|
|
|
102 |
*
|
103 |
* google_analytics enable Google analytics
|
104 |
* fb_pixel enable Facebook Pixel
|
107 |
public function ht_ctc_main_options() {
|
108 |
|
109 |
$values = array(
|
110 |
+
'hello' => 'world',
|
111 |
);
|
112 |
|
113 |
$db_values = get_option( 'ht_ctc_main_options', array() );
|
126 |
*
|
127 |
* checkboxes ..
|
128 |
* hide/show options ..
|
|
|
|
|
|
|
|
|
|
|
129 |
*
|
130 |
* webandapi if checked ? web/api.whatsapp(mobile,desktop) : wa.me
|
131 |
*
|
136 |
'number' => '',
|
137 |
'pre_filled' => '',
|
138 |
'call_to_action' => 'WhatsApp us',
|
139 |
+
'style_desktop' => '2',
|
140 |
'style_mobile' => '2',
|
141 |
|
142 |
'side_1' => 'bottom',
|
143 |
'side_1_value' => '10px',
|
|
|
144 |
'side_2' => 'right',
|
145 |
'side_2_value' => '10px',
|
146 |
|
152 |
|
153 |
);
|
154 |
|
155 |
+
$options = get_option('ht_ctc_chat_options');
|
156 |
+
// mobile position if not set
|
157 |
+
if ( !isset($options['mobile_side_1_value']) && !isset($options['mobile_side_2_value']) ) {
|
158 |
+
$mobile_values = array(
|
159 |
+
'mobile_side_1' => ( isset( $options['side_1']) ) ? esc_attr( $options['side_1'] ) : 'bottom',
|
160 |
+
'mobile_side_1_value' => ( isset( $options['side_1_value'])) ? esc_attr( $options['side_1_value'] ) : '10px',
|
161 |
+
'mobile_side_2' => ( isset( $options['side_2']) ) ? esc_attr( $options['side_2'] ) : 'right',
|
162 |
+
'mobile_side_2_value' => ( isset( $options['side_2_value'])) ? esc_attr( $options['side_2_value'] ) : '10px',
|
163 |
+
);
|
164 |
+
$values = array_merge($values, $mobile_values);
|
165 |
+
}
|
166 |
+
|
167 |
+
|
168 |
$db_values = get_option( 'ht_ctc_chat_options', array() );
|
169 |
$update_values = array_merge($values, $db_values);
|
170 |
update_option('ht_ctc_chat_options', $update_values);
|
186 |
'group_id' => '',
|
187 |
'call_to_action' => 'WhatsApp Group',
|
188 |
|
189 |
+
'style_desktop' => '4',
|
190 |
'style_mobile' => '2',
|
191 |
|
192 |
'side_1' => 'bottom',
|
193 |
'side_1_value' => '10px',
|
|
|
194 |
'side_2' => 'left',
|
195 |
'side_2_value' => '10px',
|
196 |
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
'show_or_hide' => 'hide',
|
198 |
'list_hideon_pages' => '',
|
199 |
'list_hideon_cat' => '',
|
202 |
|
203 |
);
|
204 |
|
205 |
+
$options = get_option('ht_ctc_group');
|
206 |
+
// mobile position if not set
|
207 |
+
if ( !isset($options['mobile_side_1_value']) && !isset($options['mobile_side_2_value']) ) {
|
208 |
+
$mobile_values = array(
|
209 |
+
'mobile_side_1' => ( isset( $options['side_1']) ) ? esc_attr( $options['side_1'] ) : 'bottom',
|
210 |
+
'mobile_side_1_value' => ( isset( $options['side_1_value'])) ? esc_attr( $options['side_1_value'] ) : '10px',
|
211 |
+
'mobile_side_2' => ( isset( $options['side_2']) ) ? esc_attr( $options['side_2'] ) : 'left',
|
212 |
+
'mobile_side_2_value' => ( isset( $options['side_2_value'])) ? esc_attr( $options['side_2_value'] ) : '10px',
|
213 |
+
);
|
214 |
+
$values = array_merge($values, $mobile_values);
|
215 |
+
}
|
216 |
+
|
217 |
+
|
218 |
$db_values = get_option( 'ht_ctc_group', array() );
|
219 |
$update_values = array_merge($values, $db_values);
|
220 |
update_option('ht_ctc_group', $update_values);
|
243 |
|
244 |
'side_1' => 'top',
|
245 |
'side_1_value' => '10px',
|
|
|
246 |
'side_2' => 'right',
|
247 |
'side_2_value' => '10px',
|
248 |
|
|
|
|
|
|
|
|
|
|
|
|
|
249 |
'show_or_hide' => 'hide',
|
250 |
'list_hideon_pages' => '',
|
251 |
'list_hideon_cat' => '',
|
253 |
'list_showon_cat' => '',
|
254 |
);
|
255 |
|
256 |
+
$options = get_option('ht_ctc_share');
|
257 |
+
// mobile position if not set
|
258 |
+
if ( !isset($options['mobile_side_1_value']) && !isset($options['mobile_side_2_value']) ) {
|
259 |
+
$mobile_values = array(
|
260 |
+
'mobile_side_1' => ( isset( $options['side_1']) ) ? esc_attr( $options['side_1'] ) : 'top',
|
261 |
+
'mobile_side_1_value' => ( isset( $options['side_1_value'])) ? esc_attr( $options['side_1_value'] ) : '10px',
|
262 |
+
'mobile_side_2' => ( isset( $options['side_2']) ) ? esc_attr( $options['side_2'] ) : 'right',
|
263 |
+
'mobile_side_2_value' => ( isset( $options['side_2_value'])) ? esc_attr( $options['side_2_value'] ) : '10px',
|
264 |
+
);
|
265 |
+
$values = array_merge($values, $mobile_values);
|
266 |
+
}
|
267 |
+
|
268 |
$db_values = get_option( 'ht_ctc_share', array() );
|
269 |
$update_values = array_merge($values, $db_values);
|
270 |
update_option('ht_ctc_share', $update_values);
|
332 |
|
333 |
$interface = 'yes';
|
334 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
$values = array(
|
336 |
'interface' => $interface,
|
337 |
);
|
402 |
/**
|
403 |
* name: ht_ctc_s3
|
404 |
*
|
405 |
+
* s3_type - simple / extend
|
406 |
+
* simple - only image size setting.
|
407 |
+
*
|
408 |
* Style-3
|
409 |
* icon
|
410 |
*/
|
412 |
|
413 |
$style_3 = array(
|
414 |
|
415 |
+
's3_bg_color' => '#25D366',
|
416 |
+
's3_bg_color_hover' => '#25D366',
|
417 |
|
418 |
);
|
419 |
|
420 |
+
// =v2.11+ -> s3_type - extend, img size 40px else 50px
|
421 |
+
$options = get_option('ht_ctc_s3');
|
422 |
+
if ( isset ( $options['s3_img_size'] ) && !isset ( $options['s3_type'] ) ) {
|
423 |
+
$style_3['s3_img_size'] = '50px';
|
424 |
+
$style_3['s3_type'] = 'simple';
|
425 |
+
$style_3['s3_padding'] = '20px';
|
426 |
+
} else {
|
427 |
+
$style_3['s3_img_size'] = '40px';
|
428 |
+
$style_3['s3_type'] = 'extend';
|
429 |
+
$style_3['s3_padding'] = '16px';
|
430 |
+
}
|
431 |
+
|
432 |
$db_values = get_option( 'ht_ctc_s3', array() );
|
433 |
$update_values = array_merge($style_3, $db_values);
|
434 |
update_option('ht_ctc_s3', $update_values);
|
445 |
*/
|
446 |
public function ht_ctc_s4() {
|
447 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
448 |
$style_4 = array(
|
449 |
|
450 |
's4_text_color' => '#7f7d7d',
|
451 |
's4_bg_color' => '#e4e4e4',
|
452 |
's4_img_url' => '',
|
453 |
+
's4_img_position' => 'left',
|
454 |
+
's4_img_size' => '32px',
|
455 |
);
|
456 |
|
457 |
$db_values = get_option( 'ht_ctc_s4', array() );
|
new/class-ht-ctc.php
CHANGED
@@ -5,21 +5,16 @@
|
|
5 |
* Include files - admin - front end
|
6 |
* add hooks
|
7 |
*
|
8 |
-
* added variable to declare other instance if needed
|
9 |
-
* ( in some cases in this plugin, using static methods and calling with out creating instance )
|
10 |
-
*
|
11 |
* @package CTC
|
12 |
* @since 2.0
|
13 |
*/
|
14 |
|
15 |
-
|
16 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
17 |
|
18 |
if ( ! class_exists( 'HT_CTC' ) ) :
|
19 |
|
20 |
class HT_CTC {
|
21 |
|
22 |
-
|
23 |
/**
|
24 |
* singleton instance
|
25 |
*
|
@@ -27,7 +22,6 @@ class HT_CTC {
|
|
27 |
*/
|
28 |
private static $instance = null;
|
29 |
|
30 |
-
|
31 |
/**
|
32 |
* wp_is_mobile - if true then yes, else no
|
33 |
*
|
@@ -35,7 +29,6 @@ class HT_CTC {
|
|
35 |
*/
|
36 |
public $device_type;
|
37 |
|
38 |
-
|
39 |
/**
|
40 |
* instance of HT_CTC_Values
|
41 |
*
|
@@ -45,7 +38,6 @@ class HT_CTC {
|
|
45 |
*/
|
46 |
public $values = null;
|
47 |
|
48 |
-
|
49 |
/**
|
50 |
* main instance - HT_CTC
|
51 |
*
|
@@ -59,7 +51,6 @@ class HT_CTC {
|
|
59 |
return self::$instance;
|
60 |
}
|
61 |
|
62 |
-
|
63 |
public function __clone() {
|
64 |
wc_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'click-to-chat-for-whatsapp' ), '1.0' );
|
65 |
}
|
@@ -68,41 +59,16 @@ class HT_CTC {
|
|
68 |
wc_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'click-to-chat-for-whatsapp' ), '1.0' );
|
69 |
}
|
70 |
|
71 |
-
|
72 |
-
|
73 |
/**
|
74 |
* constructor
|
75 |
-
*
|
76 |
-
*
|
77 |
*/
|
78 |
public function __construct() {
|
79 |
-
$this->define_constants();
|
80 |
-
|
81 |
$this->basic();
|
82 |
-
|
83 |
$this->includes();
|
84 |
$this->hooks();
|
85 |
}
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
/**
|
91 |
-
* Define Constants
|
92 |
-
*
|
93 |
-
* @return void
|
94 |
-
*/
|
95 |
-
private function define_constants() {
|
96 |
-
|
97 |
-
$this->define( 'HT_CTC_WP_MIN_VERSION', '4.6' );
|
98 |
-
// $this->define( 'HT_CTC_PLUGIN_DIR', plugin_dir_path( HT_CTC_PLUGIN_FILE ) );
|
99 |
-
$this->define( 'HT_CTC_PLUGIN_BASENAME', plugin_basename( HT_CTC_PLUGIN_FILE ) );
|
100 |
-
$this->define( 'HT_CTC_BLOG_NAME', get_bloginfo('name') );
|
101 |
-
|
102 |
-
}
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
|
107 |
/**
|
108 |
* add the basic things
|
@@ -121,50 +87,32 @@ class HT_CTC {
|
|
121 |
|
122 |
$this->device_type = new HT_CTC_IsMobile();
|
123 |
$this->values = new HT_CTC_Values();
|
124 |
-
|
125 |
-
}
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
/**
|
131 |
-
* @uses this->define_constants
|
132 |
-
*
|
133 |
-
* @param string $name Constant name
|
134 |
-
* @param string.. $value Constant value
|
135 |
-
*/
|
136 |
-
private function define( $name, $value ) {
|
137 |
-
if ( ! defined( $name ) ) {
|
138 |
-
define( $name, $value );
|
139 |
-
}
|
140 |
}
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
|
145 |
/**
|
146 |
* include plugin file
|
147 |
*/
|
148 |
private function includes() {
|
149 |
|
150 |
-
// include in admin and front pages
|
151 |
-
include_once HT_CTC_PLUGIN_DIR .'new/inc/class-ht-ctc-register.php';
|
152 |
-
|
153 |
// is_admin ? include file to admin area : include files to non-admin area
|
154 |
if ( is_admin() ) {
|
|
|
|
|
155 |
include_once HT_CTC_PLUGIN_DIR . 'new/admin/admin.php';
|
156 |
} else {
|
157 |
-
|
158 |
-
|
159 |
include_once HT_CTC_PLUGIN_DIR . 'new/inc/class-ht-ctc-main.php';
|
160 |
-
|
161 |
-
// scripts
|
162 |
include_once HT_CTC_PLUGIN_DIR . 'new/inc/commons/class-ht-ctc-scripts.php';
|
163 |
-
|
164 |
}
|
165 |
-
}
|
166 |
-
|
167 |
|
|
|
|
|
|
|
|
|
|
|
168 |
|
169 |
/**
|
170 |
* Register hooks - when plugin activate, deactivate, uninstall
|
@@ -174,10 +122,6 @@ class HT_CTC {
|
|
174 |
*/
|
175 |
private function hooks() {
|
176 |
|
177 |
-
register_activation_hook( __FILE__, array( 'HT_CTC_Register', 'activate' ) );
|
178 |
-
register_deactivation_hook( __FILE__, array( 'HT_CTC_Register', 'deactivate' ) );
|
179 |
-
register_uninstall_hook(__FILE__, array( 'HT_CTC_Register', 'uninstall' ) );
|
180 |
-
|
181 |
// initilaze classes
|
182 |
if ( ! is_admin() ) {
|
183 |
add_action( 'init', array( $this, 'init' ), 0 );
|
@@ -196,26 +140,15 @@ class HT_CTC {
|
|
196 |
|
197 |
}
|
198 |
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
/**
|
203 |
* create instance
|
204 |
* @uses this->hooks() - using init hook - priority 0
|
205 |
*/
|
206 |
public function init() {
|
207 |
-
|
208 |
// $this->values = new HT_CTC_Values();
|
209 |
-
|
210 |
// $this->device_type = new HT_CTC_IsMobile();
|
211 |
-
|
212 |
-
// $this->floating_style = new HT_CTC_Floating_Style();
|
213 |
-
// $this->floating_style = new HT_CTC_Chat();
|
214 |
-
|
215 |
}
|
216 |
|
217 |
-
|
218 |
-
|
219 |
}
|
220 |
|
221 |
endif; // END class_exists check
|
5 |
* Include files - admin - front end
|
6 |
* add hooks
|
7 |
*
|
|
|
|
|
|
|
8 |
* @package CTC
|
9 |
* @since 2.0
|
10 |
*/
|
11 |
|
|
|
12 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
|
14 |
if ( ! class_exists( 'HT_CTC' ) ) :
|
15 |
|
16 |
class HT_CTC {
|
17 |
|
|
|
18 |
/**
|
19 |
* singleton instance
|
20 |
*
|
22 |
*/
|
23 |
private static $instance = null;
|
24 |
|
|
|
25 |
/**
|
26 |
* wp_is_mobile - if true then yes, else no
|
27 |
*
|
29 |
*/
|
30 |
public $device_type;
|
31 |
|
|
|
32 |
/**
|
33 |
* instance of HT_CTC_Values
|
34 |
*
|
38 |
*/
|
39 |
public $values = null;
|
40 |
|
|
|
41 |
/**
|
42 |
* main instance - HT_CTC
|
43 |
*
|
51 |
return self::$instance;
|
52 |
}
|
53 |
|
|
|
54 |
public function __clone() {
|
55 |
wc_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'click-to-chat-for-whatsapp' ), '1.0' );
|
56 |
}
|
59 |
wc_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'click-to-chat-for-whatsapp' ), '1.0' );
|
60 |
}
|
61 |
|
|
|
|
|
62 |
/**
|
63 |
* constructor
|
64 |
+
* basic(), includes() -> include files
|
65 |
+
* hooks() -> run hooks
|
66 |
*/
|
67 |
public function __construct() {
|
|
|
|
|
68 |
$this->basic();
|
|
|
69 |
$this->includes();
|
70 |
$this->hooks();
|
71 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
|
73 |
/**
|
74 |
* add the basic things
|
87 |
|
88 |
$this->device_type = new HT_CTC_IsMobile();
|
89 |
$this->values = new HT_CTC_Values();
|
90 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
}
|
|
|
|
|
|
|
92 |
|
93 |
/**
|
94 |
* include plugin file
|
95 |
*/
|
96 |
private function includes() {
|
97 |
|
|
|
|
|
|
|
98 |
// is_admin ? include file to admin area : include files to non-admin area
|
99 |
if ( is_admin() ) {
|
100 |
+
// admin
|
101 |
+
// admin main file
|
102 |
include_once HT_CTC_PLUGIN_DIR . 'new/admin/admin.php';
|
103 |
} else {
|
104 |
+
// front
|
105 |
+
// main file
|
106 |
include_once HT_CTC_PLUGIN_DIR . 'new/inc/class-ht-ctc-main.php';
|
107 |
+
// scripts
|
|
|
108 |
include_once HT_CTC_PLUGIN_DIR . 'new/inc/commons/class-ht-ctc-scripts.php';
|
|
|
109 |
}
|
|
|
|
|
110 |
|
111 |
+
// admin and front
|
112 |
+
// woo init
|
113 |
+
include_once HT_CTC_PLUGIN_DIR . 'new/tools/woo/ht-ctc-woo.php';
|
114 |
+
|
115 |
+
}
|
116 |
|
117 |
/**
|
118 |
* Register hooks - when plugin activate, deactivate, uninstall
|
122 |
*/
|
123 |
private function hooks() {
|
124 |
|
|
|
|
|
|
|
|
|
125 |
// initilaze classes
|
126 |
if ( ! is_admin() ) {
|
127 |
add_action( 'init', array( $this, 'init' ), 0 );
|
140 |
|
141 |
}
|
142 |
|
|
|
|
|
|
|
143 |
/**
|
144 |
* create instance
|
145 |
* @uses this->hooks() - using init hook - priority 0
|
146 |
*/
|
147 |
public function init() {
|
|
|
148 |
// $this->values = new HT_CTC_Values();
|
|
|
149 |
// $this->device_type = new HT_CTC_IsMobile();
|
|
|
|
|
|
|
|
|
150 |
}
|
151 |
|
|
|
|
|
152 |
}
|
153 |
|
154 |
endif; // END class_exists check
|
new/inc/assets/css/font.css
CHANGED
@@ -1,35 +1 @@
|
|
1 |
-
@font-face {
|
2 |
-
font-family: 'ccw';
|
3 |
-
src: url(../fonts/ccw.eot);
|
4 |
-
src: url(../fonts/ccw.eot#iefix) format('embedded-opentype'),
|
5 |
-
url(../fonts/ccw.ttf) format('truetype'),
|
6 |
-
url(../fonts/ccw.woff) format('woff'),
|
7 |
-
url(../fonts/ccw.svg#ccw) format('svg');
|
8 |
-
font-weight: normal;
|
9 |
-
font-style: normal;
|
10 |
-
}
|
11 |
-
|
12 |
-
.ctc-icon {
|
13 |
-
/* use !important to prevent issues with browser extensions that change fonts */
|
14 |
-
font-family: 'ccw' !important;
|
15 |
-
speak: none;
|
16 |
-
font-style: normal;
|
17 |
-
font-weight: normal;
|
18 |
-
font-variant: normal;
|
19 |
-
text-transform: none;
|
20 |
-
line-height: 1;
|
21 |
-
|
22 |
-
/* Better Font Rendering =========== */
|
23 |
-
-webkit-font-smoothing: antialiased;
|
24 |
-
-moz-osx-font-smoothing: grayscale;
|
25 |
-
}
|
26 |
-
|
27 |
-
.ctc-icon-whatsapp2:before {
|
28 |
-
content: "\E902";
|
29 |
-
}
|
30 |
-
|
31 |
-
.ctc-icon-whatsapp:before {
|
32 |
-
content: "\ea93";
|
33 |
-
}
|
34 |
-
|
35 |
-
/* new: s7,8 */
|
1 |
+
@font-face{font-family:ccw;src:url(../fonts/ccw.eot);src:url(../fonts/ccw.eot#iefix) format('embedded-opentype'),url(../fonts/ccw.ttf) format('truetype'),url(../fonts/ccw.woff) format('woff'),url(../fonts/ccw.svg#ccw) format('svg');font-weight:400;font-style:normal}.ctc-icon{font-family:ccw!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ctc-icon-whatsapp2:before{content:"\E902"}.ctc-icon-whatsapp:before{content:"\ea93"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
new/inc/assets/css/mdstyle8.css
CHANGED
@@ -1,161 +1 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
.mdstyle8 a {
|
4 |
-
background-color: transparent; }
|
5 |
-
.mdstyle8 a:active,
|
6 |
-
.mdstyle8 a:hover {
|
7 |
-
outline: 0; }
|
8 |
-
.mdstyle8 b,
|
9 |
-
.mdstyle8 strong {
|
10 |
-
font-weight: bold; }
|
11 |
-
.mdstyle8 small {
|
12 |
-
font-size: 80%; }
|
13 |
-
.mdstyle8 img {
|
14 |
-
border: 0; }
|
15 |
-
.mdstyle8 svg:not(:root) {
|
16 |
-
overflow: hidden; }
|
17 |
-
.mdstyle8 input,
|
18 |
-
.mdstyle8 button {
|
19 |
-
overflow: visible; }
|
20 |
-
.mdstyle8 button,
|
21 |
-
.mdstyle8 html input[type="button"],
|
22 |
-
.mdstyle8 button[disabled],
|
23 |
-
.mdstyle8 html input[disabled] {
|
24 |
-
cursor: default; }
|
25 |
-
.mdstyle8 button::-moz-focus-inner,
|
26 |
-
.mdstyle8 input::-moz-focus-inner {
|
27 |
-
border: 0;
|
28 |
-
padding: 0; }
|
29 |
-
.mdstyle8 *, .mdstyle8 *:before, .mdstyle8 *:after {
|
30 |
-
box-sizing: inherit; }
|
31 |
-
.mdstyle8 a {
|
32 |
-
color: #039be5;
|
33 |
-
text-decoration: none;
|
34 |
-
-webkit-tap-highlight-color: transparent; }
|
35 |
-
.mdstyle8 .clearfix {
|
36 |
-
clear: both; }
|
37 |
-
.mdstyle8 .z-depth-0 {
|
38 |
-
box-shadow: none !important; }
|
39 |
-
.mdstyle8 .z-depth-1, .mdstyle8 .btn, .mdstyle8 .btn-large, .mdstyle8 .btn-floating {
|
40 |
-
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2); }
|
41 |
-
.mdstyle8 .z-depth-1-half, .mdstyle8 .btn:hover, .mdstyle8 .btn-large:hover, .mdstyle8 .btn-floating:hover {
|
42 |
-
box-shadow: 0 3px 3px 0 rgba(7, 6, 6, 0.14), 0 1px 7px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -1px rgba(0, 0, 0, 0.2); }
|
43 |
-
.mdstyle8 .z-depth-2 {
|
44 |
-
box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.3); }
|
45 |
-
.mdstyle8 .z-depth-3 {
|
46 |
-
box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 3px 5px -1px rgba(0, 0, 0, 0.3); }
|
47 |
-
.mdstyle8 .z-depth-4 {
|
48 |
-
box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.3); }
|
49 |
-
.mdstyle8 .z-depth-5 {
|
50 |
-
box-shadow: 0 16px 24px 2px rgba(0, 0, 0, 0.14), 0 6px 30px 5px rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.3); }
|
51 |
-
.mdstyle8 .hoverable {
|
52 |
-
transition: box-shadow .25s; }
|
53 |
-
.mdstyle8 .hoverable:hover {
|
54 |
-
box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); }
|
55 |
-
.mdstyle8 i {
|
56 |
-
line-height: inherit; }
|
57 |
-
.mdstyle8 i.left {
|
58 |
-
float: left;
|
59 |
-
margin-right: 15px; }
|
60 |
-
.mdstyle8 i.right {
|
61 |
-
float: right;
|
62 |
-
margin-left: 15px; }
|
63 |
-
.mdstyle8 i.tiny {
|
64 |
-
font-size: 1rem; }
|
65 |
-
.mdstyle8 i.small {
|
66 |
-
font-size: 2rem; }
|
67 |
-
.mdstyle8 i.medium {
|
68 |
-
font-size: 4rem; }
|
69 |
-
.mdstyle8 i.large {
|
70 |
-
font-size: 6rem; }
|
71 |
-
.mdstyle8 .hide {
|
72 |
-
display: none !important; }
|
73 |
-
.mdstyle8 .left-align {
|
74 |
-
text-align: left; }
|
75 |
-
.mdstyle8 .right-align {
|
76 |
-
text-align: right; }
|
77 |
-
.mdstyle8 .center, .mdstyle8 .center-align {
|
78 |
-
text-align: center; }
|
79 |
-
.mdstyle8 .left {
|
80 |
-
float: left !important; }
|
81 |
-
.mdstyle8 .right {
|
82 |
-
float: right !important; }
|
83 |
-
.mdstyle8 .no-select {
|
84 |
-
user-select: none; }
|
85 |
-
.mdstyle8 .no-padding {
|
86 |
-
padding: 0 !important; }
|
87 |
-
.mdstyle8 a {
|
88 |
-
text-decoration: none; }
|
89 |
-
.mdstyle8 strong {
|
90 |
-
font-weight: 500; }
|
91 |
-
.mdstyle8 small {
|
92 |
-
font-size: 75%; }
|
93 |
-
.mdstyle8 .light, .mdstyle8 .page-footer .footer-copyright {
|
94 |
-
font-weight: 300; }
|
95 |
-
.mdstyle8 .thin {
|
96 |
-
font-weight: 200; }
|
97 |
-
.mdstyle8 .btn, .mdstyle8 .btn-large,
|
98 |
-
.mdstyle8 .btn-flat {
|
99 |
-
border: none;
|
100 |
-
border-radius: 2px;
|
101 |
-
display: inline-block;
|
102 |
-
height: 36px;
|
103 |
-
line-height: 36px;
|
104 |
-
padding: 0 2rem;
|
105 |
-
/* text-transform: uppercase; */
|
106 |
-
vertical-align: middle;
|
107 |
-
-webkit-tap-highlight-color: transparent; }
|
108 |
-
.mdstyle8 .btn, .mdstyle8 .btn-large,
|
109 |
-
.mdstyle8 .btn-floating,
|
110 |
-
.mdstyle8 .btn-large,
|
111 |
-
.mdstyle8 .btn-flat {
|
112 |
-
font-size: 1rem;
|
113 |
-
outline: 0; }
|
114 |
-
.mdstyle8 .btn i, .mdstyle8 .btn-large i,
|
115 |
-
.mdstyle8 .btn-large i {
|
116 |
-
font-size: 1.3rem;
|
117 |
-
line-height: inherit; }
|
118 |
-
.mdstyle8 .btn:focus, .mdstyle8 .btn-large:focus,
|
119 |
-
.mdstyle8 .btn, .mdstyle8 .btn-large {
|
120 |
-
text-decoration: none;
|
121 |
-
color: #fff;
|
122 |
-
background-color: #26a69a;
|
123 |
-
text-align: center;
|
124 |
-
letter-spacing: .5px;
|
125 |
-
transition: .2s ease-out;
|
126 |
-
cursor: pointer; }
|
127 |
-
.mdstyle8 .btn:hover, .mdstyle8 .btn-large:hover {
|
128 |
-
background-color: #2bbbad; }
|
129 |
-
.mdstyle8 .fixed-action-btn {
|
130 |
-
position: fixed;
|
131 |
-
right: 23px;
|
132 |
-
bottom: 23px;
|
133 |
-
padding-top: 15px;
|
134 |
-
margin-bottom: 0;
|
135 |
-
z-index: 997; }
|
136 |
-
.mdstyle8 .fixed-action-btn.horizontal {
|
137 |
-
padding: 0 0 0 15px; }
|
138 |
-
.mdstyle8 .fixed-action-btn.toolbar {
|
139 |
-
padding: 0;
|
140 |
-
height: 56px; }
|
141 |
-
.mdstyle8 .fixed-action-btn.toolbar.active > a i {
|
142 |
-
opacity: 0; }
|
143 |
-
.mdstyle8 .btn-large {
|
144 |
-
height: 54px;
|
145 |
-
line-height: 54px; }
|
146 |
-
.mdstyle8 .btn-large i {
|
147 |
-
font-size: 1.6rem; }
|
148 |
-
.mdstyle8 button:focus {
|
149 |
-
outline: none;
|
150 |
-
background-color: #2ab7a9; }
|
151 |
-
|
152 |
-
|
153 |
-
/* custom code */
|
154 |
-
|
155 |
-
/* new interface: style-8 */
|
156 |
-
.ht-ctc-style-8 {
|
157 |
-
display: block !important;
|
158 |
-
}
|
159 |
-
.ht-ctc-sc-style-8 {
|
160 |
-
display: inline;
|
161 |
-
}
|
1 |
+
.mdstyle8 a{background-color:transparent}.mdstyle8 a:active,.mdstyle8 a:hover{outline:0}.mdstyle8 b,.mdstyle8 strong{font-weight:700}.mdstyle8 small{font-size:80%}.mdstyle8 img{border:0}.mdstyle8 svg:not(:root){overflow:hidden}.mdstyle8 button,.mdstyle8 input{overflow:visible}.mdstyle8 button,.mdstyle8 button[disabled],.mdstyle8 html input[disabled],.mdstyle8 html input[type=button]{cursor:default}.mdstyle8 button::-moz-focus-inner,.mdstyle8 input::-moz-focus-inner{border:0;padding:0}.mdstyle8 *,.mdstyle8:after,.mdstyle8:before{box-sizing:inherit}.mdstyle8 a{color:#039be5;text-decoration:none;-webkit-tap-highlight-color:transparent}.mdstyle8 .clearfix{clear:both}.mdstyle8 .z-depth-0{box-shadow:none!important}.mdstyle8 .btn,.mdstyle8 .btn-floating,.mdstyle8 .btn-large,.mdstyle8 .z-depth-1{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2)}.mdstyle8 .btn-floating:hover,.mdstyle8 .btn-large:hover,.mdstyle8 .btn:hover,.mdstyle8 .z-depth-1-half{box-shadow:0 3px 3px 0 rgba(7,6,6,.14),0 1px 7px 0 rgba(0,0,0,.12),0 3px 1px -1px rgba(0,0,0,.2)}.mdstyle8 .z-depth-2{box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.3)}.mdstyle8 .z-depth-3{box-shadow:0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12),0 3px 5px -1px rgba(0,0,0,.3)}.mdstyle8 .z-depth-4{box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.3)}.mdstyle8 .z-depth-5{box-shadow:0 16px 24px 2px rgba(0,0,0,.14),0 6px 30px 5px rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.3)}.mdstyle8 .hoverable{transition:box-shadow .25s}.mdstyle8 .hoverable:hover{box-shadow:0 8px 17px 0 rgba(0,0,0,.2),0 6px 20px 0 rgba(0,0,0,.19)}.mdstyle8 i{line-height:inherit}.mdstyle8 i.left{float:left;margin-right:15px}.mdstyle8 i.right{float:right;margin-left:15px}.mdstyle8 i.tiny{font-size:1rem}.mdstyle8 i.small{font-size:2rem}.mdstyle8 i.medium{font-size:4rem}.mdstyle8 i.large{font-size:6rem}.mdstyle8 .hide{display:none!important}.mdstyle8 .left-align{text-align:left}.mdstyle8 .right-align{text-align:right}.mdstyle8 .center,.mdstyle8 .center-align{text-align:center}.mdstyle8 .left{float:left!important}.mdstyle8 .right{float:right!important}.mdstyle8 .no-select{user-select:none}.mdstyle8 .no-padding{padding:0!important}.mdstyle8 a{text-decoration:none}.mdstyle8 strong{font-weight:500}.mdstyle8 small{font-size:75%}.mdstyle8 .light,.mdstyle8 .page-footer .footer-copyright{font-weight:300}.mdstyle8 .thin{font-weight:200}.mdstyle8 .btn,.mdstyle8 .btn-flat,.mdstyle8 .btn-large{border:none;border-radius:2px;display:inline-block;height:36px;line-height:36px;padding:0 2rem;vertical-align:middle;-webkit-tap-highlight-color:transparent}.mdstyle8 .btn,.mdstyle8 .btn-flat,.mdstyle8 .btn-floating,.mdstyle8 .btn-large{font-size:1rem;outline:0}.mdstyle8 .btn i,.mdstyle8 .btn-large i{font-size:1.3rem;line-height:inherit}.mdstyle8 .btn,.mdstyle8 .btn-large,.mdstyle8 .btn-large:focus,.mdstyle8 .btn:focus{text-decoration:none;color:#fff;background-color:#26a69a;text-align:center;letter-spacing:.5px;transition:.2s ease-out;cursor:pointer}.mdstyle8 .btn-large:hover,.mdstyle8 .btn:hover{background-color:#2bbbad}.mdstyle8 .fixed-action-btn{position:fixed;right:23px;bottom:23px;padding-top:15px;margin-bottom:0;z-index:997}.mdstyle8 .fixed-action-btn.horizontal{padding:0 0 0 15px}.mdstyle8 .fixed-action-btn.toolbar{padding:0;height:56px}.mdstyle8 .fixed-action-btn.toolbar.active>a i{opacity:0}.mdstyle8 .btn-large{height:54px;line-height:54px}.mdstyle8 .btn-large i{font-size:1.6rem}.mdstyle8 button:focus{outline:0;background-color:#2ab7a9}.ht-ctc-sc-style-8{display:inline}.mdstyle8.ht-ctc-sc-style-8 .s8_span,.mdstyle8.ht-ctc-style-8 .s8_span{font-size:14px}.mdstyle8.ht-ctc-style-8 i.s8_icon,.mdstyle8.ht-ctc-sc-style-8 i.s8_icon{font-size:17px}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
new/inc/assets/img/svg-style-2.php
CHANGED
@@ -4,21 +4,17 @@
|
|
4 |
* square icon
|
5 |
*/
|
6 |
|
|
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
$img_size = $img_size;
|
11 |
-
|
12 |
-
$svg = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'.$img_size.'" height="'.$img_size.'" viewBox="0 0 1024 1024">
|
13 |
-
<title>'.$call_to_action.'</title>
|
14 |
<defs>
|
15 |
-
<path id="htwasqicona" d="M1023.941 765.153c0 5.606-.171 17.766-.508 27.159-.824 22.982-2.646 52.639-5.401 66.151-4.141 20.306-10.392 39.472-18.542 55.425-9.643 18.871-21.943 35.775-36.559 50.364-14.584 14.56-31.472 26.812-50.315 36.416-16.036 8.172-35.322 14.426-55.744 18.549-13.378 2.701-42.812 4.488-65.648 5.3-9.402.336-21.564.505-27.15.505l-504.226-.081c-5.607 0-17.765-.172-27.158-.509-22.983-.824-52.639-2.646-66.152-5.4-20.306-4.142-39.473-10.392-55.425-18.542-18.872-9.644-35.775-21.944-50.364-36.56-14.56-14.584-26.812-31.471-36.415-50.314-8.174-16.037-14.428-35.323-18.551-55.744-2.7-13.378-4.487-42.812-5.3-65.649-.334-9.401-.503-21.563-.503-27.148l.08-504.228c0-5.607.171-17.766.508-27.159.825-22.983 2.646-52.639 5.401-66.151 4.141-20.306 10.391-39.473 18.542-55.426C34.154 93.24 46.455 76.336 61.07 61.747c14.584-14.559 31.472-26.812 50.315-36.416 16.037-8.172 35.324-14.426 55.745-18.549 13.377-2.701 42.812-4.488 65.648-5.3 9.402-.335 21.565-.504 27.149-.504l504.227.081c5.608 0 17.766.171 27.159.508 22.983.825 52.638 2.646 66.152 5.401 20.305 4.141 39.472 10.391 55.425 18.542 18.871 9.643 35.774 21.944 50.363 36.559 14.559 14.584 26.812 31.471 36.415 50.315 8.174 16.037 14.428 35.323 18.551 55.744 2.7 13.378 4.486 42.812 5.3 65.649.335 9.402.504 21.564.504 27.15l-.082 504.226z"/>
|
16 |
</defs>
|
17 |
-
<linearGradient id="htwasqiconb" gradientUnits="userSpaceOnUse" x1="512.001" y1=".978" x2="512.001" y2="1025.023">
|
18 |
<stop offset="0" stop-color="#61fd7d"/>
|
19 |
<stop offset="1" stop-color="#2bb826"/>
|
20 |
</linearGradient>
|
21 |
-
<use xlink:href="#htwasqicona" overflow="visible" fill="url(#htwasqiconb)"/>
|
22 |
<g>
|
23 |
<path fill="#FFF" d="M783.302 243.246c-69.329-69.387-161.529-107.619-259.763-107.658-202.402 0-367.133 164.668-367.214 367.072-.026 64.699 16.883 127.854 49.017 183.522l-52.096 190.229 194.665-51.047c53.636 29.244 114.022 44.656 175.482 44.682h.151c202.382 0 367.128-164.688 367.21-367.094.039-98.087-38.121-190.319-107.452-259.706zM523.544 808.047h-.125c-54.767-.021-108.483-14.729-155.344-42.529l-11.146-6.612-115.517 30.293 30.834-112.592-7.259-11.544c-30.552-48.579-46.688-104.729-46.664-162.379.066-168.229 136.985-305.096 305.339-305.096 81.521.031 158.154 31.811 215.779 89.482s89.342 134.332 89.312 215.859c-.066 168.243-136.984 305.118-305.209 305.118zm167.415-228.515c-9.177-4.591-54.286-26.782-62.697-29.843-8.41-3.062-14.526-4.592-20.645 4.592-6.115 9.182-23.699 29.843-29.053 35.964-5.352 6.122-10.704 6.888-19.879 2.296-9.176-4.591-38.74-14.277-73.786-45.526-27.275-24.319-45.691-54.359-51.043-63.543-5.352-9.183-.569-14.146 4.024-18.72 4.127-4.109 9.175-10.713 13.763-16.069 4.587-5.355 6.117-9.183 9.175-15.304 3.059-6.122 1.529-11.479-.765-16.07-2.293-4.591-20.644-49.739-28.29-68.104-7.447-17.886-15.013-15.466-20.645-15.747-5.346-.266-11.469-.322-17.585-.322s-16.057 2.295-24.467 11.478-32.113 31.374-32.113 76.521c0 45.147 32.877 88.764 37.465 94.885 4.588 6.122 64.699 98.771 156.741 138.502 21.892 9.45 38.982 15.094 52.308 19.322 21.98 6.979 41.982 5.995 57.793 3.634 17.628-2.633 54.284-22.189 61.932-43.615 7.646-21.427 7.646-39.791 5.352-43.617-2.294-3.826-8.41-6.122-17.585-10.714z"/>
|
24 |
</g>
|
4 |
* square icon
|
5 |
*/
|
6 |
|
7 |
+
function style_2_svg( $img_size, $type, $ht_ctc_svg_css ) {
|
8 |
|
9 |
+
$svg = '<svg style="'.$ht_ctc_svg_css.'" width="'.$img_size.'" height="'.$img_size.'" viewBox="0 0 1024 1024">
|
|
|
|
|
|
|
|
|
|
|
10 |
<defs>
|
11 |
+
<path id="htwasqicona-'.$type.'" d="M1023.941 765.153c0 5.606-.171 17.766-.508 27.159-.824 22.982-2.646 52.639-5.401 66.151-4.141 20.306-10.392 39.472-18.542 55.425-9.643 18.871-21.943 35.775-36.559 50.364-14.584 14.56-31.472 26.812-50.315 36.416-16.036 8.172-35.322 14.426-55.744 18.549-13.378 2.701-42.812 4.488-65.648 5.3-9.402.336-21.564.505-27.15.505l-504.226-.081c-5.607 0-17.765-.172-27.158-.509-22.983-.824-52.639-2.646-66.152-5.4-20.306-4.142-39.473-10.392-55.425-18.542-18.872-9.644-35.775-21.944-50.364-36.56-14.56-14.584-26.812-31.471-36.415-50.314-8.174-16.037-14.428-35.323-18.551-55.744-2.7-13.378-4.487-42.812-5.3-65.649-.334-9.401-.503-21.563-.503-27.148l.08-504.228c0-5.607.171-17.766.508-27.159.825-22.983 2.646-52.639 5.401-66.151 4.141-20.306 10.391-39.473 18.542-55.426C34.154 93.24 46.455 76.336 61.07 61.747c14.584-14.559 31.472-26.812 50.315-36.416 16.037-8.172 35.324-14.426 55.745-18.549 13.377-2.701 42.812-4.488 65.648-5.3 9.402-.335 21.565-.504 27.149-.504l504.227.081c5.608 0 17.766.171 27.159.508 22.983.825 52.638 2.646 66.152 5.401 20.305 4.141 39.472 10.391 55.425 18.542 18.871 9.643 35.774 21.944 50.363 36.559 14.559 14.584 26.812 31.471 36.415 50.315 8.174 16.037 14.428 35.323 18.551 55.744 2.7 13.378 4.486 42.812 5.3 65.649.335 9.402.504 21.564.504 27.15l-.082 504.226z"/>
|
12 |
</defs>
|
13 |
+
<linearGradient id="htwasqiconb-'.$type.'" gradientUnits="userSpaceOnUse" x1="512.001" y1=".978" x2="512.001" y2="1025.023">
|
14 |
<stop offset="0" stop-color="#61fd7d"/>
|
15 |
<stop offset="1" stop-color="#2bb826"/>
|
16 |
</linearGradient>
|
17 |
+
<use xlink:href="#htwasqicona-'.$type.'" overflow="visible" fill="url(#htwasqiconb-'.$type.')"/>
|
18 |
<g>
|
19 |
<path fill="#FFF" d="M783.302 243.246c-69.329-69.387-161.529-107.619-259.763-107.658-202.402 0-367.133 164.668-367.214 367.072-.026 64.699 16.883 127.854 49.017 183.522l-52.096 190.229 194.665-51.047c53.636 29.244 114.022 44.656 175.482 44.682h.151c202.382 0 367.128-164.688 367.21-367.094.039-98.087-38.121-190.319-107.452-259.706zM523.544 808.047h-.125c-54.767-.021-108.483-14.729-155.344-42.529l-11.146-6.612-115.517 30.293 30.834-112.592-7.259-11.544c-30.552-48.579-46.688-104.729-46.664-162.379.066-168.229 136.985-305.096 305.339-305.096 81.521.031 158.154 31.811 215.779 89.482s89.342 134.332 89.312 215.859c-.066 168.243-136.984 305.118-305.209 305.118zm167.415-228.515c-9.177-4.591-54.286-26.782-62.697-29.843-8.41-3.062-14.526-4.592-20.645 4.592-6.115 9.182-23.699 29.843-29.053 35.964-5.352 6.122-10.704 6.888-19.879 2.296-9.176-4.591-38.74-14.277-73.786-45.526-27.275-24.319-45.691-54.359-51.043-63.543-5.352-9.183-.569-14.146 4.024-18.72 4.127-4.109 9.175-10.713 13.763-16.069 4.587-5.355 6.117-9.183 9.175-15.304 3.059-6.122 1.529-11.479-.765-16.07-2.293-4.591-20.644-49.739-28.29-68.104-7.447-17.886-15.013-15.466-20.645-15.747-5.346-.266-11.469-.322-17.585-.322s-16.057 2.295-24.467 11.478-32.113 31.374-32.113 76.521c0 45.147 32.877 88.764 37.465 94.885 4.588 6.122 64.699 98.771 156.741 138.502 21.892 9.45 38.982 15.094 52.308 19.322 21.98 6.979 41.982 5.995 57.793 3.634 17.628-2.633 54.284-22.189 61.932-43.615 7.646-21.427 7.646-39.791 5.352-43.617-2.294-3.826-8.41-6.122-17.585-10.714z"/>
|
20 |
</g>
|
new/inc/assets/img/svg-style-3.php
CHANGED
@@ -4,19 +4,44 @@
|
|
4 |
* icon
|
5 |
*/
|
6 |
|
|
|
|
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
$img_size = $img_size;
|
11 |
-
|
12 |
-
$svg = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'.$img_size.'" height="'.$img_size.'" viewBox="0 0 1219.547 1225.016">
|
13 |
-
<title>'.$call_to_action.'</title>
|
14 |
<path fill="#E0E0E0" d="M1041.858 178.02C927.206 63.289 774.753.07 612.325 0 277.617 0 5.232 272.298 5.098 606.991c-.039 106.986 27.915 211.42 81.048 303.476L0 1225.016l321.898-84.406c88.689 48.368 188.547 73.855 290.166 73.896h.258.003c334.654 0 607.08-272.346 607.222-607.023.056-162.208-63.052-314.724-177.689-429.463zm-429.533 933.963h-.197c-90.578-.048-179.402-24.366-256.878-70.339l-18.438-10.93-191.021 50.083 51-186.176-12.013-19.087c-50.525-80.336-77.198-173.175-77.16-268.504.111-278.186 226.507-504.503 504.898-504.503 134.812.056 261.519 52.604 356.814 147.965 95.289 95.36 147.728 222.128 147.688 356.948-.118 278.195-226.522 504.543-504.693 504.543z"/>
|
15 |
-
<linearGradient id="htwaicona" gradientUnits="userSpaceOnUse" x1="609.77" y1="1190.114" x2="609.77" y2="21.084">
|
16 |
<stop offset="0" stop-color="#20b038"/>
|
17 |
<stop offset="1" stop-color="#60d66a"/>
|
18 |
</linearGradient>
|
19 |
-
<path fill="url(#htwaicona)" d="M27.875 1190.114l82.211-300.18c-50.719-87.852-77.391-187.523-77.359-289.602.133-319.398 260.078-579.25 579.469-579.25 155.016.07 300.508 60.398 409.898 169.891 109.414 109.492 169.633 255.031 169.57 409.812-.133 319.406-260.094 579.281-579.445 579.281-.023 0 .016 0 0 0h-.258c-96.977-.031-192.266-24.375-276.898-70.5l-307.188 80.548z"/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
<image overflow="visible" opacity=".08" width="682" height="639" transform="translate(270.984 291.372)"/>
|
21 |
<path fill-rule="evenodd" clip-rule="evenodd" fill="#FFF" d="M462.273 349.294c-11.234-24.977-23.062-25.477-33.75-25.914-8.742-.375-18.75-.352-28.742-.352-10 0-26.25 3.758-39.992 18.766-13.75 15.008-52.5 51.289-52.5 125.078 0 73.797 53.75 145.102 61.242 155.117 7.5 10 103.758 166.266 256.203 226.383 126.695 49.961 152.477 40.023 179.977 37.523s88.734-36.273 101.234-71.297c12.5-35.016 12.5-65.031 8.75-71.305-3.75-6.25-13.75-10-28.75-17.5s-88.734-43.789-102.484-48.789-23.75-7.5-33.75 7.516c-10 15-38.727 48.773-47.477 58.773-8.75 10.023-17.5 11.273-32.5 3.773-15-7.523-63.305-23.344-120.609-74.438-44.586-39.75-74.688-88.844-83.438-103.859-8.75-15-.938-23.125 6.586-30.602 6.734-6.719 15-17.508 22.5-26.266 7.484-8.758 9.984-15.008 14.984-25.008 5-10.016 2.5-18.773-1.25-26.273s-32.898-81.67-46.234-111.326z"/>
|
22 |
<path fill="#FFF" d="M1036.898 176.091C923.562 62.677 772.859.185 612.297.114 281.43.114 12.172 269.286 12.039 600.137 12 705.896 39.633 809.13 92.156 900.13L7 1211.067l318.203-83.438c87.672 47.812 186.383 73.008 286.836 73.047h.255.003c330.812 0 600.109-269.219 600.25-600.055.055-160.343-62.328-311.108-175.649-424.53zm-424.601 923.242h-.195c-89.539-.047-177.344-24.086-253.93-69.531l-18.227-10.805-188.828 49.508 50.414-184.039-11.875-18.867c-49.945-79.414-76.312-171.188-76.273-265.422.109-274.992 223.906-498.711 499.102-498.711 133.266.055 258.516 52 352.719 146.266 94.195 94.266 146.031 219.578 145.992 352.852-.118 274.999-223.923 498.749-498.899 498.749z"/>
|
4 |
* icon
|
5 |
*/
|
6 |
|
7 |
+
// style-3, style-4
|
8 |
+
function style_3_svg( $img_size, $type, $ht_ctc_svg_css ) {
|
9 |
|
10 |
+
$svg = '<svg style="'.$ht_ctc_svg_css.'" width="'.$img_size.'" height="'.$img_size.'" viewBox="0 0 1219.547 1225.016">
|
|
|
|
|
|
|
|
|
|
|
11 |
<path fill="#E0E0E0" d="M1041.858 178.02C927.206 63.289 774.753.07 612.325 0 277.617 0 5.232 272.298 5.098 606.991c-.039 106.986 27.915 211.42 81.048 303.476L0 1225.016l321.898-84.406c88.689 48.368 188.547 73.855 290.166 73.896h.258.003c334.654 0 607.08-272.346 607.222-607.023.056-162.208-63.052-314.724-177.689-429.463zm-429.533 933.963h-.197c-90.578-.048-179.402-24.366-256.878-70.339l-18.438-10.93-191.021 50.083 51-186.176-12.013-19.087c-50.525-80.336-77.198-173.175-77.16-268.504.111-278.186 226.507-504.503 504.898-504.503 134.812.056 261.519 52.604 356.814 147.965 95.289 95.36 147.728 222.128 147.688 356.948-.118 278.195-226.522 504.543-504.693 504.543z"/>
|
12 |
+
<linearGradient id="htwaicona-'.$type.'" gradientUnits="userSpaceOnUse" x1="609.77" y1="1190.114" x2="609.77" y2="21.084">
|
13 |
<stop offset="0" stop-color="#20b038"/>
|
14 |
<stop offset="1" stop-color="#60d66a"/>
|
15 |
</linearGradient>
|
16 |
+
<path fill="url(#htwaicona-'.$type.')" d="M27.875 1190.114l82.211-300.18c-50.719-87.852-77.391-187.523-77.359-289.602.133-319.398 260.078-579.25 579.469-579.25 155.016.07 300.508 60.398 409.898 169.891 109.414 109.492 169.633 255.031 169.57 409.812-.133 319.406-260.094 579.281-579.445 579.281-.023 0 .016 0 0 0h-.258c-96.977-.031-192.266-24.375-276.898-70.5l-307.188 80.548z"/>
|
17 |
+
<image overflow="visible" opacity=".08" width="682" height="639" transform="translate(270.984 291.372)"/>
|
18 |
+
<path fill-rule="evenodd" clip-rule="evenodd" fill="#FFF" d="M462.273 349.294c-11.234-24.977-23.062-25.477-33.75-25.914-8.742-.375-18.75-.352-28.742-.352-10 0-26.25 3.758-39.992 18.766-13.75 15.008-52.5 51.289-52.5 125.078 0 73.797 53.75 145.102 61.242 155.117 7.5 10 103.758 166.266 256.203 226.383 126.695 49.961 152.477 40.023 179.977 37.523s88.734-36.273 101.234-71.297c12.5-35.016 12.5-65.031 8.75-71.305-3.75-6.25-13.75-10-28.75-17.5s-88.734-43.789-102.484-48.789-23.75-7.5-33.75 7.516c-10 15-38.727 48.773-47.477 58.773-8.75 10.023-17.5 11.273-32.5 3.773-15-7.523-63.305-23.344-120.609-74.438-44.586-39.75-74.688-88.844-83.438-103.859-8.75-15-.938-23.125 6.586-30.602 6.734-6.719 15-17.508 22.5-26.266 7.484-8.758 9.984-15.008 14.984-25.008 5-10.016 2.5-18.773-1.25-26.273s-32.898-81.67-46.234-111.326z"/>
|
19 |
+
<path fill="#FFF" d="M1036.898 176.091C923.562 62.677 772.859.185 612.297.114 281.43.114 12.172 269.286 12.039 600.137 12 705.896 39.633 809.13 92.156 900.13L7 1211.067l318.203-83.438c87.672 47.812 186.383 73.008 286.836 73.047h.255.003c330.812 0 600.109-269.219 600.25-600.055.055-160.343-62.328-311.108-175.649-424.53zm-424.601 923.242h-.195c-89.539-.047-177.344-24.086-253.93-69.531l-18.227-10.805-188.828 49.508 50.414-184.039-11.875-18.867c-49.945-79.414-76.312-171.188-76.273-265.422.109-274.992 223.906-498.711 499.102-498.711 133.266.055 258.516 52 352.719 146.266 94.195 94.266 146.031 219.578 145.992 352.852-.118 274.999-223.923 498.749-498.899 498.749z"/>
|
20 |
+
</svg>';
|
21 |
+
|
22 |
+
return $svg;
|
23 |
+
}
|
24 |
+
|
25 |
+
|
26 |
+
// style-3 extend
|
27 |
+
// #25D366 / #20b038 #60d66a
|
28 |
+
function style_3_extend_svg( $img_size, $type, $ht_ctc_svg_css, $others ) {
|
29 |
+
|
30 |
+
$stop_color_0 = ( isset( $others['bg_color'] ) ) ? esc_attr( $others['bg_color'] ) : '#20b038';
|
31 |
+
$stop_color_1 = ( isset( $others['bg_color'] ) ) ? esc_attr( $others['bg_color'] ) : '#60d66a';
|
32 |
+
|
33 |
+
if ( '' == $stop_color_0 ) {
|
34 |
+
$stop_color_0 = "#20b038";
|
35 |
+
$stop_color_1 = "#60d66a";
|
36 |
+
}
|
37 |
+
|
38 |
+
$svg = '<svg style="'.$ht_ctc_svg_css.'" width="'.$img_size.'" height="'.$img_size.'" viewBox="0 0 1219.547 1225.016">
|
39 |
+
<path fill="#E0E0E0" d="M1041.858 178.02C927.206 63.289 774.753.07 612.325 0 277.617 0 5.232 272.298 5.098 606.991c-.039 106.986 27.915 211.42 81.048 303.476L0 1225.016l321.898-84.406c88.689 48.368 188.547 73.855 290.166 73.896h.258.003c334.654 0 607.08-272.346 607.222-607.023.056-162.208-63.052-314.724-177.689-429.463zm-429.533 933.963h-.197c-90.578-.048-179.402-24.366-256.878-70.339l-18.438-10.93-191.021 50.083 51-186.176-12.013-19.087c-50.525-80.336-77.198-173.175-77.16-268.504.111-278.186 226.507-504.503 504.898-504.503 134.812.056 261.519 52.604 356.814 147.965 95.289 95.36 147.728 222.128 147.688 356.948-.118 278.195-226.522 504.543-504.693 504.543z"/>
|
40 |
+
<linearGradient id="htwaicona-'.$type.'" gradientUnits="userSpaceOnUse" x1="609.77" y1="1190.114" x2="609.77" y2="21.084">
|
41 |
+
<stop offset="0" stop-color="'.$stop_color_0.'"/>
|
42 |
+
<stop offset="1" stop-color="'.$stop_color_1.'"/>
|
43 |
+
</linearGradient>
|
44 |
+
<path fill="url(#htwaicona-'.$type.')" d="M27.875 1190.114l82.211-300.18c-50.719-87.852-77.391-187.523-77.359-289.602.133-319.398 260.078-579.25 579.469-579.25 155.016.07 300.508 60.398 409.898 169.891 109.414 109.492 169.633 255.031 169.57 409.812-.133 319.406-260.094 579.281-579.445 579.281-.023 0 .016 0 0 0h-.258c-96.977-.031-192.266-24.375-276.898-70.5l-307.188 80.548z"/>
|
45 |
<image overflow="visible" opacity=".08" width="682" height="639" transform="translate(270.984 291.372)"/>
|
46 |
<path fill-rule="evenodd" clip-rule="evenodd" fill="#FFF" d="M462.273 349.294c-11.234-24.977-23.062-25.477-33.75-25.914-8.742-.375-18.75-.352-28.742-.352-10 0-26.25 3.758-39.992 18.766-13.75 15.008-52.5 51.289-52.5 125.078 0 73.797 53.75 145.102 61.242 155.117 7.5 10 103.758 166.266 256.203 226.383 126.695 49.961 152.477 40.023 179.977 37.523s88.734-36.273 101.234-71.297c12.5-35.016 12.5-65.031 8.75-71.305-3.75-6.25-13.75-10-28.75-17.5s-88.734-43.789-102.484-48.789-23.75-7.5-33.75 7.516c-10 15-38.727 48.773-47.477 58.773-8.75 10.023-17.5 11.273-32.5 3.773-15-7.523-63.305-23.344-120.609-74.438-44.586-39.75-74.688-88.844-83.438-103.859-8.75-15-.938-23.125 6.586-30.602 6.734-6.719 15-17.508 22.5-26.266 7.484-8.758 9.984-15.008 14.984-25.008 5-10.016 2.5-18.773-1.25-26.273s-32.898-81.67-46.234-111.326z"/>
|
47 |
<path fill="#FFF" d="M1036.898 176.091C923.562 62.677 772.859.185 612.297.114 281.43.114 12.172 269.286 12.039 600.137 12 705.896 39.633 809.13 92.156 900.13L7 1211.067l318.203-83.438c87.672 47.812 186.383 73.008 286.836 73.047h.255.003c330.812 0 600.109-269.219 600.25-600.055.055-160.343-62.328-311.108-175.649-424.53zm-424.601 923.242h-.195c-89.539-.047-177.344-24.086-253.93-69.531l-18.227-10.805-188.828 49.508 50.414-184.039-11.875-18.867c-49.945-79.414-76.312-171.188-76.273-265.422.109-274.992 223.906-498.711 499.102-498.711 133.266.055 258.516 52 352.719 146.266 94.195 94.266 146.031 219.578 145.992 352.852-.118 274.999-223.923 498.749-498.899 498.749z"/>
|
new/inc/assets/js/app.dev.js
ADDED
@@ -0,0 +1,234 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Click to Chat
|
2 |
+
var ht_ctc_v = '2.11';
|
3 |
+
var url = window.location.href;
|
4 |
+
|
5 |
+
// is_mobile yes/no, desktop > 1024
|
6 |
+
var is_mobile = 'yes';
|
7 |
+
if (typeof screen.width !== "undefined" ) {
|
8 |
+
is_mobile = ( screen.width > 1024 ) ? "no" : "yes";
|
9 |
+
}
|
10 |
+
|
11 |
+
// post title
|
12 |
+
var post_title = (typeof document.title !== "undefined" ) ? document.title : '';
|
13 |
+
|
14 |
+
function afterdom_loaded() {
|
15 |
+
if ( 'complete' == document.readyState || 'interactive' == document.readyState ) {
|
16 |
+
// call direclty
|
17 |
+
ht_ctc();
|
18 |
+
} else {
|
19 |
+
document.addEventListener('DOMContentLoaded', ht_ctc);
|
20 |
+
}
|
21 |
+
}
|
22 |
+
afterdom_loaded();
|
23 |
+
|
24 |
+
function ht_ctc_loaded() {
|
25 |
+
afterdom_loaded();
|
26 |
+
}
|
27 |
+
|
28 |
+
function ht_ctc() {
|
29 |
+
var ht_ctc_chat = document.querySelector('.ht-ctc-chat');
|
30 |
+
(ht_ctc_chat) ? hide_basedon_device(ht_ctc_chat) : '';
|
31 |
+
|
32 |
+
var ht_ctc_share = document.querySelector('.ht-ctc-share');
|
33 |
+
(ht_ctc_share) ? hide_basedon_device(ht_ctc_share) : '';
|
34 |
+
|
35 |
+
var ht_ctc_group = document.querySelector('.ht-ctc-group');
|
36 |
+
(ht_ctc_group) ? hide_basedon_device(ht_ctc_group) : '';
|
37 |
+
}
|
38 |
+
|
39 |
+
// Hide based on device
|
40 |
+
function hide_basedon_device(p) {
|
41 |
+
if (is_mobile == 'yes') {
|
42 |
+
var display_mobile = p.getAttribute('data-display_mobile');
|
43 |
+
if ( 'show' == display_mobile ) {
|
44 |
+
|
45 |
+
// remove desktop style
|
46 |
+
var rm = document.querySelector('.ht_ctc_desktop_' + p.getAttribute('data-return_type'));
|
47 |
+
(rm) ? rm.remove() : '';
|
48 |
+
|
49 |
+
var css = p.getAttribute('data-css');
|
50 |
+
var position_mobile = p.getAttribute('data-position_mobile');
|
51 |
+
p.style.cssText = position_mobile + css;
|
52 |
+
display(p)
|
53 |
+
}
|
54 |
+
} else {
|
55 |
+
var display_desktop = p.getAttribute('data-display_desktop');
|
56 |
+
if ( 'show' == display_desktop ) {
|
57 |
+
|
58 |
+
// remove mobile style
|
59 |
+
var rm = document.querySelector('.ht_ctc_mobile_' + p.getAttribute('data-return_type'));
|
60 |
+
(rm) ? rm.remove() : '';
|
61 |
+
|
62 |
+
var css = p.getAttribute('data-css');
|
63 |
+
var position = p.getAttribute('data-position');
|
64 |
+
p.style.cssText = position + css;
|
65 |
+
display(p)
|
66 |
+
}
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
function display(p) {
|
71 |
+
// p.style.removeProperty('display');
|
72 |
+
// var x = p.style.getPropertyValue("display");
|
73 |
+
p.style.display = "block";
|
74 |
+
// try {
|
75 |
+
// jQuery(p).show(120);
|
76 |
+
// } catch (e) {
|
77 |
+
// p.style.display = "block";
|
78 |
+
// }
|
79 |
+
// jQuery(".ht-ctc-chat").show(120);
|
80 |
+
// jQuery(".ht-ctc-chat").fadeIn();
|
81 |
+
}
|
82 |
+
|
83 |
+
// shortcode link
|
84 |
+
function ht_ctc_shortcode_click(values) {
|
85 |
+
data_link = values.getAttribute("data-ctc-link");
|
86 |
+
data_link = encodeURI(data_link);
|
87 |
+
window.open(data_link, '_blank', 'noopener');
|
88 |
+
ht_ctc_analytics(values);
|
89 |
+
}
|
90 |
+
|
91 |
+
// floating style - click
|
92 |
+
function ht_ctc_click(values) {
|
93 |
+
// link
|
94 |
+
ht_ctc_link(values);
|
95 |
+
// analytics
|
96 |
+
ht_ctc_analytics(values);
|
97 |
+
}
|
98 |
+
|
99 |
+
// link - chat, share, group
|
100 |
+
function ht_ctc_link(values) {
|
101 |
+
|
102 |
+
var return_type = values.getAttribute('data-return_type');
|
103 |
+
|
104 |
+
if(return_type == 'group') {
|
105 |
+
// group
|
106 |
+
var base_link = 'https://chat.whatsapp.com/';
|
107 |
+
var group_id = values.getAttribute('data-group_id');
|
108 |
+
window.open(base_link + group_id, '_blank', 'noopener');
|
109 |
+
} else if (return_type == 'share') {
|
110 |
+
// share
|
111 |
+
var share_text = values.getAttribute('data-share_text');
|
112 |
+
var webandapi = values.getAttribute('data-webandapi');
|
113 |
+
// web/api.whatsapp or api.whatsapp
|
114 |
+
var share_nav = "api";
|
115 |
+
if ( 'webapi' == webandapi ) {
|
116 |
+
share_nav = ( is_mobile == 'yes' ) ? "api" : "web";
|
117 |
+
}
|
118 |
+
var base_link = 'https://'+share_nav+'.whatsapp.com/send';
|
119 |
+
window.open(base_link + '?text=' + share_text, '_blank', 'noopener');
|
120 |
+
} else {
|
121 |
+
// chat
|
122 |
+
var number = values.getAttribute('data-number');
|
123 |
+
var pre_filled = values.getAttribute('data-pre_filled');
|
124 |
+
pre_filled = encodeURIComponent(pre_filled);
|
125 |
+
var webandapi = values.getAttribute('data-webandapi');
|
126 |
+
|
127 |
+
if ( '' == number && values.classList.contains("admin") ) {
|
128 |
+
values.innerHTML = "<p style='background-color: #ffffff; margin:0; border: 1px solid #fbfbfb; padding:11px; border-radius:4px; box-shadow: 5px 10px 8px #888888;'>No WhatsApp Number Found!<br><small style='color: red;'>Admin Notice:<br></small><small>Add WhatsApp number at pluign Settings<br>If already added, <strong>clear the Cache</strong> and try.<br>If still an issue, please contact plugin developers</small></p>";
|
129 |
+
return;
|
130 |
+
} else if ( '' == number ) {
|
131 |
+
values.innerHTML = "<p>No WhatsApp Number Found!</p>";
|
132 |
+
return;
|
133 |
+
}
|
134 |
+
|
135 |
+
// web/api.whatsapp or wa.me
|
136 |
+
if ( 'webapi' == webandapi ) {
|
137 |
+
if (is_mobile == 'yes') {
|
138 |
+
var base_link = 'https://api.whatsapp.com/send';
|
139 |
+
} else {
|
140 |
+
var base_link = 'https://web.whatsapp.com/send';
|
141 |
+
}
|
142 |
+
window.open(base_link + '?phone=' + number + '&text=' + pre_filled, '_blank', 'noopener');
|
143 |
+
} else {
|
144 |
+
// wa.me
|
145 |
+
var base_link = 'https://wa.me/';
|
146 |
+
window.open(base_link + number + '?text=' + pre_filled, '_blank', 'noopener');
|
147 |
+
}
|
148 |
+
}
|
149 |
+
}
|
150 |
+
|
151 |
+
// Analytics
|
152 |
+
function ht_ctc_analytics(values) {
|
153 |
+
var return_type = values.getAttribute('data-return_type');
|
154 |
+
var id = '';
|
155 |
+
if ( 'chat' == return_type ) {
|
156 |
+
id = values.getAttribute('data-number');
|
157 |
+
} else if ( 'group' == return_type ) {
|
158 |
+
id = values.getAttribute('data-group_id');
|
159 |
+
} else if ( 'share' == return_type ) {
|
160 |
+
id = values.getAttribute('data-share_text');
|
161 |
+
}
|
162 |
+
// Google Analytics
|
163 |
+
ht_ctc_ga( return_type, id, values );
|
164 |
+
// FB Pixel
|
165 |
+
var is_fb_pixel = values.getAttribute('data-is_fb_pixel');
|
166 |
+
if ( 'yes' == is_fb_pixel ) {
|
167 |
+
ht_ctc_fb_pixel( return_type, id );
|
168 |
+
}
|
169 |
+
// FB Analytics
|
170 |
+
var is_fb_an_enable = values.getAttribute('data-is_fb_an_enable');
|
171 |
+
if ( 'yes' == is_fb_an_enable ) {
|
172 |
+
ht_ctc_fb_an( return_type, id );
|
173 |
+
}
|
174 |
+
}
|
175 |
+
|
176 |
+
// Google Analytics - have to improve
|
177 |
+
function ht_ctc_ga( return_type, id, values ) {
|
178 |
+
var ga_category = 'Click to Chat for WhatsApp';
|
179 |
+
var ga_action = return_type + ': ' + id ;
|
180 |
+
var ga_label = post_title + ', ' + url ;
|
181 |
+
// if ga_enabled
|
182 |
+
var is_ga_enable = values.getAttribute('data-is_ga_enable');
|
183 |
+
if ( 'yes' == is_ga_enable ) {
|
184 |
+
if (typeof gtag !== "undefined") {
|
185 |
+
gtag('event', ga_action, {
|
186 |
+
'event_category': ga_category,
|
187 |
+
'event_label': ga_label,
|
188 |
+
});
|
189 |
+
} else if (typeof ga !== "undefined" && typeof ga.getAll !== "undefined" ) {
|
190 |
+
var tracker = ga.getAll();
|
191 |
+
tracker[0].send("event", ga_category, ga_action, ga_label );
|
192 |
+
// ga('send', 'event', ga_category, ga_action, ga_label);
|
193 |
+
} else if (typeof __gaTracker !== "undefined") {
|
194 |
+
__gaTracker('send', 'event', ga_category, ga_action, ga_label);
|
195 |
+
}
|
196 |
+
}
|
197 |
+
// dataLayer
|
198 |
+
if (typeof dataLayer !== "undefined") {
|
199 |
+
dataLayer.push({
|
200 |
+
'event': 'Click to Chat',
|
201 |
+
'event_category': ga_category,
|
202 |
+
'event_label': ga_label,
|
203 |
+
'event_action': ga_action
|
204 |
+
});
|
205 |
+
}
|
206 |
+
|
207 |
+
}
|
208 |
+
|
209 |
+
// FB Pixel
|
210 |
+
function ht_ctc_fb_pixel( return_type, id ) {
|
211 |
+
|
212 |
+
if (typeof fbq !== "undefined") {
|
213 |
+
fbq('trackCustom', 'Click to Chat by HoliThemes', {
|
214 |
+
'Category': 'Click to Chat for WhatsApp',
|
215 |
+
'return_type': return_type,
|
216 |
+
'ID': id,
|
217 |
+
'Title': post_title,
|
218 |
+
'URL': url
|
219 |
+
});
|
220 |
+
}
|
221 |
+
}
|
222 |
+
|
223 |
+
// FB Analytics
|
224 |
+
function ht_ctc_fb_an( return_type, id ) {
|
225 |
+
var fb_event_name = 'Click to Chat for WhatsApp';
|
226 |
+
var params = {};
|
227 |
+
params['Category'] = 'Click to Chat for WhatsApp';
|
228 |
+
params['return_type'] = return_type;
|
229 |
+
params['ID'] = id;
|
230 |
+
params['Label'] = post_title + ', ' + url ;
|
231 |
+
if (typeof FB !== "undefined") {
|
232 |
+
FB.AppEvents.logEvent( fb_event_name, null, params);
|
233 |
+
}
|
234 |
+
}
|
new/inc/assets/js/app.js
CHANGED
@@ -1,230 +1 @@
|
|
1 |
-
|
2 |
-
* Click to Chat
|
3 |
-
*/
|
4 |
-
var url = window.location.href;
|
5 |
-
|
6 |
-
// is_mobile yes/no, desktop > 1024
|
7 |
-
var is_mobile = 'yes';
|
8 |
-
if (typeof screen.width !== "undefined" ) {
|
9 |
-
is_mobile = ( screen.width > 1024 ) ? "no" : "yes";
|
10 |
-
}
|
11 |
-
|
12 |
-
// post title
|
13 |
-
var post_title = (typeof document.title !== "undefined" ) ? document.title : '';
|
14 |
-
|
15 |
-
function afterdom_loaded() {
|
16 |
-
document.addEventListener('DOMContentLoaded', function() {
|
17 |
-
ht_ctc();
|
18 |
-
});
|
19 |
-
}
|
20 |
-
afterdom_loaded();
|
21 |
-
|
22 |
-
function ht_ctc_loaded() {
|
23 |
-
afterdom_loaded();
|
24 |
-
}
|
25 |
-
|
26 |
-
|
27 |
-
function ht_ctc() {
|
28 |
-
var ht_ctc_chat = document.querySelector('.ht-ctc-chat');
|
29 |
-
(ht_ctc_chat) ? hide_basedon_device(ht_ctc_chat) : '';
|
30 |
-
|
31 |
-
var ht_ctc_share = document.querySelector('.ht-ctc-share');
|
32 |
-
(ht_ctc_share) ? hide_basedon_device(ht_ctc_share) : '';
|
33 |
-
|
34 |
-
var ht_ctc_group = document.querySelector('.ht-ctc-group');
|
35 |
-
(ht_ctc_group) ? hide_basedon_device(ht_ctc_group) : '';
|
36 |
-
}
|
37 |
-
|
38 |
-
|
39 |
-
// Hide based on device
|
40 |
-
function hide_basedon_device(p) {
|
41 |
-
if (is_mobile == 'yes') {
|
42 |
-
var display_mobile = p.getAttribute('data-display_mobile');
|
43 |
-
if ( 'show' == display_mobile ) {
|
44 |
-
display(p)
|
45 |
-
}
|
46 |
-
} else {
|
47 |
-
var display_desktop = p.getAttribute('data-display_desktop');
|
48 |
-
if ( 'show' == display_desktop ) {
|
49 |
-
display(p)
|
50 |
-
}
|
51 |
-
}
|
52 |
-
}
|
53 |
-
|
54 |
-
function display(p) {
|
55 |
-
// p.style.removeProperty('display');
|
56 |
-
// var x = p.style.getPropertyValue("display");
|
57 |
-
p.style.display = "block";
|
58 |
-
}
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
// shortcode link
|
64 |
-
function ht_ctc_shortcode_click(values) {
|
65 |
-
|
66 |
-
data_link = values.getAttribute("data-ctc-link");
|
67 |
-
data_link = encodeURI(data_link);
|
68 |
-
|
69 |
-
window.open(data_link, '_blank', 'noopener');
|
70 |
-
|
71 |
-
ht_ctc_analytics(values);
|
72 |
-
}
|
73 |
-
|
74 |
-
// floating style - click
|
75 |
-
function ht_ctc_click(values) {
|
76 |
-
|
77 |
-
// link
|
78 |
-
ht_ctc_link(values);
|
79 |
-
|
80 |
-
// analytics
|
81 |
-
ht_ctc_analytics(values);
|
82 |
-
|
83 |
-
}
|
84 |
-
|
85 |
-
// link - chat, share, group
|
86 |
-
function ht_ctc_link(values) {
|
87 |
-
|
88 |
-
var return_type = values.getAttribute('data-return_type');
|
89 |
-
|
90 |
-
if(return_type == 'group') {
|
91 |
-
// group
|
92 |
-
var base_link = 'https://chat.whatsapp.com/';
|
93 |
-
|
94 |
-
var group_id = values.getAttribute('data-group_id');
|
95 |
-
|
96 |
-
window.open(base_link + group_id, '_blank', 'noopener');
|
97 |
-
|
98 |
-
} else if (return_type == 'share') {
|
99 |
-
// share
|
100 |
-
var share_text = values.getAttribute('data-share_text');
|
101 |
-
|
102 |
-
var webandapi = values.getAttribute('data-webandapi');
|
103 |
-
|
104 |
-
// web/api.whatsapp or api.whatsapp
|
105 |
-
var share_nav = "api";
|
106 |
-
if ( 'webapi' == webandapi ) {
|
107 |
-
share_nav = ( is_mobile == 'yes' ) ? "api" : "web";
|
108 |
-
}
|
109 |
-
|
110 |
-
var base_link = 'https://'+share_nav+'.whatsapp.com/send';
|
111 |
-
|
112 |
-
window.open(base_link + '?text=' + share_text, '_blank', 'noopener');
|
113 |
-
|
114 |
-
} else {
|
115 |
-
// chat
|
116 |
-
var number = values.getAttribute('data-number');
|
117 |
-
var pre_filled = values.getAttribute('data-pre_filled');
|
118 |
-
pre_filled = encodeURI(pre_filled);
|
119 |
-
var webandapi = values.getAttribute('data-webandapi');
|
120 |
-
|
121 |
-
// web/api.whatsapp or wa.me
|
122 |
-
if ( 'webapi' == webandapi ) {
|
123 |
-
if (is_mobile == 'yes') {
|
124 |
-
var base_link = 'https://api.whatsapp.com/send';
|
125 |
-
} else {
|
126 |
-
var base_link = 'https://web.whatsapp.com/send';
|
127 |
-
}
|
128 |
-
window.open(base_link + '?phone=' + number + '&text=' + pre_filled, '_blank', 'noopener');
|
129 |
-
} else {
|
130 |
-
// wa.me
|
131 |
-
var base_link = 'https://wa.me/';
|
132 |
-
window.open(base_link + number + '?text=' + pre_filled, '_blank', 'noopener');
|
133 |
-
}
|
134 |
-
|
135 |
-
}
|
136 |
-
|
137 |
-
}
|
138 |
-
|
139 |
-
// Analytics
|
140 |
-
function ht_ctc_analytics(values) {
|
141 |
-
|
142 |
-
var return_type = values.getAttribute('data-return_type');
|
143 |
-
|
144 |
-
var id = '';
|
145 |
-
if ( 'chat' == return_type ) {
|
146 |
-
id = values.getAttribute('data-number');
|
147 |
-
} else if ( 'group' == return_type ) {
|
148 |
-
id = values.getAttribute('data-group_id');
|
149 |
-
} else if ( 'share' == return_type ) {
|
150 |
-
id = 'share_text';
|
151 |
-
}
|
152 |
-
|
153 |
-
// Google Analytics
|
154 |
-
var is_ga_enable = values.getAttribute('data-is_ga_enable');
|
155 |
-
if ( 'yes' == is_ga_enable ) {
|
156 |
-
ht_ctc_ga( return_type, id );
|
157 |
-
}
|
158 |
-
|
159 |
-
// FB Pixel
|
160 |
-
var is_fb_pixel = values.getAttribute('data-is_fb_pixel');
|
161 |
-
if ( 'yes' == is_fb_pixel ) {
|
162 |
-
ht_ctc_fb_pixel( return_type, id );
|
163 |
-
}
|
164 |
-
|
165 |
-
// FB Analytics
|
166 |
-
var is_fb_an_enable = values.getAttribute('data-is_fb_an_enable');
|
167 |
-
if ( 'yes' == is_fb_an_enable ) {
|
168 |
-
ht_ctc_fb_an( return_type, id );
|
169 |
-
}
|
170 |
-
|
171 |
-
}
|
172 |
-
|
173 |
-
// Google Analytics - have to improve
|
174 |
-
function ht_ctc_ga( return_type, id ) {
|
175 |
-
|
176 |
-
var ga_category = 'Click to Chat for WhatsApp';
|
177 |
-
var ga_action = return_type + ': ' + id ;
|
178 |
-
var ga_label = post_title + ', ' + url ;
|
179 |
-
|
180 |
-
if (typeof gtag !== "undefined") {
|
181 |
-
gtag('event', ga_action, {
|
182 |
-
'event_category': ga_category,
|
183 |
-
'event_label': ga_label,
|
184 |
-
});
|
185 |
-
} else if (typeof ga !== "undefined") {
|
186 |
-
if (ga.getAll()[0]) ga.getAll()[0].send("event", ga_category, ga_action, ga_label );
|
187 |
-
// ga('send', 'event', ga_category, ga_action, ga_label);
|
188 |
-
}
|
189 |
-
|
190 |
-
// else if (typeof dataLayer !== "undefined") {
|
191 |
-
// dataLayer.push({
|
192 |
-
// 'event': 'Click to Chat',
|
193 |
-
// 'event_category': ga_category,
|
194 |
-
// 'event_label': ga_label
|
195 |
-
// });
|
196 |
-
// }
|
197 |
-
|
198 |
-
|
199 |
-
}
|
200 |
-
|
201 |
-
// FB Pixel
|
202 |
-
function ht_ctc_fb_pixel( return_type, id ) {
|
203 |
-
|
204 |
-
if (typeof fbq !== "undefined") {
|
205 |
-
fbq('trackCustom', 'Click to Chat by HoliThemes', {
|
206 |
-
'Category': 'Click to Chat for WhatsApp',
|
207 |
-
'return_type': return_type,
|
208 |
-
'ID': id,
|
209 |
-
'Title': post_title,
|
210 |
-
'URL': url
|
211 |
-
});
|
212 |
-
}
|
213 |
-
|
214 |
-
}
|
215 |
-
|
216 |
-
// FB Analytics
|
217 |
-
function ht_ctc_fb_an( return_type, id ) {
|
218 |
-
|
219 |
-
var fb_event_name = 'Click to Chat for WhatsApp';
|
220 |
-
|
221 |
-
var params = {};
|
222 |
-
params['Category'] = 'Click to Chat for WhatsApp';
|
223 |
-
params['return_type'] = return_type;
|
224 |
-
params['ID'] = id;
|
225 |
-
params['Label'] = post_title + ', ' + url ;
|
226 |
-
|
227 |
-
if (typeof FB !== "undefined") {
|
228 |
-
FB.AppEvents.logEvent( fb_event_name, null, params);
|
229 |
-
}
|
230 |
-
}
|
1 |
+
var ht_ctc_v="2.12.1",url=window.location.href,is_mobile="yes";void 0!==screen.width&&(is_mobile=1024<screen.width?"no":"yes");var post_title=void 0!==document.title?document.title:"";function afterdom_loaded(){"complete"==document.readyState||"interactive"==document.readyState?ht_ctc():document.addEventListener("DOMContentLoaded",ht_ctc)}function ht_ctc_loaded(){afterdom_loaded()}function ht_ctc(){var t=document.querySelector(".ht-ctc-chat");t&&hide_basedon_device(t);var e=document.querySelector(".ht-ctc-share");e&&hide_basedon_device(e);var a=document.querySelector(".ht-ctc-group");a&&hide_basedon_device(a)}function hide_basedon_device(t){var e,a,n,o;"yes"==is_mobile?"show"==t.getAttribute("data-display_mobile")&&((a=document.querySelector(".ht_ctc_desktop_"+t.getAttribute("data-return_type")))&&a.remove(),n=t.getAttribute("data-css"),e=t.getAttribute("data-position_mobile"),t.style.cssText=e+n,display(t)):"show"==t.getAttribute("data-display_desktop")&&((a=document.querySelector(".ht_ctc_mobile_"+t.getAttribute("data-return_type")))&&a.remove(),n=t.getAttribute("data-css"),o=t.getAttribute("data-position"),t.style.cssText=o+n,display(t))}function display(t){t.style.display="block"}function ht_ctc_shortcode_click(t){data_link=t.getAttribute("data-ctc-link"),data_link=encodeURI(data_link),window.open(data_link,"_blank","noopener"),ht_ctc_analytics(t)}function ht_ctc_click(t){ht_ctc_link(t),ht_ctc_analytics(t)}function ht_ctc_link(t){var e=t.getAttribute("data-return_type");if("group"==e){var a="https://chat.whatsapp.com/",n=t.getAttribute("data-group_id");window.open(a+n,"_blank","noopener")}else if("share"==e){var o=t.getAttribute("data-share_text"),i="api";"webapi"==(c=t.getAttribute("data-webandapi"))&&(i="yes"==is_mobile?"api":"web");a="https://"+i+".whatsapp.com/send";window.open(a+"?text="+o,"_blank","noopener")}else{var r=t.getAttribute("data-number"),d=t.getAttribute("data-pre_filled"),d=encodeURIComponent(d),c=t.getAttribute("data-webandapi");if(""==r&&t.classList.contains("admin"))return void(t.innerHTML="<p style='background-color: #ffffff; margin:0; border: 1px solid #fbfbfb; padding:11px; border-radius:4px; box-shadow: 5px 10px 8px #888888;'>No WhatsApp Number Found!<br><small style='color: red;'>Admin Notice:<br></small><small>Add WhatsApp number at pluign Settings<br>If already added, <strong>clear the Cache</strong> and try.<br>If still an issue, please contact plugin developers</small></p>");if(""==r)return void(t.innerHTML="<p>No WhatsApp Number Found!</p>");"webapi"==c?(a="yes"==is_mobile?"https://api.whatsapp.com/send":"https://web.whatsapp.com/send",window.open(a+"?phone="+r+"&text="+d,"_blank","noopener")):(a="https://wa.me/",window.open(a+r+"?text="+d,"_blank","noopener"))}}function ht_ctc_analytics(t){var e=t.getAttribute("data-return_type"),a="";"chat"==e?a=t.getAttribute("data-number"):"group"==e?a=t.getAttribute("data-group_id"):"share"==e&&(a=t.getAttribute("data-share_text")),ht_ctc_ga(e,a,t),"yes"==t.getAttribute("data-is_fb_pixel")&&ht_ctc_fb_pixel(e,a),"yes"==t.getAttribute("data-is_fb_an_enable")&&ht_ctc_fb_an(e,a)}function ht_ctc_ga(t,e,a){var n="Click to Chat for WhatsApp",o=t+": "+e,i=post_title+", "+url;"yes"==a.getAttribute("data-is_ga_enable")&&("undefined"!=typeof gtag?gtag("event",o,{event_category:n,event_label:i}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",n,o,i):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",n,o,i)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",event_category:n,event_label:i,event_action:o})}function ht_ctc_fb_pixel(t,e){"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:t,ID:e,Title:post_title,URL:url})}function ht_ctc_fb_an(t,e){var a={Category:"Click to Chat for WhatsApp"};a.return_type=t,a.ID=e,a.Label=post_title+", "+url,"undefined"!=typeof FB&&FB.AppEvents.logEvent("Click to Chat for WhatsApp",null,a)}afterdom_loaded();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
new/inc/assets/js/app.test.js
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var ht_ctc_v = "2.11"
|
2 |
+
, url = window.location.href
|
3 |
+
, is_mobile = "yes";
|
4 |
+
void 0 !== screen.width && (is_mobile = 1024 < screen.width ? "no" : "yes");
|
5 |
+
var post_title = void 0 !== document.title ? document.title : "";
|
6 |
+
function afterdom_loaded() {
|
7 |
+
"complete" == document.readyState || "interactive" == document.readyState ? ht_ctc() : document.addEventListener("DOMContentLoaded", ht_ctc)
|
8 |
+
}
|
9 |
+
function ht_ctc_loaded() {
|
10 |
+
afterdom_loaded()
|
11 |
+
}
|
12 |
+
function ht_ctc() {
|
13 |
+
var t = document.querySelector(".ht-ctc-chat");
|
14 |
+
t && hide_basedon_device(t);
|
15 |
+
var e = document.querySelector(".ht-ctc-share");
|
16 |
+
e && hide_basedon_device(e);
|
17 |
+
var a = document.querySelector(".ht-ctc-group");
|
18 |
+
a && hide_basedon_device(a)
|
19 |
+
}
|
20 |
+
function hide_basedon_device(t) {
|
21 |
+
var e, a, n, o;
|
22 |
+
"yes" == is_mobile ? "show" == t.getAttribute("data-display_mobile") && ((a = document.querySelector(".ht_ctc_desktop_" + t.getAttribute("data-return_type"))) && a.remove(),
|
23 |
+
n = t.getAttribute("data-css"),
|
24 |
+
e = t.getAttribute("data-position_mobile"),
|
25 |
+
t.style.cssText = e + n,
|
26 |
+
display(t)) : "show" == t.getAttribute("data-display_desktop") && ((a = document.querySelector(".ht_ctc_mobile_" + t.getAttribute("data-return_type"))) && a.remove(),
|
27 |
+
n = t.getAttribute("data-css"),
|
28 |
+
o = t.getAttribute("data-position"),
|
29 |
+
t.style.cssText = o + n,
|
30 |
+
display(t))
|
31 |
+
}
|
32 |
+
function display(t) {
|
33 |
+
t.style.display = "block"
|
34 |
+
}
|
35 |
+
function ht_ctc_shortcode_click(t) {
|
36 |
+
data_link = t.getAttribute("data-ctc-link"),
|
37 |
+
data_link = encodeURI(data_link),
|
38 |
+
window.open(data_link, "_blank", "noopener"),
|
39 |
+
ht_ctc_analytics(t)
|
40 |
+
}
|
41 |
+
function ht_ctc_click(t) {
|
42 |
+
ht_ctc_link(t),
|
43 |
+
ht_ctc_analytics(t)
|
44 |
+
}
|
45 |
+
function ht_ctc_link(t) {
|
46 |
+
var e = t.getAttribute("data-return_type");
|
47 |
+
if ("group" == e) {
|
48 |
+
var a = "https://chat.whatsapp.com/"
|
49 |
+
, n = t.getAttribute("data-group_id");
|
50 |
+
window.open(a + n, "_blank", "noopener")
|
51 |
+
} else if ("share" == e) {
|
52 |
+
var o = t.getAttribute("data-share_text")
|
53 |
+
, i = "api";
|
54 |
+
"webapi" == (c = t.getAttribute("data-webandapi")) && (i = "yes" == is_mobile ? "api" : "web");
|
55 |
+
a = "https://" + i + ".whatsapp.com/send";
|
56 |
+
window.open(a + "?text=" + o, "_blank", "noopener")
|
57 |
+
} else {
|
58 |
+
var r = t.getAttribute("data-number")
|
59 |
+
, d = t.getAttribute("data-pre_filled")
|
60 |
+
, d = encodeURIComponent(d)
|
61 |
+
, c = t.getAttribute("data-webandapi");
|
62 |
+
if ("" == r && t.classList.contains("admin"))
|
63 |
+
return void (t.innerHTML = "<p style='background-color: #ffffff; margin:0; border: 1px solid #fbfbfb; padding:11px; border-radius:4px; box-shadow: 5px 10px 8px #888888;'>No WhatsApp Number Found!<br><small style='color: red;'>Admin Notice:<br></small><small>Add WhatsApp number at pluign Settings<br>If already added, <strong>clear the Cache</strong> and try.<br>If still an issue, please contact plugin developers</small></p>");
|
64 |
+
if ("" == r)
|
65 |
+
return void (t.innerHTML = "<p>No WhatsApp Number Found!</p>");
|
66 |
+
"webapi" == c ? (a = "yes" == is_mobile ? "https://api.whatsapp.com/send" : "https://web.whatsapp.com/send",
|
67 |
+
window.open(a + "?phone=" + r + "&text=" + d, "_blank", "noopener")) : (a = "https://wa.me/",
|
68 |
+
window.open(a + r + "?text=" + d, "_blank", "noopener"))
|
69 |
+
}
|
70 |
+
}
|
71 |
+
function ht_ctc_analytics(t) {
|
72 |
+
var e = t.getAttribute("data-return_type")
|
73 |
+
, a = "";
|
74 |
+
"chat" == e ? a = t.getAttribute("data-number") : "group" == e ? a = t.getAttribute("data-group_id") : "share" == e && (a = t.getAttribute("data-share_text")),
|
75 |
+
ht_ctc_ga(e, a, t),
|
76 |
+
"yes" == t.getAttribute("data-is_fb_pixel") && ht_ctc_fb_pixel(e, a),
|
77 |
+
"yes" == t.getAttribute("data-is_fb_an_enable") && ht_ctc_fb_an(e, a)
|
78 |
+
}
|
79 |
+
function ht_ctc_ga(t, e, a) {
|
80 |
+
var n = "Click to Chat for WhatsApp"
|
81 |
+
, o = t + ": " + e
|
82 |
+
, i = post_title + ", " + url;
|
83 |
+
"yes" == a.getAttribute("data-is_ga_enable") && ("undefined" != typeof gtag ? gtag("event", o, {
|
84 |
+
event_category: n,
|
85 |
+
event_label: i
|
86 |
+
}) : "undefined" != typeof ga && void 0 !== ga.getAll ? ga.getAll()[0].send("event", n, o, i) : "undefined" != typeof __gaTracker && __gaTracker("send", "event", n, o, i)),
|
87 |
+
"undefined" != typeof dataLayer && dataLayer.push({
|
88 |
+
event: "Click to Chat",
|
89 |
+
event_category: n,
|
90 |
+
event_label: i,
|
91 |
+
event_action: o
|
92 |
+
})
|
93 |
+
}
|
94 |
+
function ht_ctc_fb_pixel(t, e) {
|
95 |
+
"undefined" != typeof fbq && fbq("trackCustom", "Click to Chat by HoliThemes", {
|
96 |
+
Category: "Click to Chat for WhatsApp",
|
97 |
+
return_type: t,
|
98 |
+
ID: e,
|
99 |
+
Title: post_title,
|
100 |
+
URL: url
|
101 |
+
})
|
102 |
+
}
|
103 |
+
function ht_ctc_fb_an(t, e) {
|
104 |
+
var a = {
|
105 |
+
Category: "Click to Chat for WhatsApp"
|
106 |
+
};
|
107 |
+
a.return_type = t,
|
108 |
+
a.ID = e,
|
109 |
+
a.Label = post_title + ", " + url,
|
110 |
+
"undefined" != typeof FB && FB.AppEvents.logEvent("Click to Chat for WhatsApp", null, a)
|
111 |
+
}
|
112 |
+
afterdom_loaded();
|
new/inc/chat/chat-position.php
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
*
|
4 |
-
* @included from - class-ht-ctc-chat.php
|
5 |
-
*
|
6 |
-
* position to place ..
|
7 |
-
*/
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
$side_1 = esc_attr( $options['side_1'] );
|
12 |
-
$side_1_value = esc_attr( $options['side_1_value'] );
|
13 |
-
|
14 |
-
$side_2 = esc_attr( $options['side_2'] );
|
15 |
-
$side_2_value = esc_attr( $options['side_2_value'] );
|
16 |
-
|
17 |
-
$position = "$side_1: $side_1_value; $side_2: $side_2_value;";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
new/inc/chat/class-ht-ctc-chat-shortcode.php
CHANGED
@@ -13,7 +13,6 @@ if ( ! class_exists( 'HT_CTC_Chat_Shortcode' ) ) :
|
|
13 |
|
14 |
class HT_CTC_Chat_Shortcode {
|
15 |
|
16 |
-
|
17 |
// Register shortcode
|
18 |
public function shortcodes_init() {
|
19 |
add_shortcode( 'ht-ctc-chat', array( $this, 'shortcode' ) );
|
@@ -23,7 +22,6 @@ class HT_CTC_Chat_Shortcode {
|
|
23 |
public function shortcode( $atts = [], $content = null, $shortcode = '' ) {
|
24 |
|
25 |
$options = get_option( 'ht_ctc_chat_options' );
|
26 |
-
$main_options = ht_ctc()->values->ctc_main_options;
|
27 |
|
28 |
$number_db = esc_attr( $options['number'] );
|
29 |
$call_to_action_db = esc_attr( $options['call_to_action'] );
|
@@ -33,11 +31,6 @@ class HT_CTC_Chat_Shortcode {
|
|
33 |
$call_to_action = __( $call_to_action_db , 'click-to-chat-for-whatsapp' );
|
34 |
$pre_filled = __( $pre_filled_db , 'click-to-chat-for-whatsapp' );
|
35 |
|
36 |
-
// if random number feature, this have to modify (ltrim, preg_replace)
|
37 |
-
// $number = preg_replace('/[^0-9,\s]/', '', $number );
|
38 |
-
$number = preg_replace('/\D/', '', $number );
|
39 |
-
$number = ltrim( $number, '0' );
|
40 |
-
|
41 |
$style_desktop = esc_attr( $options['style_desktop'] );
|
42 |
$style_mobile = esc_attr( $options['style_mobile'] );
|
43 |
|
@@ -68,7 +61,6 @@ class HT_CTC_Chat_Shortcode {
|
|
68 |
'home' => '', // home - to hide on experts ..
|
69 |
'hide_mobile' => '',
|
70 |
'hide_desktop' => '',
|
71 |
-
// 'inline_issue' => '',
|
72 |
|
73 |
's5_img_position' => '', //left, right
|
74 |
's8_width' => '',
|
@@ -77,10 +69,14 @@ class HT_CTC_Chat_Shortcode {
|
|
77 |
), $atts, $shortcode );
|
78 |
// use like - '.$a["title"].'
|
79 |
|
80 |
-
|
81 |
// number
|
82 |
$number = $a["number"];
|
83 |
|
|
|
|
|
|
|
|
|
|
|
84 |
// pre-filled text
|
85 |
$page_url = get_permalink();
|
86 |
$post_title = esc_html( get_the_title() );
|
@@ -138,7 +134,7 @@ class HT_CTC_Chat_Shortcode {
|
|
138 |
$css .= 'display:none;';
|
139 |
}
|
140 |
|
141 |
-
// By default
|
142 |
// if plan to show, then add hide='show' ( actually something not equal to 'hide' )
|
143 |
if ( 'fixed' == $position && 'show' !== $home && ( is_home() || is_category() || is_archive() ) ) {
|
144 |
$css .= 'display:none;';
|
@@ -163,7 +159,15 @@ class HT_CTC_Chat_Shortcode {
|
|
163 |
|
164 |
// call to action
|
165 |
$call_to_action = $a["call_to_action"];
|
166 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
|
168 |
// analytics
|
169 |
$is_ga_enable = apply_filters( 'ht_ctc_fh_is_ga_enable', 'no' );
|
@@ -177,13 +181,13 @@ class HT_CTC_Chat_Shortcode {
|
|
177 |
$sc_path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles-shortcode/sc-style-' . $style. '.php';
|
178 |
|
179 |
if ( is_file( $sc_path ) ) {
|
180 |
-
$o .= '<div onclick="ht_ctc_shortcode_click(this);" data-ctc-link="'.$link.'" data-return_type="'.$return_type.'" data-style="'.$style.'" data-is_ga_enable="'.$is_ga_enable.'" data-is_fb_an_enable="'.$is_fb_an_enable.'" data-is_fb_pixel="'.$is_fb_pixel.'" style="display: inline; cursor: pointer; z-index: 99999999; '.$css.'" class="'.$class_names.' ht-ctc-inline">';
|
181 |
include $sc_path;
|
182 |
$o .= '</div>';
|
183 |
} else {
|
184 |
// if style is not in the list..
|
185 |
$img_link = plugins_url("./new/inc/assets/img/whatsapp-logo.svg", HT_CTC_PLUGIN_FILE );
|
186 |
-
$o .= '<div onclick="ht_ctc_shortcode_click(this);" data-ctc-link="'.$link.'" data-return_type="'.$return_type.'" data-is_ga_enable="'.$is_ga_enable.'" data-is_fb_an_enable="'.$is_fb_an_enable.'" data-is_fb_pixel="'.$is_fb_pixel.'" style="display: inline; cursor: pointer; z-index: 99999999; '.$css.'" class="'.$class_names.' ht-ctc-inline">';
|
187 |
$o .= '<img class="img-icon-sc sc_item pointer style-3-sc" src="'.$img_link.'" alt="WhatsApp chat" style="height: 50px; '.$css.' " >';
|
188 |
$o .= '</div>';
|
189 |
}
|
13 |
|
14 |
class HT_CTC_Chat_Shortcode {
|
15 |
|
|
|
16 |
// Register shortcode
|
17 |
public function shortcodes_init() {
|
18 |
add_shortcode( 'ht-ctc-chat', array( $this, 'shortcode' ) );
|
22 |
public function shortcode( $atts = [], $content = null, $shortcode = '' ) {
|
23 |
|
24 |
$options = get_option( 'ht_ctc_chat_options' );
|
|
|
25 |
|
26 |
$number_db = esc_attr( $options['number'] );
|
27 |
$call_to_action_db = esc_attr( $options['call_to_action'] );
|
31 |
$call_to_action = __( $call_to_action_db , 'click-to-chat-for-whatsapp' );
|
32 |
$pre_filled = __( $pre_filled_db , 'click-to-chat-for-whatsapp' );
|
33 |
|
|
|
|
|
|
|
|
|
|
|
34 |
$style_desktop = esc_attr( $options['style_desktop'] );
|
35 |
$style_mobile = esc_attr( $options['style_mobile'] );
|
36 |
|
61 |
'home' => '', // home - to hide on experts ..
|
62 |
'hide_mobile' => '',
|
63 |
'hide_desktop' => '',
|
|
|
64 |
|
65 |
's5_img_position' => '', //left, right
|
66 |
's8_width' => '',
|
69 |
), $atts, $shortcode );
|
70 |
// use like - '.$a["title"].'
|
71 |
|
|
|
72 |
// number
|
73 |
$number = $a["number"];
|
74 |
|
75 |
+
// if random number feature, this have to modify (ltrim, preg_replace)
|
76 |
+
// $number = preg_replace('/[^0-9,\s]/', '', $number );
|
77 |
+
$number = preg_replace('/\D/', '', $number );
|
78 |
+
$number = ltrim( $number, '0' );
|
79 |
+
|
80 |
// pre-filled text
|
81 |
$page_url = get_permalink();
|
82 |
$post_title = esc_html( get_the_title() );
|
134 |
$css .= 'display:none;';
|
135 |
}
|
136 |
|
137 |
+
// By default position: fixed style hide on home screen,
|
138 |
// if plan to show, then add hide='show' ( actually something not equal to 'hide' )
|
139 |
if ( 'fixed' == $position && 'show' !== $home && ( is_home() || is_category() || is_archive() ) ) {
|
140 |
$css .= 'display:none;';
|
159 |
|
160 |
// call to action
|
161 |
$call_to_action = $a["call_to_action"];
|
162 |
+
|
163 |
+
if ( '' == $call_to_action ) {
|
164 |
+
if ( '1' == $style || '4' == $style || '6' == $style || '8' == $style ) {
|
165 |
+
$call_to_action = "WhatsApp us";
|
166 |
+
}
|
167 |
+
}
|
168 |
+
|
169 |
+
$type = "chat-sc";
|
170 |
+
$class_names = "ht-ctc-sc ht-ctc-sc-chat sc-style-$style";
|
171 |
|
172 |
// analytics
|
173 |
$is_ga_enable = apply_filters( 'ht_ctc_fh_is_ga_enable', 'no' );
|
181 |
$sc_path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles-shortcode/sc-style-' . $style. '.php';
|
182 |
|
183 |
if ( is_file( $sc_path ) ) {
|
184 |
+
$o .= '<div onclick="ht_ctc_shortcode_click(this);" data-ctc-link="'.$link.'" data-return_type="'.$return_type.'" data-number="'.$number.'" data-style="'.$style.'" data-is_ga_enable="'.$is_ga_enable.'" data-is_fb_an_enable="'.$is_fb_an_enable.'" data-is_fb_pixel="'.$is_fb_pixel.'" style="display: inline; cursor: pointer; z-index: 99999999; '.$css.'" class="'.$class_names.' ht-ctc-inline">';
|
185 |
include $sc_path;
|
186 |
$o .= '</div>';
|
187 |
} else {
|
188 |
// if style is not in the list..
|
189 |
$img_link = plugins_url("./new/inc/assets/img/whatsapp-logo.svg", HT_CTC_PLUGIN_FILE );
|
190 |
+
$o .= '<div onclick="ht_ctc_shortcode_click(this);" data-ctc-link="'.$link.'" data-return_type="'.$return_type.'" data-number="'.$number.'" data-is_ga_enable="'.$is_ga_enable.'" data-is_fb_an_enable="'.$is_fb_an_enable.'" data-is_fb_pixel="'.$is_fb_pixel.'" style="display: inline; cursor: pointer; z-index: 99999999; '.$css.'" class="'.$class_names.' ht-ctc-inline">';
|
191 |
$o .= '<img class="img-icon-sc sc_item pointer style-3-sc" src="'.$img_link.'" alt="WhatsApp chat" style="height: 50px; '.$css.' " >';
|
192 |
$o .= '</div>';
|
193 |
}
|
new/inc/chat/class-ht-ctc-chat.php
CHANGED
@@ -5,8 +5,6 @@
|
|
5 |
* @subpackage chat
|
6 |
*/
|
7 |
|
8 |
-
|
9 |
-
|
10 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
11 |
|
12 |
if ( ! class_exists( 'HT_CTC_Chat' ) ) :
|
@@ -17,26 +15,17 @@ class HT_CTC_Chat {
|
|
17 |
|
18 |
$options = get_option('ht_ctc_chat_options');
|
19 |
|
20 |
-
|
21 |
-
$number = esc_attr( $options['number'] );
|
22 |
-
|
23 |
-
// return if whatsapp number is blank
|
24 |
-
if ( '' == $number ) {
|
25 |
-
return;
|
26 |
-
}
|
27 |
|
28 |
-
// show/hide
|
29 |
-
// include_once HT_CTC_PLUGIN_DIR .'new/inc/chat/chat-show-hide.php';
|
30 |
include HT_CTC_PLUGIN_DIR .'new/inc/commons/show-hide.php';
|
31 |
|
32 |
if ( 'no' == $display ) {
|
33 |
return;
|
34 |
}
|
35 |
|
36 |
-
$main_options = ht_ctc()->values->ctc_main_options;
|
37 |
-
|
38 |
// position
|
39 |
-
|
40 |
|
41 |
// is mobile
|
42 |
$is_mobile = ht_ctc()->device_type->is_mobile();
|
@@ -44,53 +33,38 @@ class HT_CTC_Chat {
|
|
44 |
$wp_device = '';
|
45 |
|
46 |
// style
|
|
|
|
|
47 |
if ( 'yes' == $is_mobile ) {
|
48 |
-
$style =
|
49 |
$wp_device = 'mobile';
|
50 |
} else {
|
51 |
-
$style =
|
52 |
$wp_device = 'desktop';
|
53 |
}
|
54 |
|
55 |
-
|
56 |
-
// todo localization for number, .. ( at variables page ) - call to action for share, group
|
57 |
-
$call_to_action_db = esc_attr( $options['call_to_action'] );
|
58 |
-
$call_to_action = __( $call_to_action_db , 'click-to-chat-for-whatsapp' );
|
59 |
-
|
60 |
-
|
61 |
-
// call to action - at page level
|
62 |
-
$page_id = get_the_ID();
|
63 |
-
$page_call_to_action = esc_attr( get_post_meta( $page_id, 'ht_ctc_page_call_to_action', true ) );
|
64 |
-
|
65 |
-
if ( isset( $page_call_to_action ) && '' !== $page_call_to_action ){
|
66 |
-
$call_to_action = $page_call_to_action;
|
67 |
-
}
|
68 |
-
|
69 |
-
// class names
|
70 |
-
$class_names = "ht-ctc-chat style-$style $wp_device ctc-analytics";
|
71 |
|
72 |
$page_id = get_the_ID();
|
73 |
$page_url = get_permalink();
|
74 |
$post_title = esc_html( get_the_title() );
|
75 |
|
76 |
-
|
77 |
|
78 |
-
//
|
79 |
-
$
|
80 |
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
|
85 |
-
//
|
86 |
-
|
87 |
-
$
|
88 |
-
$number = ltrim( $number, '0' );
|
89 |
-
|
90 |
|
91 |
// prefilled text
|
92 |
-
$pre_filled = esc_attr( $options['pre_filled'] );
|
93 |
-
$pre_filled =
|
94 |
|
95 |
// analytics
|
96 |
$is_ga_enable = apply_filters( 'ht_ctc_fh_is_ga_enable', 'no' );
|
@@ -103,40 +77,85 @@ class HT_CTC_Chat {
|
|
103 |
$webandapi = 'webapi';
|
104 |
}
|
105 |
|
106 |
-
$display_mobile = 'show';
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
$
|
111 |
-
if (
|
112 |
-
$
|
113 |
}
|
114 |
|
|
|
|
|
|
|
|
|
|
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
// call style
|
117 |
$path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style. '.php';
|
118 |
|
119 |
-
|
|
|
120 |
|
|
|
|
|
|
|
|
|
121 |
do_action('ht_ctc_ah_before_fixed_position');
|
122 |
-
?>
|
123 |
-
<div onclick="ht_ctc_click(this);" class="<?php echo $class_names ?>"
|
124 |
-
style="display: none;
|
125 |
data-return_type="chat"
|
126 |
data-style="<?php echo $style ?>"
|
127 |
-
data-number="<?php echo $number ?>"
|
128 |
-
data-pre_filled="<?php echo $pre_filled ?>"
|
129 |
data-is_ga_enable="<?php echo $is_ga_enable ?>"
|
130 |
data-is_fb_pixel="<?php echo $is_fb_pixel ?>"
|
131 |
data-is_fb_an_enable="<?php echo $is_fb_an_enable ?>"
|
132 |
data-webandapi="<?php echo $webandapi ?>"
|
133 |
data-display_mobile="<?php echo $display_mobile ?>"
|
134 |
data-display_desktop="<?php echo $display_desktop ?>"
|
|
|
|
|
|
|
135 |
>
|
136 |
-
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
</div>
|
138 |
-
<script>ht_ctc_loaded()</script>
|
139 |
<?php
|
|
|
140 |
}
|
141 |
|
142 |
|
@@ -147,7 +166,10 @@ class HT_CTC_Chat {
|
|
147 |
// new HT_CTC_Chat();
|
148 |
|
149 |
$ht_ctc_chat = new HT_CTC_Chat();
|
150 |
-
add_action( 'wp_footer', array( $ht_ctc_chat, 'chat' ) );
|
151 |
|
|
|
|
|
|
|
|
|
152 |
|
153 |
endif; // END class_exists check
|
5 |
* @subpackage chat
|
6 |
*/
|
7 |
|
|
|
|
|
8 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
9 |
|
10 |
if ( ! class_exists( 'HT_CTC_Chat' ) ) :
|
15 |
|
16 |
$options = get_option('ht_ctc_chat_options');
|
17 |
|
18 |
+
$ht_ctc_chat = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
+
// show/hide
|
|
|
21 |
include HT_CTC_PLUGIN_DIR .'new/inc/commons/show-hide.php';
|
22 |
|
23 |
if ( 'no' == $display ) {
|
24 |
return;
|
25 |
}
|
26 |
|
|
|
|
|
27 |
// position
|
28 |
+
include HT_CTC_PLUGIN_DIR .'new/inc/commons/position-to-place.php';
|
29 |
|
30 |
// is mobile
|
31 |
$is_mobile = ht_ctc()->device_type->is_mobile();
|
33 |
$wp_device = '';
|
34 |
|
35 |
// style
|
36 |
+
$style_d = esc_attr( $options['style_desktop'] );
|
37 |
+
$style_m = esc_attr( $options['style_mobile'] );
|
38 |
if ( 'yes' == $is_mobile ) {
|
39 |
+
$style = $style_m;
|
40 |
$wp_device = 'mobile';
|
41 |
} else {
|
42 |
+
$style = $style_d;
|
43 |
$wp_device = 'desktop';
|
44 |
}
|
45 |
|
46 |
+
$type = "chat";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
$page_id = get_the_ID();
|
49 |
$page_url = get_permalink();
|
50 |
$post_title = esc_html( get_the_title() );
|
51 |
|
52 |
+
do_action('ht_ctc_ah_previous_metabox');
|
53 |
|
54 |
+
// page level
|
55 |
+
$ht_ctc_pagelevel = get_post_meta( $page_id, 'ht_ctc_pagelevel', true );
|
56 |
|
57 |
+
// Number
|
58 |
+
$ht_ctc_chat['number'] = (isset($ht_ctc_pagelevel['number'])) ? esc_attr($ht_ctc_pagelevel['number']) : esc_attr( $options['number'] );
|
59 |
+
$ht_ctc_chat['number'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_chat['number'], 'Click to Chat for WhatsApp', 'number' );
|
60 |
|
61 |
+
// call to action
|
62 |
+
$ht_ctc_chat['call_to_action'] = (isset($ht_ctc_pagelevel['call_to_action'])) ? esc_attr($ht_ctc_pagelevel['call_to_action']) : __( esc_attr( $options['call_to_action'] ) , 'click-to-chat-for-whatsapp' );
|
63 |
+
$ht_ctc_chat['call_to_action'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_chat['call_to_action'], 'Click to Chat for WhatsApp', 'call_to_action' );
|
|
|
|
|
64 |
|
65 |
// prefilled text
|
66 |
+
$ht_ctc_chat['pre_filled'] = esc_attr( $options['pre_filled'] );
|
67 |
+
$ht_ctc_chat['pre_filled'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_chat['pre_filled'], 'Click to Chat for WhatsApp', 'pre_filled' );
|
68 |
|
69 |
// analytics
|
70 |
$is_ga_enable = apply_filters( 'ht_ctc_fh_is_ga_enable', 'no' );
|
77 |
$webandapi = 'webapi';
|
78 |
}
|
79 |
|
80 |
+
$display_mobile = (isset($options['hideon_mobile'])) ? 'hide' : 'show';
|
81 |
+
$display_desktop = (isset($options['hideon_desktop'])) ? 'hide' : 'show';
|
82 |
+
|
83 |
+
// number not added and is administrator
|
84 |
+
$is_admin = "";
|
85 |
+
if ( '' == $ht_ctc_chat['number'] && current_user_can('administrator') ) {
|
86 |
+
$is_admin = "admin";
|
87 |
}
|
88 |
|
89 |
+
// class names
|
90 |
+
$class_names = "ht-ctc ht-ctc-chat style-$style $wp_device ctc-analytics $is_admin";
|
91 |
+
|
92 |
+
// hook
|
93 |
+
$ht_ctc_chat = apply_filters( 'ht_ctc_fh_chat', $ht_ctc_chat );
|
94 |
|
95 |
+
$ht_ctc_chat['pre_filled'] = str_replace( array('{{url}}', '{url}', '{{title}}', '{title}', '{{site}}', '{site}' ), array( $page_url, $page_url, $post_title, $post_title, HT_CTC_BLOG_NAME, HT_CTC_BLOG_NAME ), $ht_ctc_chat['pre_filled'] );
|
96 |
+
|
97 |
+
// @uses at styles
|
98 |
+
$call_to_action = $ht_ctc_chat['call_to_action'];
|
99 |
+
|
100 |
+
if ( '' == $call_to_action ) {
|
101 |
+
if ( '1' == $style || '4' == $style || '6' == $style || '8' == $style ) {
|
102 |
+
$call_to_action = "WhatsApp us";
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
+
$title = '';
|
107 |
+
if ( '2' == $style || '3' == $style ) {
|
108 |
+
$title = "title = '$call_to_action'";
|
109 |
+
}
|
110 |
+
|
111 |
+
// backend position - todo - remove this after some time... as may not need.
|
112 |
+
// Fallback support - as some cache plugins are not updated the js code
|
113 |
+
// js will replace this code.
|
114 |
+
$backend_position = $position;
|
115 |
+
|
116 |
+
$css = "display: none; cursor: pointer; z-index: 99999999;";
|
117 |
+
|
118 |
// call style
|
119 |
$path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style. '.php';
|
120 |
|
121 |
+
$path_d = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style_d. '.php';
|
122 |
+
$path_m = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style_m. '.php';
|
123 |
|
124 |
+
$othersettings = get_option('ht_ctc_othersettings');
|
125 |
+
|
126 |
+
|
127 |
+
if ( is_file( $path ) ) {
|
128 |
do_action('ht_ctc_ah_before_fixed_position');
|
129 |
+
?>
|
130 |
+
<div <?php echo $title ?> onclick="ht_ctc_click(this);" class="<?php echo $class_names ?>"
|
131 |
+
style="display: none; <?php echo $backend_position ?>"
|
132 |
data-return_type="chat"
|
133 |
data-style="<?php echo $style ?>"
|
134 |
+
data-number="<?php echo $ht_ctc_chat['number'] ?>"
|
135 |
+
data-pre_filled="<?php echo $ht_ctc_chat['pre_filled'] ?>"
|
136 |
data-is_ga_enable="<?php echo $is_ga_enable ?>"
|
137 |
data-is_fb_pixel="<?php echo $is_fb_pixel ?>"
|
138 |
data-is_fb_an_enable="<?php echo $is_fb_an_enable ?>"
|
139 |
data-webandapi="<?php echo $webandapi ?>"
|
140 |
data-display_mobile="<?php echo $display_mobile ?>"
|
141 |
data-display_desktop="<?php echo $display_desktop ?>"
|
142 |
+
data-css="<?php echo $css ?>"
|
143 |
+
data-position="<?php echo $position ?>"
|
144 |
+
data-position_mobile="<?php echo $position_mobile ?>"
|
145 |
>
|
146 |
+
<?php
|
147 |
+
if ( isset( $othersettings['select_styles_issue'] ) ) {
|
148 |
+
?>
|
149 |
+
<div class="ht_ctc_desktop_chat"><?php include $path_d; ?></div>
|
150 |
+
<div class="ht_ctc_mobile_chat"><?php include $path_m; ?></div>
|
151 |
+
<?php
|
152 |
+
} else {
|
153 |
+
include $path;
|
154 |
+
}
|
155 |
+
?>
|
156 |
</div>
|
|
|
157 |
<?php
|
158 |
+
do_action('ht_ctc_ah_after_fixed_position');
|
159 |
}
|
160 |
|
161 |
|
166 |
// new HT_CTC_Chat();
|
167 |
|
168 |
$ht_ctc_chat = new HT_CTC_Chat();
|
|
|
169 |
|
170 |
+
// wp_footer / wp_head / get_footer
|
171 |
+
$ht_ctc_chat_load_position = apply_filters( 'ht_ctc_chat_load_position', 'wp_footer' );
|
172 |
+
|
173 |
+
add_action( "$ht_ctc_chat_load_position", array( $ht_ctc_chat, 'chat' ) );
|
174 |
|
175 |
endif; // END class_exists check
|
new/inc/class-ht-ctc-main.php
CHANGED
@@ -3,7 +3,6 @@
|
|
3 |
* main file to get started for front end ..
|
4 |
*/
|
5 |
|
6 |
-
|
7 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
8 |
|
9 |
if ( ! class_exists( 'HT_CTC_Main' ) ) :
|
@@ -16,23 +15,21 @@ class HT_CTC_Main {
|
|
16 |
|
17 |
// If feature enabled load that class..
|
18 |
public function enables() {
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
// if enable call 'group' features
|
29 |
if ( isset( $options['enable_group'] ) ) {
|
30 |
include_once HT_CTC_PLUGIN_DIR .'new/inc/group/class-ht-ctc-group.php';
|
31 |
include_once HT_CTC_PLUGIN_DIR . 'new/inc/group/class-ht-ctc-group-shortcode.php';
|
32 |
|
33 |
}
|
34 |
|
35 |
-
// if enabled call 'share'
|
36 |
if ( isset( $options['enable_share'] ) ) {
|
37 |
include_once HT_CTC_PLUGIN_DIR .'new/inc/share/class-ht-ctc-share.php';
|
38 |
include_once HT_CTC_PLUGIN_DIR . 'new/inc/share/class-ht-ctc-share-shortcode.php';
|
@@ -40,8 +37,6 @@ class HT_CTC_Main {
|
|
40 |
}
|
41 |
}
|
42 |
|
43 |
-
|
44 |
-
|
45 |
}
|
46 |
|
47 |
new HT_CTC_Main();
|
3 |
* main file to get started for front end ..
|
4 |
*/
|
5 |
|
|
|
6 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
7 |
|
8 |
if ( ! class_exists( 'HT_CTC_Main' ) ) :
|
15 |
|
16 |
// If feature enabled load that class..
|
17 |
public function enables() {
|
18 |
+
|
19 |
+
// 'chat' feature
|
20 |
+
include_once HT_CTC_PLUGIN_DIR .'new/inc/chat/class-ht-ctc-chat.php';
|
21 |
+
include_once HT_CTC_PLUGIN_DIR . 'new/inc/chat/class-ht-ctc-chat-shortcode.php';
|
22 |
+
|
23 |
+
$options = get_option( 'ht_ctc_othersettings' );
|
24 |
+
|
25 |
+
// if enable call 'group' feature
|
|
|
|
|
26 |
if ( isset( $options['enable_group'] ) ) {
|
27 |
include_once HT_CTC_PLUGIN_DIR .'new/inc/group/class-ht-ctc-group.php';
|
28 |
include_once HT_CTC_PLUGIN_DIR . 'new/inc/group/class-ht-ctc-group-shortcode.php';
|
29 |
|
30 |
}
|
31 |
|
32 |
+
// if enabled call 'share' feature
|
33 |
if ( isset( $options['enable_share'] ) ) {
|
34 |
include_once HT_CTC_PLUGIN_DIR .'new/inc/share/class-ht-ctc-share.php';
|
35 |
include_once HT_CTC_PLUGIN_DIR . 'new/inc/share/class-ht-ctc-share-shortcode.php';
|
37 |
}
|
38 |
}
|
39 |
|
|
|
|
|
40 |
}
|
41 |
|
42 |
new HT_CTC_Main();
|
new/inc/class-ht-ctc-register.php
CHANGED
@@ -1,14 +1,12 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
4 |
-
*
|
5 |
-
*
|
6 |
-
*
|
7 |
-
*
|
8 |
-
*
|
9 |
-
|
10 |
-
* @since 2.0
|
11 |
-
*/
|
12 |
|
13 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
14 |
|
@@ -19,7 +17,6 @@ class HT_CTC_Register {
|
|
19 |
// when plugin activate
|
20 |
public static function activate() {
|
21 |
|
22 |
-
|
23 |
if( version_compare( get_bloginfo('version'), '3.1.0', '<') ) {
|
24 |
wp_die( 'please update WordPress' );
|
25 |
}
|
@@ -34,35 +31,36 @@ class HT_CTC_Register {
|
|
34 |
|
35 |
// when plugin uninstall
|
36 |
public static function uninstall() {
|
37 |
-
|
38 |
$options = get_option( 'ht_ctc_othersettings' );
|
39 |
|
40 |
-
// delete plugin settings from db
|
41 |
if ( isset ( $options['delete_options'] ) ) {
|
42 |
|
|
|
|
|
|
|
43 |
delete_option( 'ht_ctc_main_options' );
|
44 |
delete_option( 'ht_ctc_chat_options' );
|
45 |
delete_option( 'ht_ctc_plugin_details' );
|
46 |
delete_option( 'ht_ctc_group' );
|
47 |
-
delete_option( 'ht_ctc_share' );
|
48 |
delete_option( 'ht_ctc_one_time' );
|
49 |
-
delete_option( '
|
50 |
-
delete_option( 'ht_ctc_s1' );
|
51 |
-
delete_option( 'ht_ctc_s2' );
|
52 |
-
delete_option( 'ht_ctc_s3' );
|
53 |
-
delete_option( 'ht_ctc_s4' );
|
54 |
-
delete_option( 'ht_ctc_s5' );
|
55 |
-
delete_option( 'ht_ctc_s6' );
|
56 |
-
delete_option( 'ht_ctc_s7' );
|
57 |
-
delete_option( 'ht_ctc_s8' );
|
58 |
-
delete_option( 'ht_ctc_s99' );
|
59 |
|
60 |
delete_option( 'ccw_options' );
|
61 |
delete_option( 'ccw_options_cs' );
|
62 |
delete_option( 'ht_ccw_ga' );
|
63 |
delete_option( 'ht_ccw_fb' );
|
64 |
-
|
65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
}
|
67 |
|
68 |
}
|
@@ -72,7 +70,7 @@ class HT_CTC_Register {
|
|
72 |
|
73 |
$ht_ctc_plugin_details = get_option('ht_ctc_plugin_details');
|
74 |
|
75 |
-
if ( HT_CTC_VERSION !== $ht_ctc_plugin_details['version'] ) {
|
76 |
// to update the plugin - just like activate plugin
|
77 |
self::activate();
|
78 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Activate
|
4 |
+
* deactivate (no custom post types or so.. to flush rewrite rules)
|
5 |
+
* uninstall ( delete if set )
|
6 |
+
*
|
7 |
+
* @package ctc
|
8 |
+
* @since 2.0
|
9 |
+
*/
|
|
|
|
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
12 |
|
17 |
// when plugin activate
|
18 |
public static function activate() {
|
19 |
|
|
|
20 |
if( version_compare( get_bloginfo('version'), '3.1.0', '<') ) {
|
21 |
wp_die( 'please update WordPress' );
|
22 |
}
|
31 |
|
32 |
// when plugin uninstall
|
33 |
public static function uninstall() {
|
34 |
+
|
35 |
$options = get_option( 'ht_ctc_othersettings' );
|
36 |
|
|
|
37 |
if ( isset ( $options['delete_options'] ) ) {
|
38 |
|
39 |
+
global $wpdb;
|
40 |
+
|
41 |
+
// $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE 'ht\_ctc\_%';" );
|
42 |
delete_option( 'ht_ctc_main_options' );
|
43 |
delete_option( 'ht_ctc_chat_options' );
|
44 |
delete_option( 'ht_ctc_plugin_details' );
|
45 |
delete_option( 'ht_ctc_group' );
|
|
|
46 |
delete_option( 'ht_ctc_one_time' );
|
47 |
+
delete_option( 'ht_ctc_othersettings' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
delete_option( 'ccw_options' );
|
50 |
delete_option( 'ccw_options_cs' );
|
51 |
delete_option( 'ht_ccw_ga' );
|
52 |
delete_option( 'ht_ccw_fb' );
|
53 |
+
|
54 |
+
// deletes custom styles, share, switch
|
55 |
+
$wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE 'ht\_ctc\_s%';" );
|
56 |
+
|
57 |
+
// deletes page level settings
|
58 |
+
$wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key LIKE 'ht\_ctc\_page%';" );
|
59 |
+
}
|
60 |
+
|
61 |
+
// clear cache
|
62 |
+
if ( function_exists('wp_cache_flush') ) {
|
63 |
+
wp_cache_flush();
|
64 |
}
|
65 |
|
66 |
}
|
70 |
|
71 |
$ht_ctc_plugin_details = get_option('ht_ctc_plugin_details');
|
72 |
|
73 |
+
if ( isset($ht_ctc_plugin_details['version']) && HT_CTC_VERSION !== $ht_ctc_plugin_details['version'] ) {
|
74 |
// to update the plugin - just like activate plugin
|
75 |
self::activate();
|
76 |
|
new/inc/commons/class-ht-ctc-hooks.php
CHANGED
@@ -22,21 +22,65 @@ class HT_CTC_Hooks {
|
|
22 |
}
|
23 |
|
24 |
private function hooks() {
|
25 |
-
//
|
26 |
add_action( 'ht_ctc_ah_before_fixed_position', array($this, 'comment') );
|
27 |
|
28 |
-
//
|
|
|
|
|
|
|
|
|
29 |
add_filter( 'ht_ctc_fh_is_ga_enable', array($this, 'is_ga_enable') );
|
30 |
add_filter( 'ht_ctc_fh_is_fb_pixel', array($this, 'is_fb_pixel') );
|
31 |
add_filter( 'ht_ctc_fh_is_fb_an_enable', array($this, 'is_fb_an_enable') );
|
|
|
|
|
|
|
|
|
|
|
32 |
}
|
33 |
|
34 |
-
|
|
|
|
|
|
|
|
|
35 |
function comment() {
|
36 |
$comment = "<!-- Click to Chat - https://holithemes.com/plugins/click-to-chat/ v$this->version -->";
|
37 |
echo $comment;
|
38 |
}
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
// is_ga_enable
|
41 |
function is_ga_enable( $is_ga_enable ) {
|
42 |
return (isset( $this->main_options['google_analytics'] )) ? 'yes' : $is_ga_enable;
|
@@ -52,6 +96,52 @@ class HT_CTC_Hooks {
|
|
52 |
return (isset( $this->other_options['fb_analytics'] )) ? 'yes' : $is_fb_an_enable;
|
53 |
}
|
54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
|
57 |
}
|
22 |
}
|
23 |
|
24 |
private function hooks() {
|
25 |
+
// ## Action Hooks ##
|
26 |
add_action( 'ht_ctc_ah_before_fixed_position', array($this, 'comment') );
|
27 |
|
28 |
+
// if an issue with cache plugin
|
29 |
+
// add_action( 'ht_ctc_ah_after_fixed_position', array($this, 'scripts') );
|
30 |
+
|
31 |
+
// ## Filter Hooks ##
|
32 |
+
add_filter( 'ht_ctc_fh_chat', array($this, 'ht_ctc_chat') );
|
33 |
add_filter( 'ht_ctc_fh_is_ga_enable', array($this, 'is_ga_enable') );
|
34 |
add_filter( 'ht_ctc_fh_is_fb_pixel', array($this, 'is_fb_pixel') );
|
35 |
add_filter( 'ht_ctc_fh_is_fb_an_enable', array($this, 'is_fb_an_enable') );
|
36 |
+
add_filter( 'ht_ctc_fh_load_app_js_bottom', array($this, 'load_app_js_bottom') );
|
37 |
+
|
38 |
+
// previous metaboxes to new
|
39 |
+
add_action( 'ht_ctc_ah_previous_metabox', array($this, 'previous_metabox') );
|
40 |
+
|
41 |
}
|
42 |
|
43 |
+
/**
|
44 |
+
* Action Hooks
|
45 |
+
*/
|
46 |
+
|
47 |
+
// comment before floting styles
|
48 |
function comment() {
|
49 |
$comment = "<!-- Click to Chat - https://holithemes.com/plugins/click-to-chat/ v$this->version -->";
|
50 |
echo $comment;
|
51 |
}
|
52 |
|
53 |
+
function scripts() {
|
54 |
+
|
55 |
+
// autoptimize cache plugin
|
56 |
+
// as some plugin/theme js have errors and blocks the other scripts. so added like this.
|
57 |
+
if( class_exists('autoptimizeCache') ) {
|
58 |
+
?>
|
59 |
+
<script>setTimeout(function(){try{ht_ctc_loaded();}catch(e){}},3000);</script>
|
60 |
+
<?php
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Filter Hooks
|
67 |
+
*/
|
68 |
+
|
69 |
+
// number format
|
70 |
+
function ht_ctc_chat( $ht_ctc_chat ) {
|
71 |
+
|
72 |
+
// Number format
|
73 |
+
// if random number feature, this have to modify (ltrim, preg_replace)
|
74 |
+
// $ht_ctc_chat['number'] = preg_replace('/[^0-9,\s]/', '', $ht_ctc_chat['number'] );
|
75 |
+
if( isset($ht_ctc_chat['number']) ) {
|
76 |
+
$ht_ctc_chat['number'] = preg_replace('/\D/', '', $ht_ctc_chat['number'] );
|
77 |
+
$ht_ctc_chat['number'] = ltrim( $ht_ctc_chat['number'], '0' );
|
78 |
+
}
|
79 |
+
|
80 |
+
return $ht_ctc_chat;
|
81 |
+
}
|
82 |
+
|
83 |
+
|
84 |
// is_ga_enable
|
85 |
function is_ga_enable( $is_ga_enable ) {
|
86 |
return (isset( $this->main_options['google_analytics'] )) ? 'yes' : $is_ga_enable;
|
96 |
return (isset( $this->other_options['fb_analytics'] )) ? 'yes' : $is_fb_an_enable;
|
97 |
}
|
98 |
|
99 |
+
function load_app_js_bottom( $load_app_js_bottom ) {
|
100 |
+
|
101 |
+
// compatibility
|
102 |
+
// autoptimize cache plugin
|
103 |
+
if( class_exists('autoptimizeCache') ) {
|
104 |
+
$load_app_js_bottom = false;
|
105 |
+
}
|
106 |
+
return $load_app_js_bottom;
|
107 |
+
}
|
108 |
+
|
109 |
+
|
110 |
+
// update from previous method
|
111 |
+
function previous_metabox() {
|
112 |
+
|
113 |
+
$post_id = get_the_ID();
|
114 |
+
$ht_ctc_pagelevel = get_post_meta( $post_id, 'ht_ctc_pagelevel', true );
|
115 |
+
|
116 |
+
if ( !isset($ht_ctc_pagelevel) || empty($ht_ctc_pagelevel) ) {
|
117 |
+
$prev_number = esc_attr( get_post_meta( $post_id, 'ht_ctc_page_number', true ) );
|
118 |
+
$prev_number = (isset($prev_number)) ? $prev_number : '';
|
119 |
+
$prev_call_to_action = esc_attr( get_post_meta( $post_id, 'ht_ctc_page_call_to_action', true ) );
|
120 |
+
$prev_call_to_action = (isset($prev_call_to_action)) ? $prev_call_to_action : '';
|
121 |
+
$prev_group_id = esc_attr( get_post_meta( $post_id, 'ht_ctc_page_group_id', true ) );
|
122 |
+
$prev_group_id = (isset($prev_group_id)) ? $prev_group_id : '';
|
123 |
+
|
124 |
+
$prev_ht_ctc_pagelevel = array();
|
125 |
+
if ( '' !== $prev_number ) {
|
126 |
+
$prev_ht_ctc_pagelevel['number'] = $prev_number;
|
127 |
+
}
|
128 |
+
if ( '' !== $prev_call_to_action ) {
|
129 |
+
$prev_ht_ctc_pagelevel['call_to_action'] = $prev_call_to_action;
|
130 |
+
}
|
131 |
+
if ( '' !== $prev_group_id ) {
|
132 |
+
$prev_ht_ctc_pagelevel['group_id'] = $prev_group_id;
|
133 |
+
}
|
134 |
+
$prev_ht_ctc_pagelevel = array_filter( $prev_ht_ctc_pagelevel );
|
135 |
+
if ( !empty( $prev_ht_ctc_pagelevel ) ) {
|
136 |
+
update_post_meta( $post_id, 'ht_ctc_pagelevel', $prev_ht_ctc_pagelevel );
|
137 |
+
}
|
138 |
+
|
139 |
+
delete_post_meta($post_id, 'ht_ctc_page_number', '' );
|
140 |
+
delete_post_meta($post_id, 'ht_ctc_page_call_to_action', '' );
|
141 |
+
delete_post_meta($post_id, 'ht_ctc_page_group_id', '' );
|
142 |
+
}
|
143 |
+
}
|
144 |
+
|
145 |
|
146 |
|
147 |
}
|
new/inc/commons/class-ht-ctc-scripts.php
CHANGED
@@ -20,6 +20,9 @@ class HT_CTC_Scripts {
|
|
20 |
*/
|
21 |
function register_scripts() {
|
22 |
|
|
|
|
|
|
|
23 |
// s7, s8 - fonts - enqueue at style page
|
24 |
wp_register_style('ht_ctc_font_css', plugins_url( 'new/inc/assets/css/font.css', HT_CTC_PLUGIN_FILE ), '', HT_CTC_VERSION );
|
25 |
|
@@ -27,7 +30,12 @@ class HT_CTC_Scripts {
|
|
27 |
wp_register_style('ht_ctc_mdstyle8_css', plugins_url( 'new/inc/assets/css/mdstyle8.css', HT_CTC_PLUGIN_FILE ) , '', HT_CTC_VERSION );
|
28 |
|
29 |
// js
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
}
|
33 |
|
20 |
*/
|
21 |
function register_scripts() {
|
22 |
|
23 |
+
// true/false
|
24 |
+
$load_app_js_bottom = apply_filters( 'ht_ctc_fh_load_app_js_bottom', true );
|
25 |
+
|
26 |
// s7, s8 - fonts - enqueue at style page
|
27 |
wp_register_style('ht_ctc_font_css', plugins_url( 'new/inc/assets/css/font.css', HT_CTC_PLUGIN_FILE ), '', HT_CTC_VERSION );
|
28 |
|
30 |
wp_register_style('ht_ctc_mdstyle8_css', plugins_url( 'new/inc/assets/css/mdstyle8.css', HT_CTC_PLUGIN_FILE ) , '', HT_CTC_VERSION );
|
31 |
|
32 |
// js
|
33 |
+
if ('production' == HT_CTC_ENVIRONMENT ) {
|
34 |
+
$js = 'app.js';
|
35 |
+
} else {
|
36 |
+
$js = 'app.dev.js';
|
37 |
+
}
|
38 |
+
wp_enqueue_script( 'ht_ctc_app_js', plugins_url( "new/inc/assets/js/$js", HT_CTC_PLUGIN_FILE ), array ( 'jquery' ), HT_CTC_VERSION, $load_app_js_bottom );
|
39 |
|
40 |
}
|
41 |
|
new/inc/commons/class-ht-ctc-values.php
CHANGED
@@ -12,22 +12,12 @@
|
|
12 |
* @since 2.0
|
13 |
*/
|
14 |
|
15 |
-
|
16 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
17 |
|
18 |
if ( ! class_exists( 'HT_CTC_Values' ) ) :
|
19 |
|
20 |
class HT_CTC_Values {
|
21 |
|
22 |
-
|
23 |
-
/**
|
24 |
-
* db options table - ht_ctc_options values
|
25 |
-
*
|
26 |
-
* @var array get_options ht_ctc_options
|
27 |
-
*/
|
28 |
-
// public $ctc_options;
|
29 |
-
|
30 |
-
|
31 |
/**
|
32 |
* db options table - ht_ctc_main_options values
|
33 |
*
|
@@ -35,10 +25,8 @@ class HT_CTC_Values {
|
|
35 |
*/
|
36 |
public $ctc_main_options;
|
37 |
|
38 |
-
|
39 |
public function __construct() {
|
40 |
$this->ctc_main_options_fn();
|
41 |
-
// $this->ctc_chat_options_fn();
|
42 |
}
|
43 |
|
44 |
// main options
|
@@ -46,11 +34,6 @@ class HT_CTC_Values {
|
|
46 |
$this->ctc_main_options = get_option('ht_ctc_main_options');
|
47 |
}
|
48 |
|
49 |
-
// chat options
|
50 |
-
// public function ctc_chat_options_fn() {
|
51 |
-
// $this->ctc_chat_options = get_option('ht_ctc_chat_options');
|
52 |
-
// }
|
53 |
-
|
54 |
|
55 |
}
|
56 |
|
12 |
* @since 2.0
|
13 |
*/
|
14 |
|
|
|
15 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
16 |
|
17 |
if ( ! class_exists( 'HT_CTC_Values' ) ) :
|
18 |
|
19 |
class HT_CTC_Values {
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
/**
|
22 |
* db options table - ht_ctc_main_options values
|
23 |
*
|
25 |
*/
|
26 |
public $ctc_main_options;
|
27 |
|
|
|
28 |
public function __construct() {
|
29 |
$this->ctc_main_options_fn();
|
|
|
30 |
}
|
31 |
|
32 |
// main options
|
34 |
$this->ctc_main_options = get_option('ht_ctc_main_options');
|
35 |
}
|
36 |
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
}
|
39 |
|
new/inc/commons/position-to-place.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* position to place
|
4 |
+
* @included from - class-ht-ctc-chat/group/share.php
|
5 |
+
*/
|
6 |
+
|
7 |
+
|
8 |
+
// later fixed / absolute
|
9 |
+
$position_type = 'fixed';
|
10 |
+
$position_type_mobile = 'fixed';
|
11 |
+
|
12 |
+
// Dekstop position
|
13 |
+
$side_1 = esc_attr( $options['side_1'] );
|
14 |
+
$side_1_value = esc_attr( $options['side_1_value'] );
|
15 |
+
$side_2 = esc_attr( $options['side_2'] );
|
16 |
+
$side_2_value = esc_attr( $options['side_2_value'] );
|
17 |
+
|
18 |
+
$position = "position: $position_type; $side_1: $side_1_value; $side_2: $side_2_value;";
|
19 |
+
|
20 |
+
// Mobile position
|
21 |
+
$mobile_side_1 = ( isset( $options['mobile_side_1']) ) ? esc_attr( $options['mobile_side_1'] ) : '';
|
22 |
+
$mobile_side_1_value = ( isset( $options['mobile_side_1_value'])) ? esc_attr( $options['mobile_side_1_value'] ) : '';
|
23 |
+
$mobile_side_2 = ( isset( $options['mobile_side_2']) ) ? esc_attr( $options['mobile_side_2'] ) : '';
|
24 |
+
$mobile_side_2_value = ( isset( $options['mobile_side_2_value'])) ? esc_attr( $options['mobile_side_2_value'] ) : '';
|
25 |
+
|
26 |
+
$position_mobile = "position: $position_type_mobile; $mobile_side_1: $mobile_side_1_value; $mobile_side_2: $mobile_side_2_value;";
|
27 |
+
|
28 |
+
// incase mobile position is null; - safeside can remove this later as db is handling the updates
|
29 |
+
if ( '' == $mobile_side_1_value && '' == $mobile_side_2_value ) {
|
30 |
+
$position_mobile = $position;
|
31 |
+
}
|
new/inc/commons/show-hide.php
CHANGED
@@ -184,21 +184,4 @@ if ( 'show' == $options['show_or_hide'] ) {
|
|
184 |
}
|
185 |
}
|
186 |
|
187 |
-
}
|
188 |
-
|
189 |
-
|
190 |
-
// // Hide based on device
|
191 |
-
|
192 |
-
// if ( function_exists( 'wp_is_mobile' ) ) {
|
193 |
-
// if ( wp_is_mobile() ) {
|
194 |
-
// // mobile
|
195 |
-
// if ( isset( $options['hideon_mobile'] ) ) {
|
196 |
-
// $display = 'no';
|
197 |
-
// }
|
198 |
-
// } else {
|
199 |
-
// // desktop
|
200 |
-
// if ( isset( $options['hideon_desktop'] ) ) {
|
201 |
-
// $display = 'no';
|
202 |
-
// }
|
203 |
-
// }
|
204 |
-
// }
|
184 |
}
|
185 |
}
|
186 |
|
187 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
new/inc/group/class-ht-ctc-group-shortcode.php
CHANGED
@@ -23,16 +23,12 @@ class HT_CTC_Group_Shortcode {
|
|
23 |
public function shortcode( $atts = [], $content = null, $shortcode = '' ) {
|
24 |
|
25 |
$options = get_option('ht_ctc_group');
|
26 |
-
$main_options = ht_ctc()->values->ctc_main_options;
|
27 |
-
|
28 |
|
29 |
$group_id = esc_attr( $options['group_id'] );
|
30 |
$call_to_action_db = esc_attr( $options['call_to_action'] );
|
31 |
-
$pre_filled_db = esc_attr( $options['pre_filled'] );
|
32 |
|
33 |
$group_id = __( $group_id , 'click-to-chat-for-whatsapp' );
|
34 |
$call_to_action = __( $call_to_action_db , 'click-to-chat-for-whatsapp' );
|
35 |
-
$pre_filled = __( $pre_filled_db , 'click-to-chat-for-whatsapp' );
|
36 |
|
37 |
$style_desktop = esc_attr( $options['style_desktop'] );
|
38 |
$style_mobile = esc_attr( $options['style_mobile'] );
|
@@ -72,13 +68,8 @@ class HT_CTC_Group_Shortcode {
|
|
72 |
), $atts, $shortcode );
|
73 |
// use like - '.$a["title"].'
|
74 |
|
75 |
-
|
76 |
// group_id
|
77 |
$group_id = $a["group_id"];
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
|
83 |
// hide on devices
|
84 |
// if 'yes' then hide
|
@@ -95,8 +86,6 @@ class HT_CTC_Group_Shortcode {
|
|
95 |
}
|
96 |
}
|
97 |
|
98 |
-
|
99 |
-
|
100 |
$position = $a["position"];
|
101 |
$top = $a["top"];
|
102 |
$right = $a["right"];
|
@@ -129,13 +118,12 @@ class HT_CTC_Group_Shortcode {
|
|
129 |
$css .= 'display:none;';
|
130 |
}
|
131 |
|
132 |
-
// By default
|
133 |
// if plan to show, then add hide='show' ( actually something not equal to 'hide' )
|
134 |
if ( 'fixed' == $position && 'show' !== $home && ( is_home() || is_category() || is_archive() ) ) {
|
135 |
$css .= 'display:none;';
|
136 |
}
|
137 |
|
138 |
-
|
139 |
$link = "https://chat.whatsapp.com/$group_id";
|
140 |
$return_type = "group";
|
141 |
|
@@ -144,7 +132,8 @@ class HT_CTC_Group_Shortcode {
|
|
144 |
|
145 |
$style = $a["style"];
|
146 |
|
147 |
-
$
|
|
|
148 |
|
149 |
// analytics
|
150 |
$is_ga_enable = apply_filters( 'ht_ctc_fh_is_ga_enable', 'no' );
|
@@ -158,26 +147,22 @@ class HT_CTC_Group_Shortcode {
|
|
158 |
$sc_path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles-shortcode/sc-style-' . $style. '.php';
|
159 |
|
160 |
if ( is_file( $sc_path ) ) {
|
161 |
-
$o .= '<div onclick="ht_ctc_shortcode_click(this);" data-ctc-link="'.$link.'" data-return_type="'.$return_type.'" data-is_ga_enable="'.$is_ga_enable.'" data-is_fb_pixel="'.$is_fb_pixel.'" data-is_fb_an_enable="'.$is_fb_an_enable.'" style="display: inline; cursor: pointer; z-index: 99999999; '.$css.'" class="'.$class_names.' ht-ctc-inline">';
|
162 |
include $sc_path;
|
163 |
$o .= '</div>';
|
164 |
} else {
|
165 |
// if style is not in the list..
|
166 |
-
$img_link = plugins_url("./new/inc/assets/img/whatsapp-logo.svg",
|
167 |
$o .= '<div onclick="ht_ctc_shortcode_click(this);" data-ctc-link="'.$link.'" data-return_type="'.$return_type.'" data-is_ga_enable="'.$is_ga_enable.'" data-is_fb_pixel="'.$is_fb_pixel.'" data-is_fb_an_enable="'.$is_fb_an_enable.'" style="display: inline; cursor: pointer; z-index: 99999999; '.$css.'" class="'.$class_names.' ht-ctc-inline">';
|
168 |
$o .= '<img class="img-icon-sc sc_item pointer style-3-sc" src="'.$img_link.'" alt="WhatsApp chat" style="height: 50px; '.$css.' " >';
|
169 |
$o .= '</div>';
|
170 |
}
|
171 |
|
172 |
-
|
173 |
return $o;
|
174 |
-
|
175 |
}
|
176 |
|
177 |
-
|
178 |
}
|
179 |
|
180 |
-
|
181 |
$shortcode = new HT_CTC_Group_Shortcode();
|
182 |
|
183 |
add_action('init', array( $shortcode, 'shortcodes_init' ) );
|
23 |
public function shortcode( $atts = [], $content = null, $shortcode = '' ) {
|
24 |
|
25 |
$options = get_option('ht_ctc_group');
|
|
|
|
|
26 |
|
27 |
$group_id = esc_attr( $options['group_id'] );
|
28 |
$call_to_action_db = esc_attr( $options['call_to_action'] );
|
|
|
29 |
|
30 |
$group_id = __( $group_id , 'click-to-chat-for-whatsapp' );
|
31 |
$call_to_action = __( $call_to_action_db , 'click-to-chat-for-whatsapp' );
|
|
|
32 |
|
33 |
$style_desktop = esc_attr( $options['style_desktop'] );
|
34 |
$style_mobile = esc_attr( $options['style_mobile'] );
|
68 |
), $atts, $shortcode );
|
69 |
// use like - '.$a["title"].'
|
70 |
|
|
|
71 |
// group_id
|
72 |
$group_id = $a["group_id"];
|
|
|
|
|
|
|
|
|
73 |
|
74 |
// hide on devices
|
75 |
// if 'yes' then hide
|
86 |
}
|
87 |
}
|
88 |
|
|
|
|
|
89 |
$position = $a["position"];
|
90 |
$top = $a["top"];
|
91 |
$right = $a["right"];
|
118 |
$css .= 'display:none;';
|
119 |
}
|
120 |
|
121 |
+
// By default position: fixed style hide on home screen,
|
122 |
// if plan to show, then add hide='show' ( actually something not equal to 'hide' )
|
123 |
if ( 'fixed' == $position && 'show' !== $home && ( is_home() || is_category() || is_archive() ) ) {
|
124 |
$css .= 'display:none;';
|
125 |
}
|
126 |
|
|
|
127 |
$link = "https://chat.whatsapp.com/$group_id";
|
128 |
$return_type = "group";
|
129 |
|
132 |
|
133 |
$style = $a["style"];
|
134 |
|
135 |
+
$type = "group-sc";
|
136 |
+
$class_names = "ht-ctc-sc ht-ctc-sc-group sc-style-$style";
|
137 |
|
138 |
// analytics
|
139 |
$is_ga_enable = apply_filters( 'ht_ctc_fh_is_ga_enable', 'no' );
|
147 |
$sc_path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles-shortcode/sc-style-' . $style. '.php';
|
148 |
|
149 |
if ( is_file( $sc_path ) ) {
|
150 |
+
$o .= '<div onclick="ht_ctc_shortcode_click(this);" data-ctc-link="'.$link.'" data-return_type="'.$return_type.'" data-group_id="'.$group_id.'" data-is_ga_enable="'.$is_ga_enable.'" data-is_fb_pixel="'.$is_fb_pixel.'" data-is_fb_an_enable="'.$is_fb_an_enable.'" style="display: inline; cursor: pointer; z-index: 99999999; '.$css.'" class="'.$class_names.' ht-ctc-inline">';
|
151 |
include $sc_path;
|
152 |
$o .= '</div>';
|
153 |
} else {
|
154 |
// if style is not in the list..
|
155 |
+
$img_link = plugins_url("./new/inc/assets/img/whatsapp-logo.svg", HT_CTC_PLUGIN_FILE );
|
156 |
$o .= '<div onclick="ht_ctc_shortcode_click(this);" data-ctc-link="'.$link.'" data-return_type="'.$return_type.'" data-is_ga_enable="'.$is_ga_enable.'" data-is_fb_pixel="'.$is_fb_pixel.'" data-is_fb_an_enable="'.$is_fb_an_enable.'" style="display: inline; cursor: pointer; z-index: 99999999; '.$css.'" class="'.$class_names.' ht-ctc-inline">';
|
157 |
$o .= '<img class="img-icon-sc sc_item pointer style-3-sc" src="'.$img_link.'" alt="WhatsApp chat" style="height: 50px; '.$css.' " >';
|
158 |
$o .= '</div>';
|
159 |
}
|
160 |
|
|
|
161 |
return $o;
|
|
|
162 |
}
|
163 |
|
|
|
164 |
}
|
165 |
|
|
|
166 |
$shortcode = new HT_CTC_Group_Shortcode();
|
167 |
|
168 |
add_action('init', array( $shortcode, 'shortcodes_init' ) );
|
new/inc/group/class-ht-ctc-group.php
CHANGED
@@ -20,43 +20,39 @@ class HT_CTC_Group {
|
|
20 |
|
21 |
$options = get_option('ht_ctc_group');
|
22 |
|
23 |
-
//
|
24 |
-
$group_id = esc_attr( $options['group_id'] );
|
25 |
-
|
26 |
-
// return if group id is blank
|
27 |
-
if ( '' == $group_id ) {
|
28 |
-
return;
|
29 |
-
}
|
30 |
-
|
31 |
-
// show/hide ..
|
32 |
-
// include_once HT_CTC_PLUGIN_DIR .'new/inc/group/group-show-hide.php';
|
33 |
include HT_CTC_PLUGIN_DIR .'new/inc/commons/show-hide.php';
|
34 |
|
35 |
if ( 'no' == $display ) {
|
36 |
return;
|
37 |
}
|
38 |
|
39 |
-
$main_options = ht_ctc()->values->ctc_main_options;
|
40 |
-
|
41 |
// position
|
42 |
-
|
43 |
|
44 |
// is mobile to select styles
|
45 |
$is_mobile = ht_ctc()->device_type->is_mobile();
|
46 |
|
47 |
// style
|
|
|
|
|
48 |
if ( 'yes' == $is_mobile ) {
|
49 |
-
$style =
|
50 |
} else {
|
51 |
-
$style =
|
52 |
}
|
53 |
|
|
|
|
|
54 |
// call to action
|
55 |
$call_to_action = esc_attr( $options['call_to_action'] );
|
|
|
56 |
|
57 |
// class names
|
58 |
-
$class_names = "ht-ctc-group style-$style";
|
59 |
|
|
|
|
|
60 |
|
61 |
// group_id - at page level
|
62 |
$page_id = get_the_ID();
|
@@ -66,29 +62,36 @@ class HT_CTC_Group {
|
|
66 |
$group_id = $page_group_id;
|
67 |
}
|
68 |
|
|
|
|
|
69 |
// analytics
|
70 |
$is_ga_enable = apply_filters( 'ht_ctc_fh_is_ga_enable', 'no' );
|
71 |
$is_fb_pixel = apply_filters( 'ht_ctc_fh_is_fb_pixel', 'no' );
|
72 |
$is_fb_an_enable = apply_filters( 'ht_ctc_fh_is_fb_an_enable', 'no' );
|
73 |
|
|
|
|
|
74 |
|
75 |
-
$
|
76 |
-
if (
|
77 |
-
$
|
78 |
-
}
|
79 |
-
$display_desktop = 'show';
|
80 |
-
if ( isset( $options['hideon_desktop'] ) ) {
|
81 |
-
$display_desktop = 'hide';
|
82 |
}
|
83 |
|
|
|
|
|
84 |
// call style
|
85 |
$path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style. '.php';
|
86 |
|
|
|
|
|
|
|
|
|
|
|
87 |
if ( is_file( $path ) ) {
|
88 |
do_action('ht_ctc_ah_before_fixed_position');
|
89 |
?>
|
90 |
-
<div onclick="ht_ctc_click(this);" class="<?php echo $class_names ?>"
|
91 |
-
style="display: none;
|
92 |
data-return_type="group"
|
93 |
data-group_id="<?php echo $group_id ?>"
|
94 |
data-is_ga_enable="<?php echo $is_ga_enable ?>"
|
@@ -96,11 +99,23 @@ class HT_CTC_Group {
|
|
96 |
data-is_fb_an_enable="<?php echo $is_fb_an_enable ?>"
|
97 |
data-display_mobile="<?php echo $display_mobile ?>"
|
98 |
data-display_desktop="<?php echo $display_desktop ?>"
|
|
|
|
|
|
|
99 |
>
|
100 |
-
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
</div>
|
102 |
-
<script>ht_ctc_loaded()</script>
|
103 |
<?php
|
|
|
104 |
}
|
105 |
|
106 |
|
20 |
|
21 |
$options = get_option('ht_ctc_group');
|
22 |
|
23 |
+
// show/hide
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
include HT_CTC_PLUGIN_DIR .'new/inc/commons/show-hide.php';
|
25 |
|
26 |
if ( 'no' == $display ) {
|
27 |
return;
|
28 |
}
|
29 |
|
|
|
|
|
30 |
// position
|
31 |
+
include HT_CTC_PLUGIN_DIR .'new/inc/commons/position-to-place.php';
|
32 |
|
33 |
// is mobile to select styles
|
34 |
$is_mobile = ht_ctc()->device_type->is_mobile();
|
35 |
|
36 |
// style
|
37 |
+
$style_d = esc_attr( $options['style_desktop'] );
|
38 |
+
$style_m = esc_attr( $options['style_mobile'] );
|
39 |
if ( 'yes' == $is_mobile ) {
|
40 |
+
$style = $style_m;
|
41 |
} else {
|
42 |
+
$style = $style_d;
|
43 |
}
|
44 |
|
45 |
+
$type = "group";
|
46 |
+
|
47 |
// call to action
|
48 |
$call_to_action = esc_attr( $options['call_to_action'] );
|
49 |
+
$call_to_action = apply_filters( 'wpml_translate_single_string', $call_to_action, 'Click to Chat for WhatsApp', 'call_to_action__group' );
|
50 |
|
51 |
// class names
|
52 |
+
$class_names = "ht-ctc ht-ctc-group style-$style";
|
53 |
|
54 |
+
// group id
|
55 |
+
$group_id = esc_attr( $options['group_id'] );
|
56 |
|
57 |
// group_id - at page level
|
58 |
$page_id = get_the_ID();
|
62 |
$group_id = $page_group_id;
|
63 |
}
|
64 |
|
65 |
+
$group_id = apply_filters( 'wpml_translate_single_string', $group_id, 'Click to Chat for WhatsApp', 'group_id__group' );
|
66 |
+
|
67 |
// analytics
|
68 |
$is_ga_enable = apply_filters( 'ht_ctc_fh_is_ga_enable', 'no' );
|
69 |
$is_fb_pixel = apply_filters( 'ht_ctc_fh_is_fb_pixel', 'no' );
|
70 |
$is_fb_an_enable = apply_filters( 'ht_ctc_fh_is_fb_an_enable', 'no' );
|
71 |
|
72 |
+
$display_mobile = (isset($options['hideon_mobile'])) ? 'hide' : 'show';
|
73 |
+
$display_desktop = (isset($options['hideon_desktop'])) ? 'hide' : 'show';
|
74 |
|
75 |
+
$title = '';
|
76 |
+
if ( '2' == $style || '3' == $style ) {
|
77 |
+
$title = "title = '$call_to_action'";
|
|
|
|
|
|
|
|
|
78 |
}
|
79 |
|
80 |
+
$css = "display: none; cursor: pointer; z-index: 99999999;";
|
81 |
+
|
82 |
// call style
|
83 |
$path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style. '.php';
|
84 |
|
85 |
+
$path_d = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style_d. '.php';
|
86 |
+
$path_m = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style_m. '.php';
|
87 |
+
|
88 |
+
$othersettings = get_option('ht_ctc_othersettings');
|
89 |
+
|
90 |
if ( is_file( $path ) ) {
|
91 |
do_action('ht_ctc_ah_before_fixed_position');
|
92 |
?>
|
93 |
+
<div <?php echo $title ?> onclick="ht_ctc_click(this);" class="<?php echo $class_names ?>"
|
94 |
+
style="display: none;"
|
95 |
data-return_type="group"
|
96 |
data-group_id="<?php echo $group_id ?>"
|
97 |
data-is_ga_enable="<?php echo $is_ga_enable ?>"
|
99 |
data-is_fb_an_enable="<?php echo $is_fb_an_enable ?>"
|
100 |
data-display_mobile="<?php echo $display_mobile ?>"
|
101 |
data-display_desktop="<?php echo $display_desktop ?>"
|
102 |
+
data-css="<?php echo $css ?>"
|
103 |
+
data-position="<?php echo $position ?>"
|
104 |
+
data-position_mobile="<?php echo $position_mobile ?>"
|
105 |
>
|
106 |
+
<?php
|
107 |
+
if ( isset( $othersettings['select_styles_issue'] ) ) {
|
108 |
+
?>
|
109 |
+
<div class="ht_ctc_desktop_group"><?php include $path_d; ?></div>
|
110 |
+
<div class="ht_ctc_mobile_group"><?php include $path_m; ?></div>
|
111 |
+
<?php
|
112 |
+
} else {
|
113 |
+
include $path;
|
114 |
+
}
|
115 |
+
?>
|
116 |
</div>
|
|
|
117 |
<?php
|
118 |
+
do_action('ht_ctc_ah_after_fixed_position');
|
119 |
}
|
120 |
|
121 |
|
new/inc/group/group-position.php
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
*
|
4 |
-
* @included from - class-ht-ctc-group.php
|
5 |
-
*
|
6 |
-
* position to place ..
|
7 |
-
*/
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
$side_1 = esc_attr( $options['side_1'] );
|
12 |
-
$side_1_value = esc_attr( $options['side_1_value'] );
|
13 |
-
|
14 |
-
$side_2 = esc_attr( $options['side_2'] );
|
15 |
-
$side_2_value = esc_attr( $options['side_2_value'] );
|
16 |
-
|
17 |
-
$position = "$side_1: $side_1_value; $side_2: $side_2_value;";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
new/inc/share/class-ht-ctc-share-shortcode.php
CHANGED
@@ -23,8 +23,6 @@ class HT_CTC_Share_Shortcode {
|
|
23 |
public function shortcode( $atts = [], $content = null, $shortcode = '' ) {
|
24 |
|
25 |
$options = get_option('ht_ctc_share');
|
26 |
-
$main_options = ht_ctc()->values->ctc_main_options;
|
27 |
-
|
28 |
|
29 |
$share_text_db = esc_attr( $options['share_text'] );
|
30 |
$call_to_action_db = esc_attr( $options['call_to_action'] );
|
@@ -129,7 +127,7 @@ class HT_CTC_Share_Shortcode {
|
|
129 |
$css .= 'display:none;';
|
130 |
}
|
131 |
|
132 |
-
// By default
|
133 |
// if plan to show, then add hide='show' ( actually something not equal to 'hide' )
|
134 |
if ( 'fixed' == $position && 'show' !== $home && ( is_home() || is_category() || is_archive() ) ) {
|
135 |
$css .= 'display:none;';
|
@@ -155,7 +153,8 @@ class HT_CTC_Share_Shortcode {
|
|
155 |
|
156 |
$style = $a["style"];
|
157 |
|
158 |
-
$
|
|
|
159 |
|
160 |
// analytics
|
161 |
$is_ga_enable = apply_filters( 'ht_ctc_fh_is_ga_enable', 'no' );
|
@@ -169,12 +168,12 @@ class HT_CTC_Share_Shortcode {
|
|
169 |
$sc_path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles-shortcode/sc-style-' . $style. '.php';
|
170 |
|
171 |
if ( is_file( $sc_path ) ) {
|
172 |
-
$o .= '<div onclick="ht_ctc_shortcode_click(this);" data-ctc-link="'.$link.'" data-return_type="'.$return_type.'" data-is_ga_enable="'.$is_ga_enable.'" data-is_fb_pixel="'.$is_fb_pixel.'" data-is_fb_an_enable="'.$is_fb_an_enable.'" style="display: inline; cursor: pointer; z-index: 99999999; '.$css.'" class="'.$class_names.' ht-ctc-inline">';
|
173 |
include $sc_path;
|
174 |
$o .= '</div>';
|
175 |
} else {
|
176 |
// if style is not in the list..
|
177 |
-
$img_link = plugins_url("./new/inc/assets/img/whatsapp-logo.svg",
|
178 |
$o .= '<div onclick="ht_ctc_shortcode_click(this);" data-ctc-link="'.$link.'" data-return_type="'.$return_type.'" data-is_ga_enable="'.$is_ga_enable.'" data-is_fb_pixel="'.$is_fb_pixel.'" data-is_fb_an_enable="'.$is_fb_an_enable.'" style="display: inline; cursor: pointer; z-index: 99999999; '.$css.'" class="'.$class_names.' ht-ctc-inline">';
|
179 |
$o .= '<img class="img-icon-sc sc_item pointer style-3-sc" src="'.$img_link.'" alt="WhatsApp chat" style="height: 50px; '.$css.' " >';
|
180 |
$o .= '</div>';
|
23 |
public function shortcode( $atts = [], $content = null, $shortcode = '' ) {
|
24 |
|
25 |
$options = get_option('ht_ctc_share');
|
|
|
|
|
26 |
|
27 |
$share_text_db = esc_attr( $options['share_text'] );
|
28 |
$call_to_action_db = esc_attr( $options['call_to_action'] );
|
127 |
$css .= 'display:none;';
|
128 |
}
|
129 |
|
130 |
+
// By default position: fixed style hide on home screen,
|
131 |
// if plan to show, then add hide='show' ( actually something not equal to 'hide' )
|
132 |
if ( 'fixed' == $position && 'show' !== $home && ( is_home() || is_category() || is_archive() ) ) {
|
133 |
$css .= 'display:none;';
|
153 |
|
154 |
$style = $a["style"];
|
155 |
|
156 |
+
$type = "share-sc";
|
157 |
+
$class_names = "ht-ctc-sc ht-ctc-sc-share sc-style-$style";
|
158 |
|
159 |
// analytics
|
160 |
$is_ga_enable = apply_filters( 'ht_ctc_fh_is_ga_enable', 'no' );
|
168 |
$sc_path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles-shortcode/sc-style-' . $style. '.php';
|
169 |
|
170 |
if ( is_file( $sc_path ) ) {
|
171 |
+
$o .= '<div onclick="ht_ctc_shortcode_click(this);" data-ctc-link="'.$link.'" data-return_type="'.$return_type.'" data-share_text="'.$share_text.'" data-is_ga_enable="'.$is_ga_enable.'" data-is_fb_pixel="'.$is_fb_pixel.'" data-is_fb_an_enable="'.$is_fb_an_enable.'" style="display: inline; cursor: pointer; z-index: 99999999; '.$css.'" class="'.$class_names.' ht-ctc-inline">';
|
172 |
include $sc_path;
|
173 |
$o .= '</div>';
|
174 |
} else {
|
175 |
// if style is not in the list..
|
176 |
+
$img_link = plugins_url("./new/inc/assets/img/whatsapp-logo.svg", HT_CTC_PLUGIN_FILE );
|
177 |
$o .= '<div onclick="ht_ctc_shortcode_click(this);" data-ctc-link="'.$link.'" data-return_type="'.$return_type.'" data-is_ga_enable="'.$is_ga_enable.'" data-is_fb_pixel="'.$is_fb_pixel.'" data-is_fb_an_enable="'.$is_fb_an_enable.'" style="display: inline; cursor: pointer; z-index: 99999999; '.$css.'" class="'.$class_names.' ht-ctc-inline">';
|
178 |
$o .= '<img class="img-icon-sc sc_item pointer style-3-sc" src="'.$img_link.'" alt="WhatsApp chat" style="height: 50px; '.$css.' " >';
|
179 |
$o .= '</div>';
|
new/inc/share/class-ht-ctc-share.php
CHANGED
@@ -22,40 +22,43 @@ class HT_CTC_Share {
|
|
22 |
|
23 |
// share text
|
24 |
$share_text = esc_attr( $options['share_text'] );
|
|
|
25 |
|
26 |
// return if share text is blank
|
27 |
if ( '' == $share_text ) {
|
28 |
return;
|
29 |
}
|
30 |
|
31 |
-
// show/hide
|
32 |
-
// include_once HT_CTC_PLUGIN_DIR .'new/inc/share/share-show-hide.php';
|
33 |
include HT_CTC_PLUGIN_DIR .'new/inc/commons/show-hide.php';
|
34 |
|
35 |
if ( 'no' == $display ) {
|
36 |
return;
|
37 |
}
|
38 |
|
39 |
-
$main_options = ht_ctc()->values->ctc_main_options;
|
40 |
-
|
41 |
// position
|
42 |
-
|
43 |
|
44 |
// is mobile to select styles
|
45 |
$is_mobile = ht_ctc()->device_type->is_mobile();
|
46 |
|
47 |
// style
|
|
|
|
|
48 |
if ( 'yes' == $is_mobile ) {
|
49 |
-
$style =
|
50 |
} else {
|
51 |
-
$style =
|
52 |
}
|
53 |
|
|
|
|
|
54 |
// call to action
|
55 |
$call_to_action = esc_html( $options['call_to_action'] );
|
|
|
56 |
|
57 |
// class names
|
58 |
-
$class_names = "ht-ctc-share style-$style";
|
59 |
|
60 |
$page_url = get_permalink();
|
61 |
$post_title = esc_html( get_the_title() );
|
@@ -80,23 +83,29 @@ class HT_CTC_Share {
|
|
80 |
$webandapi = 'webapi';
|
81 |
}
|
82 |
|
83 |
-
$display_mobile = 'show';
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
$
|
88 |
-
|
89 |
-
$display_desktop = 'hide';
|
90 |
}
|
91 |
|
|
|
|
|
92 |
// call style
|
93 |
$path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style. '.php';
|
94 |
|
|
|
|
|
|
|
|
|
|
|
95 |
if ( is_file( $path ) ) {
|
96 |
do_action('ht_ctc_ah_before_fixed_position');
|
97 |
?>
|
98 |
-
<div onclick="ht_ctc_click(this);" class="<?php echo $class_names ?>"
|
99 |
-
style="display: none;
|
100 |
data-return_type="share"
|
101 |
data-share_text="<?php echo $share_text ?>"
|
102 |
data-is_ga_enable="<?php echo $is_ga_enable ?>"
|
@@ -105,11 +114,23 @@ class HT_CTC_Share {
|
|
105 |
data-webandapi="<?php echo $webandapi ?>"
|
106 |
data-display_mobile="<?php echo $display_mobile ?>"
|
107 |
data-display_desktop="<?php echo $display_desktop ?>"
|
|
|
|
|
|
|
108 |
>
|
109 |
-
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
</div>
|
111 |
-
<script>ht_ctc_loaded()</script>
|
112 |
<?php
|
|
|
113 |
}
|
114 |
|
115 |
|
22 |
|
23 |
// share text
|
24 |
$share_text = esc_attr( $options['share_text'] );
|
25 |
+
$share_text = apply_filters( 'wpml_translate_single_string', $share_text, 'Click to Chat for WhatsApp', 'share_text__share' );
|
26 |
|
27 |
// return if share text is blank
|
28 |
if ( '' == $share_text ) {
|
29 |
return;
|
30 |
}
|
31 |
|
32 |
+
// show/hide
|
|
|
33 |
include HT_CTC_PLUGIN_DIR .'new/inc/commons/show-hide.php';
|
34 |
|
35 |
if ( 'no' == $display ) {
|
36 |
return;
|
37 |
}
|
38 |
|
|
|
|
|
39 |
// position
|
40 |
+
include HT_CTC_PLUGIN_DIR .'new/inc/commons/position-to-place.php';
|
41 |
|
42 |
// is mobile to select styles
|
43 |
$is_mobile = ht_ctc()->device_type->is_mobile();
|
44 |
|
45 |
// style
|
46 |
+
$style_d = esc_attr( $options['style_desktop'] );
|
47 |
+
$style_m = esc_attr( $options['style_mobile'] );
|
48 |
if ( 'yes' == $is_mobile ) {
|
49 |
+
$style = $style_m;
|
50 |
} else {
|
51 |
+
$style = $style_d;
|
52 |
}
|
53 |
|
54 |
+
$type = "share";
|
55 |
+
|
56 |
// call to action
|
57 |
$call_to_action = esc_html( $options['call_to_action'] );
|
58 |
+
$call_to_action = apply_filters( 'wpml_translate_single_string', $call_to_action, 'Click to Chat for WhatsApp', 'call_to_action__share' );
|
59 |
|
60 |
// class names
|
61 |
+
$class_names = "ht-ctc ht-ctc-share style-$style";
|
62 |
|
63 |
$page_url = get_permalink();
|
64 |
$post_title = esc_html( get_the_title() );
|
83 |
$webandapi = 'webapi';
|
84 |
}
|
85 |
|
86 |
+
$display_mobile = (isset($options['hideon_mobile'])) ? 'hide' : 'show';
|
87 |
+
$display_desktop = (isset($options['hideon_desktop'])) ? 'hide' : 'show';
|
88 |
+
|
89 |
+
$title = '';
|
90 |
+
if ( '2' == $style || '3' == $style ) {
|
91 |
+
$title = "title = '$call_to_action'";
|
|
|
92 |
}
|
93 |
|
94 |
+
$css = "display: none; cursor: pointer; z-index: 99999999;";
|
95 |
+
|
96 |
// call style
|
97 |
$path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style. '.php';
|
98 |
|
99 |
+
$path_d = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style_d. '.php';
|
100 |
+
$path_m = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style_m. '.php';
|
101 |
+
|
102 |
+
$othersettings = get_option('ht_ctc_othersettings');
|
103 |
+
|
104 |
if ( is_file( $path ) ) {
|
105 |
do_action('ht_ctc_ah_before_fixed_position');
|
106 |
?>
|
107 |
+
<div <?php echo $title ?> onclick="ht_ctc_click(this);" class="<?php echo $class_names ?>"
|
108 |
+
style="display: none;"
|
109 |
data-return_type="share"
|
110 |
data-share_text="<?php echo $share_text ?>"
|
111 |
data-is_ga_enable="<?php echo $is_ga_enable ?>"
|
114 |
data-webandapi="<?php echo $webandapi ?>"
|
115 |
data-display_mobile="<?php echo $display_mobile ?>"
|
116 |
data-display_desktop="<?php echo $display_desktop ?>"
|
117 |
+
data-css="<?php echo $css ?>"
|
118 |
+
data-position="<?php echo $position ?>"
|
119 |
+
data-position_mobile="<?php echo $position_mobile ?>"
|
120 |
>
|
121 |
+
<?php
|
122 |
+
if ( isset( $othersettings['select_styles_issue'] ) ) {
|
123 |
+
?>
|
124 |
+
<div class="ht_ctc_desktop_share"><?php include $path_d; ?></div>
|
125 |
+
<div class="ht_ctc_mobile_share"><?php include $path_m; ?></div>
|
126 |
+
<?php
|
127 |
+
} else {
|
128 |
+
include $path;
|
129 |
+
}
|
130 |
+
?>
|
131 |
</div>
|
|
|
132 |
<?php
|
133 |
+
do_action('ht_ctc_ah_after_fixed_position');
|
134 |
}
|
135 |
|
136 |
|
new/inc/share/share-position.php
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
*
|
4 |
-
* @included from - class-ht-ctc-share.php
|
5 |
-
*
|
6 |
-
* position to place ..
|
7 |
-
*/
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
$side_1 = esc_html( $options['side_1'] );
|
12 |
-
$side_1_value = esc_html( $options['side_1_value'] );
|
13 |
-
|
14 |
-
$side_2 = esc_html( $options['side_2'] );
|
15 |
-
$side_2_value = esc_html( $options['side_2_value'] );
|
16 |
-
|
17 |
-
$position = "$side_1: $side_1_value; $side_2: $side_2_value;";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
new/inc/styles-shortcode/sc-style-1.php
CHANGED
@@ -12,6 +12,4 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
|
12 |
|
13 |
$o .= '
|
14 |
<button class="ctc-analytics">'.$call_to_action.'</button>
|
15 |
-
';
|
16 |
-
|
17 |
-
?>
|
12 |
|
13 |
$o .= '
|
14 |
<button class="ctc-analytics">'.$call_to_action.'</button>
|
15 |
+
';
|
|
|
|
new/inc/styles-shortcode/sc-style-2.php
CHANGED
@@ -15,6 +15,4 @@ $s2_img_link = plugins_url( './new/inc/assets/img/whatsapp-icon-square.svg', HT_
|
|
15 |
|
16 |
$o .= '
|
17 |
<img class="img-icon ctc-analytics" title="'.$call_to_action.'" style="height: '.$s2_img_size.';" src="'.$s2_img_link.'" alt="WhatsApp chat">
|
18 |
-
';
|
19 |
-
|
20 |
-
?>
|
15 |
|
16 |
$o .= '
|
17 |
<img class="img-icon ctc-analytics" title="'.$call_to_action.'" style="height: '.$s2_img_size.';" src="'.$s2_img_link.'" alt="WhatsApp chat">
|
18 |
+
';
|
|
|
|
new/inc/styles-shortcode/sc-style-3.php
CHANGED
@@ -8,13 +8,74 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
|
8 |
|
9 |
$s3_options = get_option( 'ht_ctc_s3' );
|
10 |
|
11 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
$s3_img_link = plugins_url( './new/inc/assets/img/whatsapp-logo.svg', HT_CTC_PLUGIN_FILE );
|
14 |
|
|
|
15 |
|
16 |
-
$
|
17 |
-
|
|
|
|
|
|
|
|
|
18 |
';
|
19 |
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
$s3_options = get_option( 'ht_ctc_s3' );
|
10 |
|
11 |
+
$s3_type = ( isset( $s3_options['s3_type']) ) ? esc_attr( $s3_options['s3_type'] ) : 'simple';
|
12 |
+
|
13 |
+
$img_size = esc_attr( $s3_options['s3_img_size'] );
|
14 |
+
if ( '' == $img_size ) {
|
15 |
+
$img_size = "50px";
|
16 |
+
}
|
17 |
+
|
18 |
+
$ht_ctc_svg_css = "pointer-events:none; display:block; height:$img_size; width:$img_size;";
|
19 |
|
20 |
$s3_img_link = plugins_url( './new/inc/assets/img/whatsapp-logo.svg', HT_CTC_PLUGIN_FILE );
|
21 |
|
22 |
+
include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/svg-style-3.php';
|
23 |
|
24 |
+
$s3_simple = '';
|
25 |
+
$s3_extend = '';
|
26 |
+
|
27 |
+
// simple
|
28 |
+
$s3_simple .= '
|
29 |
+
<img class="img-icon ctc-analytics" title="'.$call_to_action.'" style="height: '.$img_size.';" src="'.$s3_img_link.'" alt="WhatsApp chat">
|
30 |
';
|
31 |
|
32 |
+
// extend
|
33 |
+
if ( 'extend' == $s3_type ) {
|
34 |
+
// extend
|
35 |
+
$s3_padding = ( isset( $s3_options['s3_padding']) ) ? esc_attr( $s3_options['s3_padding'] ) : '';
|
36 |
+
$s3_bg_color = ( isset( $s3_options['s3_bg_color']) ) ? esc_attr( $s3_options['s3_bg_color'] ) : '#25D366';
|
37 |
+
$s3_bg_color_hover = ( isset( $s3_options['s3_bg_color_hover']) ) ? esc_attr( $s3_options['s3_bg_color_hover'] ) : '#25D366';
|
38 |
+
|
39 |
+
$s3_box_shadow = "";
|
40 |
+
if ( isset( $s3_options['s3_box_shadow'])) {
|
41 |
+
$s3_box_shadow = "box-shadow: 0px 0px 11px rgba(0,0,0,.5);";
|
42 |
+
}
|
43 |
+
$s3_extend_css = "background-color: $s3_bg_color; padding: $s3_padding; border-radius: 50%; $s3_box_shadow";
|
44 |
+
|
45 |
+
$s3_box_shadow_hover = "";
|
46 |
+
if ( isset( $s3_options['s3_box_shadow_hover'])) {
|
47 |
+
$s3_box_shadow_hover = "box-shadow: 0px 0px 11px rgba(0,0,0,.5);";
|
48 |
+
}
|
49 |
+
// hover css
|
50 |
+
$s3_hover_css = "background-color:$s3_bg_color_hover !important;$s3_box_shadow_hover";
|
51 |
+
|
52 |
+
$others = array(
|
53 |
+
'bg_color' => "$s3_bg_color",
|
54 |
+
);
|
55 |
+
|
56 |
+
$style_3_extend_svg = style_3_extend_svg( $img_size, $type, $ht_ctc_svg_css, $others );;
|
57 |
+
|
58 |
+
|
59 |
+
?>
|
60 |
+
<style>
|
61 |
+
.ht-ctc-sc:hover svg stop{stop-color:<?php echo $s3_bg_color_hover ?>;}
|
62 |
+
.ht-ctc-sc:hover .ht_ctc_padding{<?php echo $s3_hover_css ?>}
|
63 |
+
</style>
|
64 |
+
<?php
|
65 |
+
|
66 |
+
$s3_extend .= '
|
67 |
+
<div class="ht_ctc_padding" style="'.$s3_extend_css.' display:inline-block;">
|
68 |
+
'.$style_3_extend_svg.'
|
69 |
+
</div>
|
70 |
+
';
|
71 |
+
}
|
72 |
+
|
73 |
+
|
74 |
+
|
75 |
+
|
76 |
+
|
77 |
+
if ( 'extend' == $s3_type ) {
|
78 |
+
$o .= $s3_extend;
|
79 |
+
} else {
|
80 |
+
$o .= $s3_simple;
|
81 |
+
}
|
new/inc/styles-shortcode/sc-style-4.php
CHANGED
@@ -11,49 +11,51 @@ $s4_options = get_option( 'ht_ctc_s4' );
|
|
11 |
|
12 |
$s4_text_color = esc_attr( $s4_options['s4_text_color'] );
|
13 |
$s4_bg_color = esc_attr( $s4_options['s4_bg_color'] );
|
14 |
-
|
15 |
$s4_img_url = esc_attr( $s4_options['s4_img_url'] );
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
20 |
}
|
21 |
|
|
|
|
|
|
|
22 |
|
23 |
-
?>
|
24 |
-
|
25 |
-
<style>
|
26 |
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
font-size: 13px;
|
35 |
-
line-height: 32px;
|
36 |
}
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
margin: 0 8px 0 -12px;
|
42 |
-
height: 32px;
|
43 |
-
width: 32px;
|
44 |
-
border-radius: 50%;
|
45 |
}
|
46 |
|
47 |
-
|
48 |
-
|
|
|
|
|
49 |
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
$o .= '
|
53 |
-
<div class="chip ctc-analytics" style="
|
54 |
-
'.$
|
55 |
-
<
|
56 |
</div>
|
57 |
-
';
|
58 |
-
|
59 |
-
?>
|
11 |
|
12 |
$s4_text_color = esc_attr( $s4_options['s4_text_color'] );
|
13 |
$s4_bg_color = esc_attr( $s4_options['s4_bg_color'] );
|
|
|
14 |
$s4_img_url = esc_attr( $s4_options['s4_img_url'] );
|
15 |
|
16 |
+
$s4_img_position = ( isset( $s4_options['s4_img_position']) ) ? esc_attr( $s4_options['s4_img_position'] ) : 'left';
|
17 |
+
$s4_img_size = ( isset( $s4_options['s4_img_size']) ) ? esc_attr( $s4_options['s4_img_size'] ) : '';
|
18 |
+
if ( '' == $s4_img_size ) {
|
19 |
+
$s4_img_size = "32px";
|
20 |
}
|
21 |
|
22 |
+
if ( '' == $call_to_action ) {
|
23 |
+
$call_to_action = "WhatsApp us";
|
24 |
+
}
|
25 |
|
|
|
|
|
|
|
26 |
|
27 |
+
if ( 'left' == $s4_img_position ) {
|
28 |
+
$s4_margin = "0 8px 0 -12px;";
|
29 |
+
// $s4_margin = "0 8px 0 -13px;";
|
30 |
+
$s4_order = "0";
|
31 |
+
} else {
|
32 |
+
$s4_margin = "0 -12px 0 8px;";
|
33 |
+
$s4_order = "1";
|
|
|
|
|
34 |
}
|
35 |
|
36 |
+
$rtl_css = "";
|
37 |
+
if ( is_rtl() ) {
|
38 |
+
$rtl_css = "flex-direction:row-reverse";
|
|
|
|
|
|
|
|
|
39 |
}
|
40 |
|
41 |
+
$s4_chip_css = "display:inline-flex;$rtl_css;justify-content:center;align-items:center;background-color:$s4_bg_color;color:$s4_text_color;padding:0 12px;border-radius:25px;font-size:13px;line-height:32px;";
|
42 |
+
$s4_chip_svg_css ="margin:$s4_margin;order:$s4_order;";
|
43 |
+
$s4_chip_img_css ="margin:$s4_margin;order:$s4_order;height:$s4_img_size;width:$s4_img_size;border-radius:50%";
|
44 |
+
$ht_ctc_svg_css = "pointer-events:none; display: block;";
|
45 |
|
46 |
+
if ( '' == $s4_img_url ) {
|
47 |
+
include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/svg-style-3.php';
|
48 |
+
$style_3_svg = style_3_svg( $s4_img_size, $type, $ht_ctc_svg_css );
|
49 |
+
$type = "$type-s4";
|
50 |
+
$s4_img = '<span style="'.$s4_chip_svg_css.'">'.$style_3_svg.'</span>';
|
51 |
+
} else {
|
52 |
+
// if user changed the image
|
53 |
+
$s4_img = '<img style="'.$s4_chip_img_css.'" src="'.$s4_img_url.'" alt="whatsapp">';
|
54 |
+
}
|
55 |
|
56 |
$o .= '
|
57 |
+
<div class="chip ctc-analytics" style="'.$s4_chip_css.'">
|
58 |
+
'.$s4_img.'
|
59 |
+
<span>'.$call_to_action.'</span>
|
60 |
</div>
|
61 |
+
';
|
|
|
|
new/inc/styles-shortcode/sc-style-5.php
CHANGED
@@ -62,59 +62,18 @@ if ( 'right' == $s5_img_position ) {
|
|
62 |
|
63 |
// adding styles..
|
64 |
$s5_css_code = '
|
65 |
-
|
66 |
-
|
67 |
-
}
|
68 |
-
.ht-ctc-style-5 .s5_content {
|
69 |
-
box-shadow: 2px 5px 10px rgba(0,0,0,.5);
|
70 |
-
border-radius: 5px;
|
71 |
-
}
|
72 |
-
.ht-ctc-style-5 .s5_content span {
|
73 |
-
padding: 5px;
|
74 |
-
overflow: hidden;
|
75 |
-
}
|
76 |
-
.ht-ctc-style-5 .s5_content .heading {
|
77 |
-
font-size: 20px;
|
78 |
-
}
|
79 |
-
.ht-ctc-style-5 .s5_content .description {
|
80 |
-
font-size: 12px;
|
81 |
-
}
|
82 |
-
.ht-ctc-style-5 .s5_content.right {
|
83 |
-
animation: 1s s5_translate_right;
|
84 |
-
}
|
85 |
-
.ht-ctc-style-5 .s5_content.left {
|
86 |
-
animation: 1s s5_translate_left;
|
87 |
-
}
|
88 |
-
|
89 |
-
@keyframes s5_translate_right {
|
90 |
-
0% {
|
91 |
-
transform: translateX(55px)
|
92 |
-
}
|
93 |
-
100% {
|
94 |
-
transform: translateX(0px)
|
95 |
-
}
|
96 |
-
}
|
97 |
-
|
98 |
-
@keyframes s5_translate_left {
|
99 |
-
0% {
|
100 |
-
transform: translateX(-55px)
|
101 |
-
}
|
102 |
-
100% {
|
103 |
-
transform: translateX(0px)
|
104 |
-
}
|
105 |
-
}
|
106 |
-
';
|
107 |
|
108 |
|
109 |
// styles
|
110 |
$o .= '<style>';
|
111 |
-
$o .= '.ht-ctc-style-5 .s5_content
|
112 |
$o .= $s5_css_code;
|
113 |
$o .= '</style>';
|
114 |
|
115 |
|
116 |
$o .= '
|
117 |
-
|
118 |
<div class="ht-ctc-style-5 ctc-analytics" style="display: inline-block; cursor: pointer; z-index: 99999999;" >
|
119 |
<div class="s5_cta ctc-analytics" style="'.$s5_cta_style.'" >
|
120 |
<img class="s5_img ctc-analytics" src="'.$s5_img.'" style="'.$s5_img_style.'" alt="whatsapp">
|
@@ -124,7 +83,4 @@ $o .= '
|
|
124 |
</div>
|
125 |
</div>
|
126 |
</div>
|
127 |
-
|
128 |
-
';
|
129 |
-
|
130 |
-
?>
|
62 |
|
63 |
// adding styles..
|
64 |
$s5_css_code = '
|
65 |
+
.ht-ctc-style-5 .s5_img{box-shadow:2px 5px 10px rgba(0,0,0,.5)}.ht-ctc-style-5 .s5_content{box-shadow:2px 5px 10px rgba(0,0,0,.5);border-radius:5px}.ht-ctc-style-5 .s5_content span{padding:5px;overflow:hidden}.ht-ctc-style-5 .s5_content .heading{font-size:20px}.ht-ctc-style-5 .s5_content .description{font-size:12px}.ht-ctc-style-5 .s5_content.right{animation:1s s5_translate_right}.ht-ctc-style-5 .s5_content.left{animation:1s s5_translate_left}@keyframes s5_translate_right{0%{transform:translateX(55px)}100%{transform:translateX(0)}}@keyframes s5_translate_left{0%{transform:translateX(-55px)}100%{transform:translateX(0)}}
|
66 |
+
';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
|
68 |
|
69 |
// styles
|
70 |
$o .= '<style>';
|
71 |
+
$o .= '.ht-ctc-style-5 .s5_content{display:none}.ht-ctc-style-5 .s5_cta:hover .s5_content{display:flex}';
|
72 |
$o .= $s5_css_code;
|
73 |
$o .= '</style>';
|
74 |
|
75 |
|
76 |
$o .= '
|
|
|
77 |
<div class="ht-ctc-style-5 ctc-analytics" style="display: inline-block; cursor: pointer; z-index: 99999999;" >
|
78 |
<div class="s5_cta ctc-analytics" style="'.$s5_cta_style.'" >
|
79 |
<img class="s5_img ctc-analytics" src="'.$s5_img.'" style="'.$s5_img_style.'" alt="whatsapp">
|
83 |
</div>
|
84 |
</div>
|
85 |
</div>
|
86 |
+
';
|
|
|
|
|
|
new/inc/styles-shortcode/sc-style-6.php
CHANGED
@@ -23,6 +23,4 @@ $o .= '
|
|
23 |
>
|
24 |
'.$call_to_action.'
|
25 |
</a>
|
26 |
-
';
|
27 |
-
|
28 |
-
?>
|
23 |
>
|
24 |
'.$call_to_action.'
|
25 |
</a>
|
26 |
+
';
|
|
|
|
new/inc/styles-shortcode/sc-style-8.php
CHANGED
@@ -9,9 +9,7 @@ $s8_options = get_option( 'ht_ctc_s8' );
|
|
9 |
|
10 |
?>
|
11 |
<style>
|
12 |
-
.ht-ctc-sc-style-8
|
13 |
-
display: none;
|
14 |
-
}
|
15 |
</style>
|
16 |
<?php
|
17 |
|
@@ -61,8 +59,8 @@ $o .= '
|
|
61 |
<span class="waves-effect waves-light '.$s8_btn_size.' ctc-analytics" style="background-color: '.$s8_bg_color.'; '.$s8_width_css.'"
|
62 |
onmouseover= "'.$input_onhover.'"
|
63 |
onmouseout= "'.$input_onhover_out.'">
|
64 |
-
<i class="material-icons '.$s8_icon_position.' ctc-icon ctc-icon-whatsapp2 ctc-analytics" style="color: '.$s8_icon_color.'; '.$s8_icon_size.' "></i>
|
65 |
-
<span class="ctc-analytics" style="color: '.$s8_txt_color.'; '.$s8_text_size.' ">'.$call_to_action.'</span>
|
66 |
</span>
|
67 |
</div>
|
68 |
';
|
9 |
|
10 |
?>
|
11 |
<style>
|
12 |
+
.ht-ctc-sc-style-8{display:none;}
|
|
|
|
|
13 |
</style>
|
14 |
<?php
|
15 |
|
59 |
<span class="waves-effect waves-light '.$s8_btn_size.' ctc-analytics" style="background-color: '.$s8_bg_color.'; '.$s8_width_css.'"
|
60 |
onmouseover= "'.$input_onhover.'"
|
61 |
onmouseout= "'.$input_onhover_out.'">
|
62 |
+
<i class="material-icons s8_icon '.$s8_icon_position.' ctc-icon ctc-icon-whatsapp2 ctc-analytics" style="color: '.$s8_icon_color.'; '.$s8_icon_size.' "></i>
|
63 |
+
<span class="ctc-analytics s8_span" style="color: '.$s8_txt_color.'; '.$s8_text_size.' ">'.$call_to_action.'</span>
|
64 |
</span>
|
65 |
</div>
|
66 |
';
|
new/inc/styles-shortcode/sc-style-99.php
CHANGED
@@ -52,6 +52,4 @@ if ( '' == $s99_own_image ) {
|
|
52 |
|
53 |
$o .= '
|
54 |
<img class="own-img" title="'.$call_to_action.'" id="style-99" src="'.$s99_own_image.'" style="'.$s99_img_css.'" alt="WhatsApp chat">
|
55 |
-
';
|
56 |
-
|
57 |
-
?>
|
52 |
|
53 |
$o .= '
|
54 |
<img class="own-img" title="'.$call_to_action.'" id="style-99" src="'.$s99_own_image.'" style="'.$s99_img_css.'" alt="WhatsApp chat">
|
55 |
+
';
|
|
|
|
new/inc/styles/style-1.php
CHANGED
@@ -10,6 +10,8 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
|
10 |
|
11 |
// $s1_options = get_option( 'ht_ctc_s1' );
|
12 |
|
13 |
-
|
|
|
|
|
14 |
?>
|
15 |
<button class="ctc-analytics"><?php echo $call_to_action ?></button>
|
10 |
|
11 |
// $s1_options = get_option( 'ht_ctc_s1' );
|
12 |
|
13 |
+
if ( '' == $call_to_action ) {
|
14 |
+
$call_to_action = "WhatsApp us";
|
15 |
+
}
|
16 |
?>
|
17 |
<button class="ctc-analytics"><?php echo $call_to_action ?></button>
|
new/inc/styles/style-2.php
CHANGED
@@ -11,10 +11,13 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
|
11 |
$s2_options = get_option( 'ht_ctc_s2' );
|
12 |
|
13 |
$s2_img_size = esc_attr( $s2_options['s2_img_size'] );
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
|
19 |
-
|
20 |
-
|
|
|
|
|
|
11 |
$s2_options = get_option( 'ht_ctc_s2' );
|
12 |
|
13 |
$s2_img_size = esc_attr( $s2_options['s2_img_size'] );
|
14 |
+
$img_size = esc_attr( $s2_options['s2_img_size'] );
|
15 |
+
if ( '' == $img_size ) {
|
16 |
+
$img_size = "50px";
|
17 |
+
}
|
18 |
|
19 |
+
$ht_ctc_svg_css = "pointer-events:none; display:block; height:$img_size; width:$img_size;";
|
20 |
+
|
21 |
+
include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/svg-style-2.php';
|
22 |
+
|
23 |
+
echo style_2_svg( $img_size, $type, $ht_ctc_svg_css );
|
new/inc/styles/style-3.php
CHANGED
@@ -9,12 +9,55 @@
|
|
9 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
10 |
|
11 |
$s3_options = get_option( 'ht_ctc_s3' );
|
|
|
12 |
|
13 |
$s3_img_size = esc_attr( $s3_options['s3_img_size'] );
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
|
19 |
-
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
10 |
|
11 |
$s3_options = get_option( 'ht_ctc_s3' );
|
12 |
+
$s3_type = ( isset( $s3_options['s3_type']) ) ? esc_attr( $s3_options['s3_type'] ) : 'simple';
|
13 |
|
14 |
$s3_img_size = esc_attr( $s3_options['s3_img_size'] );
|
15 |
+
$img_size = esc_attr( $s3_options['s3_img_size'] );
|
16 |
+
if ( '' == $img_size ) {
|
17 |
+
$img_size = "50px";
|
18 |
+
}
|
19 |
|
20 |
+
$ht_ctc_svg_css = "pointer-events:none; display:block; height:$img_size; width:$img_size;";
|
21 |
+
|
22 |
+
include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/svg-style-3.php';
|
23 |
+
|
24 |
+
|
25 |
+
|
26 |
+
if ( 'simple' == $s3_type ) {
|
27 |
+
// simple
|
28 |
+
echo style_3_svg( $img_size, $type, $ht_ctc_svg_css );
|
29 |
+
} else {
|
30 |
+
// extend
|
31 |
+
$s3_padding = ( isset( $s3_options['s3_padding']) ) ? esc_attr( $s3_options['s3_padding'] ) : '';
|
32 |
+
$s3_bg_color = ( isset( $s3_options['s3_bg_color']) ) ? esc_attr( $s3_options['s3_bg_color'] ) : '#25D366';
|
33 |
+
$s3_bg_color_hover = ( isset( $s3_options['s3_bg_color_hover']) ) ? esc_attr( $s3_options['s3_bg_color_hover'] ) : '#25D366';
|
34 |
+
|
35 |
+
$s3_box_shadow = "";
|
36 |
+
if ( isset( $s3_options['s3_box_shadow'])) {
|
37 |
+
$s3_box_shadow = "box-shadow: 0px 0px 11px rgba(0,0,0,.5);";
|
38 |
+
}
|
39 |
+
$s3_extend_css = "background-color: $s3_bg_color; padding: $s3_padding; border-radius: 50%; $s3_box_shadow";
|
40 |
+
|
41 |
+
$s3_box_shadow_hover = "";
|
42 |
+
if ( isset( $s3_options['s3_box_shadow_hover'])) {
|
43 |
+
$s3_box_shadow_hover = "box-shadow:0px 0px 11px rgba(0,0,0,.5);";
|
44 |
+
}
|
45 |
+
// hover css
|
46 |
+
$s3_hover_css = "background-color:$s3_bg_color_hover !important;$s3_box_shadow_hover";
|
47 |
+
|
48 |
+
$others = array(
|
49 |
+
'bg_color' => "$s3_bg_color",
|
50 |
+
);
|
51 |
+
|
52 |
+
?>
|
53 |
+
<style>
|
54 |
+
.ht-ctc:hover svg stop{stop-color:<?php echo $s3_bg_color_hover ?>;}
|
55 |
+
.ht-ctc:hover .ht_ctc_padding{<?php echo $s3_hover_css ?>}
|
56 |
+
</style>
|
57 |
+
|
58 |
+
|
59 |
+
<div class="ht_ctc_padding" style="<?php echo $s3_extend_css ?>">
|
60 |
+
<?php echo style_3_extend_svg( $img_size, $type, $ht_ctc_svg_css, $others ); ?>
|
61 |
+
</div>
|
62 |
+
<?php
|
63 |
+
}
|
new/inc/styles/style-4.php
CHANGED
@@ -10,46 +10,54 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
|
10 |
|
11 |
$s4_options = get_option( 'ht_ctc_s4' );
|
12 |
|
13 |
-
|
14 |
$s4_text_color = esc_attr( $s4_options['s4_text_color'] );
|
15 |
$s4_bg_color = esc_attr( $s4_options['s4_bg_color'] );
|
16 |
-
|
17 |
$s4_img_url = esc_attr( $s4_options['s4_img_url'] );
|
18 |
-
|
19 |
-
|
20 |
-
if ( '' == $
|
21 |
-
$
|
22 |
}
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
<style>
|
28 |
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
font-size: 13px;
|
37 |
-
line-height: 32px;
|
38 |
}
|
39 |
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
margin: 0 8px 0 -12px;
|
44 |
-
height: 32px;
|
45 |
-
width: 32px;
|
46 |
-
border-radius: 50%;
|
47 |
}
|
48 |
|
49 |
-
</style>
|
50 |
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
-
<div class="chip ctc-analytics" style="
|
53 |
-
<?php
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
</div>
|
10 |
|
11 |
$s4_options = get_option( 'ht_ctc_s4' );
|
12 |
|
|
|
13 |
$s4_text_color = esc_attr( $s4_options['s4_text_color'] );
|
14 |
$s4_bg_color = esc_attr( $s4_options['s4_bg_color'] );
|
|
|
15 |
$s4_img_url = esc_attr( $s4_options['s4_img_url'] );
|
16 |
+
$s4_img_position = ( isset( $s4_options['s4_img_position']) ) ? esc_attr( $s4_options['s4_img_position'] ) : 'left';
|
17 |
+
$s4_img_size = ( isset( $s4_options['s4_img_size']) ) ? esc_attr( $s4_options['s4_img_size'] ) : '';
|
18 |
+
if ( '' == $s4_img_size ) {
|
19 |
+
$s4_img_size = "32px";
|
20 |
}
|
21 |
|
22 |
+
if ( '' == $call_to_action ) {
|
23 |
+
$call_to_action = "WhatsApp us";
|
24 |
+
}
|
|
|
25 |
|
26 |
+
if ( 'left' == $s4_img_position ) {
|
27 |
+
$s4_margin = "0 8px 0 -12px;";
|
28 |
+
// $s4_margin = "0 8px 0 -13px;";
|
29 |
+
$s4_order = "0";
|
30 |
+
} else {
|
31 |
+
$s4_margin = "0 -12px 0 8px;";
|
32 |
+
$s4_order = "1";
|
|
|
|
|
33 |
}
|
34 |
|
35 |
+
$rtl_css = "";
|
36 |
+
if ( is_rtl() ) {
|
37 |
+
$rtl_css = "flex-direction:row-reverse";
|
|
|
|
|
|
|
|
|
38 |
}
|
39 |
|
|
|
40 |
|
41 |
+
$s4_chip_css = "display:flex;$rtl_css;justify-content: center;align-items: center;background-color:$s4_bg_color;color:$s4_text_color;padding:0 12px;border-radius:25px;font-size:13px;line-height:32px;";
|
42 |
+
$s4_chip_svg_css ="margin:$s4_margin;order:$s4_order;";
|
43 |
+
$s4_chip_img_css ="margin:$s4_margin;order:$s4_order;height:$s4_img_size;width:$s4_img_size;border-radius:50%";
|
44 |
+
$ht_ctc_svg_css = "pointer-events:none; display: block;";
|
45 |
+
?>
|
46 |
|
47 |
+
<div class="chip ctc-analytics" style="<?php echo $s4_chip_css ?>">
|
48 |
+
<?php
|
49 |
+
if ( '' == $s4_img_url ) {
|
50 |
+
include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/svg-style-3.php';
|
51 |
+
$type = "$type-s4";
|
52 |
+
?>
|
53 |
+
<span style="<?php echo $s4_chip_svg_css ?>"><?php echo style_3_svg( $s4_img_size, $type, $ht_ctc_svg_css ); ?></span>
|
54 |
+
<?php
|
55 |
+
} else {
|
56 |
+
// if user changed the image
|
57 |
+
?>
|
58 |
+
<img style="<?php echo $s4_chip_img_css ?>" src="<?php echo $s4_img_url ?>" alt="whatsapp">
|
59 |
+
<?php
|
60 |
+
}
|
61 |
+
?>
|
62 |
+
<span><?php echo $call_to_action ?></span>
|
63 |
</div>
|
new/inc/styles/style-5.php
CHANGED
@@ -8,7 +8,6 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
|
8 |
|
9 |
$s5_options = get_option( 'ht_ctc_s5' );
|
10 |
|
11 |
-
|
12 |
$s5_line_1 = esc_attr( $s5_options['s5_line_1'] );
|
13 |
$s5_line_2 = esc_attr( $s5_options['s5_line_2'] );
|
14 |
$s5_line_1_color = esc_attr( $s5_options['s5_line_1_color'] );
|
@@ -52,64 +51,65 @@ if ( 'right' == $s5_img_position ) {
|
|
52 |
}
|
53 |
|
54 |
|
55 |
-
// adding styles..
|
56 |
-
$s5_css_code = '
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
|
|
|
|
|
|
|
|
99 |
|
100 |
-
|
101 |
$o = '';
|
102 |
$o .= '<style>';
|
103 |
-
$o .= '.ht-ctc-style-5 .s5_content
|
104 |
$o .= $s5_css_code;
|
105 |
$o .= '</style>';
|
106 |
|
107 |
echo $o;
|
108 |
|
109 |
-
|
110 |
?>
|
111 |
|
112 |
-
|
113 |
<div class="ht-ctc-style-5 ctc-analytics" style="cursor: pointer; z-index: 99999999;" >
|
114 |
|
115 |
<div class="s5_cta" style="<?php echo $s5_cta_style ?>" >
|
8 |
|
9 |
$s5_options = get_option( 'ht_ctc_s5' );
|
10 |
|
|
|
11 |
$s5_line_1 = esc_attr( $s5_options['s5_line_1'] );
|
12 |
$s5_line_2 = esc_attr( $s5_options['s5_line_2'] );
|
13 |
$s5_line_1_color = esc_attr( $s5_options['s5_line_1_color'] );
|
51 |
}
|
52 |
|
53 |
|
54 |
+
// // adding styles..
|
55 |
+
// $s5_css_code = '
|
56 |
+
// .ht-ctc-style-5 .s5_img {
|
57 |
+
// box-shadow: 2px 5px 10px rgba(0,0,0,.5);
|
58 |
+
// }
|
59 |
+
// .ht-ctc-style-5 .s5_content {
|
60 |
+
// box-shadow: 2px 5px 10px rgba(0,0,0,.5);
|
61 |
+
// border-radius: 5px;
|
62 |
+
// }
|
63 |
+
// .ht-ctc-style-5 .s5_content span {
|
64 |
+
// padding: 5px;
|
65 |
+
// overflow: hidden;
|
66 |
+
// }
|
67 |
+
// .ht-ctc-style-5 .s5_content .heading {
|
68 |
+
// font-size: 20px;
|
69 |
+
// }
|
70 |
+
// .ht-ctc-style-5 .s5_content .description {
|
71 |
+
// font-size: 12px;
|
72 |
+
// }
|
73 |
+
// .ht-ctc-style-5 .s5_content.right {
|
74 |
+
// animation: 1s s5_translate_right;
|
75 |
+
// }
|
76 |
+
// .ht-ctc-style-5 .s5_content.left {
|
77 |
+
// animation: 1s s5_translate_left;
|
78 |
+
// }
|
79 |
|
80 |
+
// @keyframes s5_translate_right {
|
81 |
+
// 0% {
|
82 |
+
// transform: translateX(55px)
|
83 |
+
// }
|
84 |
+
// 100% {
|
85 |
+
// transform: translateX(0px)
|
86 |
+
// }
|
87 |
+
// }
|
88 |
|
89 |
+
// @keyframes s5_translate_left {
|
90 |
+
// 0% {
|
91 |
+
// transform: translateX(-55px)
|
92 |
+
// }
|
93 |
+
// 100% {
|
94 |
+
// transform: translateX(0px)
|
95 |
+
// }
|
96 |
+
// }
|
97 |
+
// ';
|
98 |
+
|
99 |
+
$s5_css_code = '
|
100 |
+
.ht-ctc-style-5 .s5_img{box-shadow:2px 5px 10px rgba(0,0,0,.5)}.ht-ctc-style-5 .s5_content{box-shadow:2px 5px 10px rgba(0,0,0,.5);border-radius:5px}.ht-ctc-style-5 .s5_content span{padding:5px;overflow:hidden}.ht-ctc-style-5 .s5_content .heading{font-size:20px}.ht-ctc-style-5 .s5_content .description{font-size:12px}.ht-ctc-style-5 .s5_content.right{animation:1s s5_translate_right}.ht-ctc-style-5 .s5_content.left{animation:1s s5_translate_left}@keyframes s5_translate_right{0%{transform:translateX(55px)}100%{transform:translateX(0)}}@keyframes s5_translate_left{0%{transform:translateX(-55px)}100%{transform:translateX(0)}}
|
101 |
+
';
|
102 |
|
|
|
103 |
$o = '';
|
104 |
$o .= '<style>';
|
105 |
+
$o .= '.ht-ctc-style-5 .s5_content{display:none}.ht-ctc-style-5 .s5_cta:hover .s5_content{display:flex}';
|
106 |
$o .= $s5_css_code;
|
107 |
$o .= '</style>';
|
108 |
|
109 |
echo $o;
|
110 |
|
|
|
111 |
?>
|
112 |
|
|
|
113 |
<div class="ht-ctc-style-5 ctc-analytics" style="cursor: pointer; z-index: 99999999;" >
|
114 |
|
115 |
<div class="s5_cta" style="<?php echo $s5_cta_style ?>" >
|
new/inc/styles/style-6.php
CHANGED
@@ -14,8 +14,6 @@ $s6_txt_color = esc_attr( $s6_options['s6_txt_color'] );
|
|
14 |
$s6_txt_color_on_hover = esc_attr( $s6_options['s6_txt_color_on_hover'] );
|
15 |
$s6_txt_decoration = esc_attr( $s6_options['s6_txt_decoration'] );
|
16 |
$s6_txt_decoration_on_hover = esc_attr( $s6_options['s6_txt_decoration_on_hover'] );
|
17 |
-
|
18 |
-
|
19 |
?>
|
20 |
|
21 |
<a class="ctc-analytics" style="color: <?php echo $s6_txt_color ?>; text-decoration: <?php echo $s6_txt_decoration ?>;"
|
14 |
$s6_txt_color_on_hover = esc_attr( $s6_options['s6_txt_color_on_hover'] );
|
15 |
$s6_txt_decoration = esc_attr( $s6_options['s6_txt_decoration'] );
|
16 |
$s6_txt_decoration_on_hover = esc_attr( $s6_options['s6_txt_decoration_on_hover'] );
|
|
|
|
|
17 |
?>
|
18 |
|
19 |
<a class="ctc-analytics" style="color: <?php echo $s6_txt_color ?>; text-decoration: <?php echo $s6_txt_decoration ?>;"
|
new/inc/styles/style-7.php
CHANGED
@@ -19,7 +19,6 @@ $s7_border_radius = esc_attr( $s7_options['s7_border_radius'] );
|
|
19 |
|
20 |
$s7_css = "font-size: $s7_icon_size; color: $s7_icon_color; padding: $s7_border_size; background-color: $s7_border_color; border-radius: $s7_border_radius;";
|
21 |
|
22 |
-
|
23 |
?>
|
24 |
<span title="<?php echo $call_to_action ?>" class="ctc-analytics ctc-icon ctc-icon-whatsapp2" id="s7-icon" style="<?php echo $s7_css ?>"
|
25 |
onmouseover = "this.style.color = '<?php echo $s7_icon_color_hover ?>', this.style.backgroundColor = '<?php echo $s7_border_color_hover ?>' "
|
19 |
|
20 |
$s7_css = "font-size: $s7_icon_size; color: $s7_icon_color; padding: $s7_border_size; background-color: $s7_border_color; border-radius: $s7_border_radius;";
|
21 |
|
|
|
22 |
?>
|
23 |
<span title="<?php echo $call_to_action ?>" class="ctc-analytics ctc-icon ctc-icon-whatsapp2" id="s7-icon" style="<?php echo $s7_css ?>"
|
24 |
onmouseover = "this.style.color = '<?php echo $s7_icon_color_hover ?>', this.style.backgroundColor = '<?php echo $s7_border_color_hover ?>' "
|
new/inc/styles/style-8.php
CHANGED
@@ -10,14 +10,6 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
|
10 |
|
11 |
$s8_options = get_option( 'ht_ctc_s8' );
|
12 |
|
13 |
-
?>
|
14 |
-
<style>
|
15 |
-
.ht-ctc-style-8 {
|
16 |
-
display: none;
|
17 |
-
}
|
18 |
-
</style>
|
19 |
-
<?php
|
20 |
-
|
21 |
wp_enqueue_style('ht_ctc_font_css');
|
22 |
wp_enqueue_style('ht_ctc_mdstyle8_css');
|
23 |
|
@@ -41,11 +33,9 @@ $s8_icon_size = ('' == $s8_icon_size_db) ? "" : "font-size: $s8_icon_size_db;";
|
|
41 |
$s8_text_size_db = esc_attr( $s8_options['s8_text_size'] );
|
42 |
$s8_text_size = ('' == $s8_text_size_db) ? "" : "font-size: $s8_text_size_db;";
|
43 |
// $s8_text_size = ('' == $s8_text_size_db) ? "font-size: 16px;" : "font-size: $s8_text_size_db;";
|
44 |
-
|
45 |
?>
|
46 |
|
47 |
<div class = "mdstyle8 ht-ctc-style-8 ctc-analytics" >
|
48 |
-
|
49 |
<span class="waves-effect waves-light <?php echo $s8_btn_size ?> ctc-analytics" style="background-color: <?php echo $s8_bg_color ?>; "
|
50 |
onmouseover = "this.style.backgroundColor = '<?php echo $s8_bg_color_on_hover ?>',
|
51 |
document.getElementsByClassName('ht-ctc-s8-icon')[0].style.color = '<?php echo $s8_icon_color_on_hover ?>',
|
@@ -55,12 +45,11 @@ $s8_text_size = ('' == $s8_text_size_db) ? "" : "font-size: $s8_text_size_db;";
|
|
55 |
document.getElementsByClassName('ht-ctc-s8-icon')[0].style.color = '<?php echo $s8_icon_color ?>',
|
56 |
document.getElementsByClassName('ht-ctc-s8-text')[0].style.color = '<?php echo $s8_txt_color ?>'
|
57 |
">
|
58 |
-
<i class="material-icons ctc-analytics <?php echo $s8_icon_position ?> ctc-icon ctc-icon-whatsapp2 ht-ctc-s8-icon"
|
59 |
style="color: <?php echo $s8_icon_color ?>; <?php echo $s8_icon_size ?>">
|
60 |
</i>
|
61 |
-
<span class="ht-ctc-s8-text ctc-analytics" style="color: <?php echo $s8_txt_color ?>; <?php echo $s8_text_size ?>">
|
62 |
<?php echo $call_to_action ?>
|
63 |
</span>
|
64 |
</span>
|
65 |
-
|
66 |
</div>
|
10 |
|
11 |
$s8_options = get_option( 'ht_ctc_s8' );
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
wp_enqueue_style('ht_ctc_font_css');
|
14 |
wp_enqueue_style('ht_ctc_mdstyle8_css');
|
15 |
|
33 |
$s8_text_size_db = esc_attr( $s8_options['s8_text_size'] );
|
34 |
$s8_text_size = ('' == $s8_text_size_db) ? "" : "font-size: $s8_text_size_db;";
|
35 |
// $s8_text_size = ('' == $s8_text_size_db) ? "font-size: 16px;" : "font-size: $s8_text_size_db;";
|
|
|
36 |
?>
|
37 |
|
38 |
<div class = "mdstyle8 ht-ctc-style-8 ctc-analytics" >
|
|
|
39 |
<span class="waves-effect waves-light <?php echo $s8_btn_size ?> ctc-analytics" style="background-color: <?php echo $s8_bg_color ?>; "
|
40 |
onmouseover = "this.style.backgroundColor = '<?php echo $s8_bg_color_on_hover ?>',
|
41 |
document.getElementsByClassName('ht-ctc-s8-icon')[0].style.color = '<?php echo $s8_icon_color_on_hover ?>',
|
45 |
document.getElementsByClassName('ht-ctc-s8-icon')[0].style.color = '<?php echo $s8_icon_color ?>',
|
46 |
document.getElementsByClassName('ht-ctc-s8-text')[0].style.color = '<?php echo $s8_txt_color ?>'
|
47 |
">
|
48 |
+
<i class="material-icons s8_icon ctc-analytics <?php echo $s8_icon_position ?> ctc-icon ctc-icon-whatsapp2 ht-ctc-s8-icon"
|
49 |
style="color: <?php echo $s8_icon_color ?>; <?php echo $s8_icon_size ?>">
|
50 |
</i>
|
51 |
+
<span class="ht-ctc-s8-text s8_span ctc-analytics" style="color: <?php echo $s8_txt_color ?>; <?php echo $s8_text_size ?>">
|
52 |
<?php echo $call_to_action ?>
|
53 |
</span>
|
54 |
</span>
|
|
|
55 |
</div>
|
new/inc/styles/style-99.php
CHANGED
@@ -12,12 +12,10 @@ $s99_desktop_img_width = esc_attr( $s99_options['s99_desktop_img_width'] );
|
|
12 |
$s99_mobile_img_height = esc_attr( $s99_options['s99_mobile_img_height'] );
|
13 |
$s99_mobile_img_width = esc_attr( $s99_options['s99_mobile_img_width'] );
|
14 |
|
15 |
-
// img url
|
16 |
-
// image - width, height based on device
|
17 |
$s99_img_css = "";
|
18 |
|
19 |
if( 'yes' == $is_mobile ) {
|
20 |
-
|
21 |
$s99_own_image = esc_html( $s99_options['s99_mobile_img_url'] );
|
22 |
|
23 |
if ( '' !== $s99_mobile_img_height ) {
|
@@ -30,7 +28,6 @@ if( 'yes' == $is_mobile ) {
|
|
30 |
$s99_img_css .= "width: $s99_mobile_img_width; ";
|
31 |
}
|
32 |
} else {
|
33 |
-
|
34 |
$s99_own_image = esc_html( $s99_options['s99_dekstop_img_url'] );
|
35 |
|
36 |
if ( '' !== $s99_desktop_img_height ) {
|
12 |
$s99_mobile_img_height = esc_attr( $s99_options['s99_mobile_img_height'] );
|
13 |
$s99_mobile_img_width = esc_attr( $s99_options['s99_mobile_img_width'] );
|
14 |
|
15 |
+
// img - url, width, height based on device
|
|
|
16 |
$s99_img_css = "";
|
17 |
|
18 |
if( 'yes' == $is_mobile ) {
|
|
|
19 |
$s99_own_image = esc_html( $s99_options['s99_mobile_img_url'] );
|
20 |
|
21 |
if ( '' !== $s99_mobile_img_height ) {
|
28 |
$s99_img_css .= "width: $s99_mobile_img_width; ";
|
29 |
}
|
30 |
} else {
|
|
|
31 |
$s99_own_image = esc_html( $s99_options['s99_dekstop_img_url'] );
|
32 |
|
33 |
if ( '' !== $s99_desktop_img_height ) {
|
new/tools/woo/class-ht-ctc-admin-woo.php
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* woocommerce related setting at chat settings page
|
4 |
+
*
|
5 |
+
* @package ctc
|
6 |
+
* @subpackage admin
|
7 |
+
* @since 2.9
|
8 |
+
*/
|
9 |
+
|
10 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
11 |
+
|
12 |
+
if ( ! class_exists( 'HT_CTC_Admin_WOO' ) ) :
|
13 |
+
|
14 |
+
class HT_CTC_Admin_WOO {
|
15 |
+
|
16 |
+
public function __construct() {
|
17 |
+
$this->woo_admin_hooks();
|
18 |
+
}
|
19 |
+
|
20 |
+
// Hooks
|
21 |
+
function woo_admin_hooks() {
|
22 |
+
add_action( 'ht_ctc_ah_admin_chat_woo_settings', array($this, 'ht_ctc_chat_settings') );
|
23 |
+
}
|
24 |
+
|
25 |
+
|
26 |
+
|
27 |
+
function ht_ctc_chat_settings() {
|
28 |
+
|
29 |
+
$options = get_option('ht_ctc_chat_options');
|
30 |
+
|
31 |
+
$woo_pre_filled = '';
|
32 |
+
if ( isset( $options['woo_pre_filled'] ) ) {
|
33 |
+
$woo_pre_filled = esc_attr( $options['woo_pre_filled'] );
|
34 |
+
}
|
35 |
+
$woo_call_to_action = '';
|
36 |
+
if ( isset( $options['woo_call_to_action'] ) ) {
|
37 |
+
$woo_call_to_action = esc_attr( $options['woo_call_to_action'] );
|
38 |
+
}
|
39 |
+
$blogname = HT_CTC_BLOG_NAME;
|
40 |
+
$placeholder = "Hello $blogname!! \nName: \nLike to buy this {{product}}, {{url}}";
|
41 |
+
?>
|
42 |
+
|
43 |
+
<ul class="collapsible">
|
44 |
+
<li class="active">
|
45 |
+
<div class="collapsible-header">WooCommerce</div>
|
46 |
+
<div class="collapsible-body">
|
47 |
+
|
48 |
+
<!-- prefilled message -->
|
49 |
+
<div class="row">
|
50 |
+
<div class="input-field col s12">
|
51 |
+
<textarea name="ht_ctc_chat_options[woo_pre_filled]" id="woo_pre_filled" class="materialize-textarea input-margin" style="min-height: 84px;" placeholder="<?php echo $placeholder ?>"><?php echo $woo_pre_filled ?></textarea>
|
52 |
+
<label for="woo_pre_filled">Pre-filled message</label>
|
53 |
+
<p class="description">Pre-filled message for WooCommerce Single Product pages. Leave blank to get default pre-filled message.</p>
|
54 |
+
<p class="description">Variables: {product}, {price}, {regular_price}, {sku}, {site}, {url}, {title} - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/woocommerce_pre-filled-message/">more info</a> </p>
|
55 |
+
</div>
|
56 |
+
</div>
|
57 |
+
|
58 |
+
<!-- Call to Action -->
|
59 |
+
<div class="row">
|
60 |
+
<div class="input-field col s12">
|
61 |
+
<input name="ht_ctc_chat_options[woo_call_to_action]" value="<?php echo $woo_call_to_action ?>" id="woo_call_to_action" type="text" class="input-margin">
|
62 |
+
<label for="woo_call_to_action">Call to Action</label>
|
63 |
+
<p class="description">Call-to-Action for WooCommerce Single Product pages. Leave blank to get default call-to-action - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/woocommerce_call-to-action/">more info</a> </p>
|
64 |
+
</div>
|
65 |
+
</div>
|
66 |
+
|
67 |
+
|
68 |
+
</div>
|
69 |
+
</div>
|
70 |
+
</li>
|
71 |
+
<ul>
|
72 |
+
|
73 |
+
<?php
|
74 |
+
}
|
75 |
+
|
76 |
+
|
77 |
+
|
78 |
+
|
79 |
+
|
80 |
+
|
81 |
+
}
|
82 |
+
new HT_CTC_Admin_WOO();
|
83 |
+
|
84 |
+
endif; // END class_exists check
|
new/tools/woo/class-ht-ctc-woo.php
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* woocommerce related front end.
|
4 |
+
*
|
5 |
+
* @package ctc
|
6 |
+
* @since 2.9
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
10 |
+
|
11 |
+
if ( ! class_exists( 'HT_CTC_Admin_WOO' ) ) :
|
12 |
+
|
13 |
+
class HT_CTC_Admin_WOO {
|
14 |
+
|
15 |
+
public function __construct() {
|
16 |
+
$this->woo_hooks();
|
17 |
+
}
|
18 |
+
|
19 |
+
// Hooks
|
20 |
+
function woo_hooks() {
|
21 |
+
|
22 |
+
add_filter( 'ht_ctc_fh_chat', array($this, 'chat') );
|
23 |
+
}
|
24 |
+
|
25 |
+
|
26 |
+
function chat( $ht_ctc_chat ) {
|
27 |
+
|
28 |
+
$options = get_option('ht_ctc_chat_options');
|
29 |
+
|
30 |
+
// if woocommerce single product page
|
31 |
+
if ( function_exists( 'is_product' ) && function_exists( 'wc_get_product' )) {
|
32 |
+
if ( is_product() ) {
|
33 |
+
|
34 |
+
$product = wc_get_product();
|
35 |
+
|
36 |
+
$name = $product->get_name();
|
37 |
+
// $title = $product->get_title();
|
38 |
+
$price = $product->get_price();
|
39 |
+
$regular_price = $product->get_regular_price();
|
40 |
+
$sku = $product->get_sku();
|
41 |
+
|
42 |
+
// pre-filled
|
43 |
+
if ( isset( $options['woo_pre_filled'] ) && '' !== $options['woo_pre_filled'] ) {
|
44 |
+
$ht_ctc_chat['pre_filled'] = esc_attr( $options['woo_pre_filled'] );
|
45 |
+
$ht_ctc_chat['pre_filled'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_chat['pre_filled'], 'Click to Chat for WhatsApp', 'woo_pre_filled' );
|
46 |
+
}
|
47 |
+
// variables now works in default pre_filled also
|
48 |
+
$ht_ctc_chat['pre_filled'] = str_replace( array('{product}', '{price}', '{regular_price}', '{sku}' ), array( $name, $price, $regular_price, $sku ), $ht_ctc_chat['pre_filled'] );
|
49 |
+
|
50 |
+
// call to action
|
51 |
+
if ( isset( $options['woo_call_to_action'] ) && '' !== $options['woo_call_to_action'] ) {
|
52 |
+
$ht_ctc_chat['call_to_action'] = esc_attr( $options['woo_call_to_action'] );
|
53 |
+
$ht_ctc_chat['call_to_action'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_chat['call_to_action'], 'Click to Chat for WhatsApp', 'woo_call_to_action' );
|
54 |
+
$ht_ctc_chat['call_to_action'] = str_replace( array('{product}', '{price}', '{regular_price}', '{sku}' ), array( $name, $price, $regular_price, $sku ), $ht_ctc_chat['call_to_action'] );
|
55 |
+
}
|
56 |
+
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
return $ht_ctc_chat;
|
61 |
+
}
|
62 |
+
|
63 |
+
|
64 |
+
|
65 |
+
|
66 |
+
|
67 |
+
|
68 |
+
|
69 |
+
|
70 |
+
|
71 |
+
|
72 |
+
|
73 |
+
}
|
74 |
+
|
75 |
+
new HT_CTC_Admin_WOO();
|
76 |
+
|
77 |
+
endif; // END class_exists check
|
new/tools/woo/ht-ctc-woo.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Init WooCommerce
|
4 |
+
*/
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
function ht_ctc_woo() {
|
9 |
+
if ( class_exists( 'WooCommerce' ) ) {
|
10 |
+
|
11 |
+
if ( is_admin() ) {
|
12 |
+
include_once HT_CTC_PLUGIN_DIR .'new/tools/woo/class-ht-ctc-admin-woo.php';
|
13 |
+
} else {
|
14 |
+
include_once HT_CTC_PLUGIN_DIR .'new/tools/woo/class-ht-ctc-woo.php';
|
15 |
+
}
|
16 |
+
|
17 |
+
}
|
18 |
+
}
|
19 |
+
|
20 |
+
// After plugins loaded check if woo exists and include related files.
|
21 |
+
add_action( 'plugins_loaded', 'ht_ctc_woo' );
|
prev/admin/admin.php
CHANGED
@@ -24,7 +24,7 @@ include_once('class-ccw-admin-others.php');
|
|
24 |
|
25 |
// as translation text added only in admin - so done here
|
26 |
// function load_ht_ccw_textdomain() {
|
27 |
-
// load_plugin_textdomain( 'click-to-chat-for-whatsapp', FALSE,
|
28 |
// }
|
29 |
|
30 |
// add_action( 'plugins_loaded', 'load_ht_ccw_textdomain' );
|
24 |
|
25 |
// as translation text added only in admin - so done here
|
26 |
// function load_ht_ccw_textdomain() {
|
27 |
+
// load_plugin_textdomain( 'click-to-chat-for-whatsapp', FALSE, HT_CTC_PLUGIN_BASENAME . 'prev/languages/' );
|
28 |
// }
|
29 |
|
30 |
// add_action( 'plugins_loaded', 'load_ht_ccw_textdomain' );
|
prev/admin/class-ccw-add-styles-scripts-admin.php
CHANGED
@@ -1,8 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
4 |
-
* instead of register multiple styles - as using sass in dev env,
|
5 |
-
* import files and at final create less css files
|
6 |
*
|
7 |
* @package ccw
|
8 |
* @subpackage Administration
|
@@ -23,15 +21,11 @@ class CCW_Add_Styles_Scripts_Admin {
|
|
23 |
|
24 |
wp_enqueue_style( 'wp-color-picker' );
|
25 |
|
26 |
-
wp_enqueue_style('ccw_admin_md_css', plugins_url( 'new/admin/admin_assets/css/materialize.min.css',
|
27 |
-
wp_enqueue_style('ccw_admin_main_css', plugins_url( 'prev/assets/css/admin_main.css',
|
28 |
-
|
29 |
-
|
30 |
-
// wp_enqueue_script( 'ccw_admin_md_js', plugins_url( 'prev/assets/js/admin_app.js', HT_CCW_PLUGIN_FILE ), array( 'wp-color-picker' ), HT_CCW_VERSION, true );
|
31 |
-
// wp_enqueue_script( 'ccw_admin_md_js', plugins_url( 'prev/assets/js/required/admin_app-works.js', HT_CCW_PLUGIN_FILE ), array( 'wp-color-picker' ), HT_CCW_VERSION, true );
|
32 |
-
wp_enqueue_script( 'ccw_admin_md_js', plugins_url( 'new/admin/admin_assets/js/materialize.min.js', HT_CCW_PLUGIN_FILE ), array( 'jquery' ), HT_CCW_VERSION, true );
|
33 |
-
wp_enqueue_script( 'ccw_admin_app_js', plugins_url( 'prev/assets/js/admin_app.js', HT_CCW_PLUGIN_FILE ), array( 'ccw_admin_md_js', 'jquery', 'wp-color-picker' ), HT_CCW_VERSION, true );
|
34 |
|
|
|
|
|
35 |
} else {
|
36 |
return;
|
37 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Enqueue styles, scripts
|
|
|
|
|
4 |
*
|
5 |
* @package ccw
|
6 |
* @subpackage Administration
|
21 |
|
22 |
wp_enqueue_style( 'wp-color-picker' );
|
23 |
|
24 |
+
wp_enqueue_style('ccw_admin_md_css', plugins_url( 'new/admin/admin_assets/css/materialize.min.css', HT_CTC_PLUGIN_FILE ) , '', HT_CTC_VERSION );
|
25 |
+
wp_enqueue_style('ccw_admin_main_css', plugins_url( 'prev/assets/css/admin_main.css', HT_CTC_PLUGIN_FILE ) , '', HT_CTC_VERSION );
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
+
wp_enqueue_script( 'ccw_admin_md_js', plugins_url( 'new/admin/admin_assets/js/materialize.min.js', HT_CTC_PLUGIN_FILE ), array( 'jquery' ), HT_CTC_VERSION, true );
|
28 |
+
wp_enqueue_script( 'ccw_admin_app_js', plugins_url( 'prev/assets/js/admin_app.js', HT_CTC_PLUGIN_FILE ), array( 'ccw_admin_md_js', 'jquery', 'wp-color-picker' ), HT_CTC_VERSION, true );
|
29 |
} else {
|
30 |
return;
|
31 |
}
|
prev/admin/class-ccw-admin-others.php
CHANGED
@@ -18,10 +18,10 @@ class HT_CCW_Admin_Others {
|
|
18 |
|
19 |
|
20 |
public function __construct() {
|
21 |
-
$this->
|
22 |
}
|
23 |
|
24 |
-
function
|
25 |
|
26 |
// if number blank
|
27 |
$ccw_options = get_option('ccw_options');
|
18 |
|
19 |
|
20 |
public function __construct() {
|
21 |
+
$this->admin_notice();
|
22 |
}
|
23 |
|
24 |
+
function admin_notice() {
|
25 |
|
26 |
// if number blank
|
27 |
$ccw_options = get_option('ccw_options');
|
prev/admin/class-ccw-admin-page-customize-styles.php
CHANGED
@@ -89,7 +89,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
89 |
|
90 |
<div class="row">
|
91 |
<div class="col s6">
|
92 |
-
<p><?php _e( 'Text Color'
|
93 |
</div>
|
94 |
<div class="input-field col s6">
|
95 |
<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;" >
|
@@ -98,7 +98,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
98 |
|
99 |
<div class="row">
|
100 |
<div class="col s6">
|
101 |
-
<p><?php _e( 'Text Color
|
102 |
</div>
|
103 |
<div class="input-field col s6">
|
104 |
<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;" >
|
@@ -107,7 +107,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
107 |
|
108 |
<div class="row">
|
109 |
<div class="col s6">
|
110 |
-
<p><?php _e( 'Text Decoration'
|
111 |
</div>
|
112 |
<div class="input-field col s6">
|
113 |
<select name="ccw_options_cs[s2_decoration]" class="select-2_2">
|
@@ -118,13 +118,13 @@ class CCW_Admin_Page_Customize_Styles {
|
|
118 |
<option value="initial" <?php echo $s2_decoration_value == 'initial' ? 'SELECTED' : ''; ?> >initial</option>
|
119 |
<option value="inherit" <?php echo $s2_decoration_value == 'inherit' ? 'SELECTED' : ''; ?> >inherit</option>
|
120 |
</select>
|
121 |
-
<label><?php _e( 'Text Decoration'
|
122 |
</div>
|
123 |
</div>
|
124 |
|
125 |
<div class="row">
|
126 |
<div class="col s6">
|
127 |
-
<p><?php _e( 'Text Decoration when Hover'
|
128 |
</div>
|
129 |
<div class="input-field col s6">
|
130 |
<select name="ccw_options_cs[s2_decoration_onhover]" class="select-2_2">
|
@@ -135,7 +135,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
135 |
<option value="initial" <?php echo $s2_decoration_onhover == 'initial' ? 'SELECTED' : ''; ?> >initial</option>
|
136 |
<option value="inherit" <?php echo $s2_decoration_onhover == 'inherit' ? 'SELECTED' : ''; ?> >inherit</option>
|
137 |
</select>
|
138 |
-
<label
|
139 |
</div>
|
140 |
</div>
|
141 |
|
@@ -159,7 +159,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
159 |
|
160 |
<div class="row">
|
161 |
<div class="col s6">
|
162 |
-
<p><?php _e( 'Image size'
|
163 |
</div>
|
164 |
<div class="input-field col s4">
|
165 |
<input name="ccw_options_cs[s3_icon_size]" value="<?php echo esc_attr( $ccw_style_3['s3_icon_size'] ) ?>" type="text" class="" >
|
@@ -187,7 +187,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
187 |
|
188 |
<div class="row">
|
189 |
<div class="col s6">
|
190 |
-
<p><?php _e( 'Text Color'
|
191 |
</div>
|
192 |
<div class="input-field col s6">
|
193 |
<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;" >
|
@@ -196,7 +196,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
196 |
|
197 |
<div class="row">
|
198 |
<div class="col s6">
|
199 |
-
<p><?php _e( 'Background Color'
|
200 |
</div>
|
201 |
<div class="input-field col s6">
|
202 |
<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;" >
|
@@ -223,7 +223,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
223 |
|
224 |
<div class="row">
|
225 |
<div class="col s6">
|
226 |
-
<p
|
227 |
</div>
|
228 |
<div class="input-field col s6">
|
229 |
<!-- style="height: 1.375rem;" or 22px -->
|
@@ -233,7 +233,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
233 |
|
234 |
<div class="row">
|
235 |
<div class="col s6">
|
236 |
-
<p
|
237 |
</div>
|
238 |
<div class="input-field col s6">
|
239 |
<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;" >
|
@@ -242,7 +242,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
242 |
|
243 |
<div class="row">
|
244 |
<div class="col s6">
|
245 |
-
<p
|
246 |
</div>
|
247 |
<div class="input-field col s4">
|
248 |
<input name="ccw_options_cs[s5_icon_size]" value="<?php echo esc_attr( $ccw_style_5['s5_icon_size'] ) ?>" type="text" class="" >
|
@@ -268,7 +268,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
268 |
|
269 |
<div class="row">
|
270 |
<div class="col s6">
|
271 |
-
<p
|
272 |
</div>
|
273 |
<div class="input-field col s6">
|
274 |
<!-- style="height: 1.375rem;" or 22px -->
|
@@ -278,7 +278,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
278 |
|
279 |
<div class="row">
|
280 |
<div class="col s6">
|
281 |
-
<p
|
282 |
</div>
|
283 |
<div class="input-field col s6">
|
284 |
<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;" >
|
@@ -287,7 +287,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
287 |
|
288 |
<div class="row">
|
289 |
<div class="col s6">
|
290 |
-
<p
|
291 |
</div>
|
292 |
<div class="input-field col s4">
|
293 |
<input name="ccw_options_cs[s6_icon_size]" value="<?php echo esc_attr( $ccw_style_6['s6_icon_size'] ) ?>" type="text" class="" >
|
@@ -296,7 +296,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
296 |
|
297 |
<div class="row">
|
298 |
<div class="col s6">
|
299 |
-
<p
|
300 |
</div>
|
301 |
<div class="input-field col s6">
|
302 |
<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;" >
|
@@ -305,7 +305,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
305 |
|
306 |
<div class="row">
|
307 |
<div class="col s6">
|
308 |
-
<p
|
309 |
</div>
|
310 |
<div class="input-field col s6">
|
311 |
<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;" >
|
@@ -315,7 +315,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
315 |
|
316 |
<div class="row">
|
317 |
<div class="col s6">
|
318 |
-
<p
|
319 |
</div>
|
320 |
<div class="input-field col s4">
|
321 |
<input name="ccw_options_cs[s6_circle_height]" value="<?php echo esc_attr( $ccw_style_6['s6_circle_height'] ) ?>" type="text" class="" >
|
@@ -324,7 +324,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
324 |
|
325 |
<div class="row">
|
326 |
<div class="col s6">
|
327 |
-
<p
|
328 |
</div>
|
329 |
<div class="input-field col s4">
|
330 |
<input name="ccw_options_cs[s6_circle_width]" value="<?php echo esc_attr( $ccw_style_6['s6_circle_width'] ) ?>" type="text" class="" >
|
@@ -333,14 +333,14 @@ class CCW_Admin_Page_Customize_Styles {
|
|
333 |
|
334 |
<div class="row">
|
335 |
<div class="col s6">
|
336 |
-
<p
|
337 |
</div>
|
338 |
<div class="input-field col s4">
|
339 |
<input name="ccw_options_cs[s6_line_height]" value="<?php echo esc_attr( $ccw_style_6['s6_line_height'] ) ?>" type="text" class="" >
|
340 |
</div>
|
341 |
</div>
|
342 |
|
343 |
-
<p class="description"
|
344 |
|
345 |
</div>
|
346 |
</div>
|
@@ -364,7 +364,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
364 |
|
365 |
<div class="row">
|
366 |
<div class="col s6">
|
367 |
-
<p
|
368 |
</div>
|
369 |
<div class="input-field col s6">
|
370 |
<!-- style="height: 1.375rem;" or 22px -->
|
@@ -374,7 +374,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
374 |
|
375 |
<div class="row">
|
376 |
<div class="col s6">
|
377 |
-
<p
|
378 |
</div>
|
379 |
<div class="input-field col s6">
|
380 |
<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;" >
|
@@ -383,7 +383,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
383 |
|
384 |
<div class="row">
|
385 |
<div class="col s6">
|
386 |
-
<p
|
387 |
</div>
|
388 |
<div class="input-field col s4">
|
389 |
<input name="ccw_options_cs[s7_icon_size]" value="<?php echo esc_attr( $ccw_style_7['s7_icon_size'] ) ?>" type="text" class="" >
|
@@ -392,7 +392,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
392 |
|
393 |
<div class="row">
|
394 |
<div class="col s6">
|
395 |
-
<p
|
396 |
</div>
|
397 |
<div class="input-field col s6">
|
398 |
<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;" >
|
@@ -401,7 +401,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
401 |
|
402 |
<div class="row">
|
403 |
<div class="col s6">
|
404 |
-
<p
|
405 |
</div>
|
406 |
<div class="input-field col s6">
|
407 |
<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;" >
|
@@ -411,7 +411,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
411 |
|
412 |
<div class="row">
|
413 |
<div class="col s6">
|
414 |
-
<p
|
415 |
</div>
|
416 |
<div class="input-field col s4">
|
417 |
<input name="ccw_options_cs[s7_box_height]" value="<?php echo esc_attr( $ccw_style_7['s7_box_height'] ) ?>" type="text" class="" >
|
@@ -420,7 +420,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
420 |
|
421 |
<div class="row">
|
422 |
<div class="col s6">
|
423 |
-
<p
|
424 |
</div>
|
425 |
<div class="input-field col s4">
|
426 |
<input name="ccw_options_cs[s7_box_width]" value="<?php echo esc_attr( $ccw_style_7['s7_box_width'] ) ?>" type="text" class="" >
|
@@ -429,14 +429,14 @@ class CCW_Admin_Page_Customize_Styles {
|
|
429 |
|
430 |
<div class="row">
|
431 |
<div class="col s6">
|
432 |
-
<p
|
433 |
</div>
|
434 |
<div class="input-field col s4">
|
435 |
<input name="ccw_options_cs[s7_line_height]" value="<?php echo esc_attr( $ccw_style_7['s7_line_height'] ) ?>" type="text" class="" >
|
436 |
</div>
|
437 |
</div>
|
438 |
|
439 |
-
<p class="description"
|
440 |
|
441 |
|
442 |
</div>
|
@@ -461,7 +461,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
461 |
|
462 |
<div class="row">
|
463 |
<div class="col s6">
|
464 |
-
<p><?php _e( 'Text Color'
|
465 |
</div>
|
466 |
<div class="input-field col s6">
|
467 |
<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;" >
|
@@ -470,7 +470,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
470 |
|
471 |
<div class="row">
|
472 |
<div class="col s6">
|
473 |
-
<p><?php _e( 'Background Color'
|
474 |
</div>
|
475 |
<div class="input-field col s6">
|
476 |
<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;" >
|
@@ -479,7 +479,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
479 |
|
480 |
<div class="row">
|
481 |
<div class="col s6">
|
482 |
-
<p><?php _e( 'Icon color'
|
483 |
</div>
|
484 |
<div class="input-field col s6">
|
485 |
<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;" >
|
@@ -488,7 +488,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
488 |
|
489 |
<div class="row">
|
490 |
<div class="col s6">
|
491 |
-
<p><?php _e( 'Text Color on hover'
|
492 |
</div>
|
493 |
<div class="input-field col s6">
|
494 |
<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;" >
|
@@ -497,7 +497,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
497 |
|
498 |
<div class="row">
|
499 |
<div class="col s6">
|
500 |
-
<p><?php _e( 'Background Color on hover'
|
501 |
</div>
|
502 |
<div class="input-field col s6">
|
503 |
<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;" >
|
@@ -506,7 +506,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
506 |
|
507 |
<div class="row">
|
508 |
<div class="col s6">
|
509 |
-
<p><?php _e( 'Icon color on hover'
|
510 |
</div>
|
511 |
<div class="input-field col s6">
|
512 |
<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;" >
|
@@ -515,7 +515,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
515 |
|
516 |
<div class="row">
|
517 |
<div class="col s6">
|
518 |
-
<p
|
519 |
</div>
|
520 |
<div class="input-field col s6">
|
521 |
<select name="ccw_options_cs[s8_icon_float]" class="select-2_2">
|
@@ -523,14 +523,14 @@ class CCW_Admin_Page_Customize_Styles {
|
|
523 |
<option value="right" <?php echo $s8_icon_float == 'right' ? 'SELECTED' : ''; ?> >right</option>
|
524 |
<option value="hide" <?php echo $s8_icon_float == 'hide' ? 'SELECTED' : ''; ?> >hide</option>
|
525 |
</select>
|
526 |
-
<label
|
527 |
</div>
|
528 |
</div>
|
529 |
|
530 |
<!-- hidden value - as in array empty values are not updating .. -->
|
531 |
<div class="row hide">
|
532 |
<div class="col s6">
|
533 |
-
<p><?php _e( 'Icon size'
|
534 |
</div>
|
535 |
<div class="input-field col s4">
|
536 |
<input name="ccw_options_cs[s8_1_width]" value="<?php echo esc_attr( $ccw_style_8['s8_1_width'] ) ?>" type="text" class="" >
|
@@ -557,7 +557,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
557 |
|
558 |
<div class="row">
|
559 |
<div class="col s6">
|
560 |
-
<p><?php _e( 'Image size'
|
561 |
</div>
|
562 |
<div class="input-field col s4">
|
563 |
<input name="ccw_options_cs[s9_icon_size]" value="<?php echo esc_attr( $ccw_style_9['s9_icon_size'] ) ?>" type="text" class="" >
|
@@ -579,15 +579,15 @@ class CCW_Admin_Page_Customize_Styles {
|
|
579 |
?>
|
580 |
<ul class="collapsible" data-collapsible="accordion">
|
581 |
<li>
|
582 |
-
<div class="collapsible-header"
|
583 |
<div class="collapsible-body">
|
584 |
|
585 |
|
586 |
<div class="row">
|
587 |
<div class="input-field col s12">
|
588 |
<input name="ccw_options_cs[s99_desktop_img]" value="<?php echo esc_attr( $ccw_style_99_own_img['s99_desktop_img'] ) ?>" id="img-url-desktop" type="text" class="validate">
|
589 |
-
<label for="img-url-desktop"><?php _e( 'Image URL - Desktop'
|
590 |
-
<p class="description">e.g. https://example.com/img.png - <a target="_blank" href="https://holithemes.com/whatsapp-chat/style-99-own-image/"
|
591 |
<p class="description">Image / GIF </p>
|
592 |
</div>
|
593 |
</div>
|
@@ -595,19 +595,19 @@ class CCW_Admin_Page_Customize_Styles {
|
|
595 |
<div class="row">
|
596 |
<div class="input-field col s12">
|
597 |
<input name="ccw_options_cs[s99_mobile_img]" value="<?php echo esc_attr( $ccw_style_99_own_img['s99_mobile_img'] ) ?>" id="img-url-mobile" type="text" class="validate">
|
598 |
-
<label for="img-url-mobile"><?php _e( 'Image URL - Mobile'
|
599 |
-
<p class="description">e.g. https://example.com/img.png - <a target="_blank" href="https://holithemes.com/whatsapp-chat/style-99-own-image/"
|
600 |
</div>
|
601 |
</div>
|
602 |
|
603 |
<br><hr><br>
|
604 |
<p class="description">Instead of changing the Heigth, Width - Add Image with pefect size, and keep this field blank </p>
|
605 |
-
<p class="description">If not then add only height or width for better result ( Heigth preferred ) <a target="_blank" href="https://holithemes.com/whatsapp-chat/style-99-own-image/"
|
606 |
<br>
|
607 |
|
608 |
<div class="row">
|
609 |
<div class="col s6">
|
610 |
-
<p><?php _e( 'Desktop - Image Height'
|
611 |
</div>
|
612 |
<div class="input-field col s4">
|
613 |
<input name="ccw_options_cs[s99_img_height_desktop]" value="<?php echo esc_attr( $ccw_style_99_own_img['s99_img_height_desktop'] ) ?>" type="text" class="" >
|
@@ -616,7 +616,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
616 |
|
617 |
<div class="row">
|
618 |
<div class="col s6">
|
619 |
-
<p><?php _e( 'Desktop - Image Width'
|
620 |
</div>
|
621 |
<div class="input-field col s4">
|
622 |
<input name="ccw_options_cs[s99_img_width_desktop]" value="<?php echo esc_attr( $ccw_style_99_own_img['s99_img_width_desktop'] ) ?>" type="text" class="" >
|
@@ -626,7 +626,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
626 |
|
627 |
<div class="row">
|
628 |
<div class="col s6">
|
629 |
-
<p><?php _e( 'Mobile - Image Height'
|
630 |
</div>
|
631 |
<div class="input-field col s4">
|
632 |
<input name="ccw_options_cs[s99_img_height_mobile]" value="<?php echo esc_attr( $ccw_style_99_own_img['s99_img_height_mobile'] ) ?>" type="text" class="" >
|
@@ -635,14 +635,14 @@ class CCW_Admin_Page_Customize_Styles {
|
|
635 |
|
636 |
<div class="row">
|
637 |
<div class="col s6">
|
638 |
-
<p><?php _e( 'Mobile - Image Width'
|
639 |
</div>
|
640 |
<div class="input-field col s4">
|
641 |
<input name="ccw_options_cs[s99_img_width_mobile]" value="<?php echo esc_attr( $ccw_style_99_own_img['s99_img_width_mobile'] ) ?>" type="text" class="" >
|
642 |
</div>
|
643 |
</div>
|
644 |
|
645 |
-
<p class="description">
|
646 |
|
647 |
|
648 |
|
@@ -673,15 +673,15 @@ class CCW_Admin_Page_Customize_Styles {
|
|
673 |
<div class="collapsible-header">Animations - alpha release </div>
|
674 |
<div class="collapsible-body">
|
675 |
|
676 |
-
<p class="description">
|
677 |
-
<p class="description">
|
678 |
<br><br>
|
679 |
|
680 |
|
681 |
<!-- animation on load -->
|
682 |
<div class="row">
|
683 |
<div class="col s6">
|
684 |
-
<p
|
685 |
</div>
|
686 |
<div class="input-field col s6">
|
687 |
<select name="ccw_options_cs[an_on_load]" class="select-2_2">
|
@@ -696,23 +696,23 @@ class CCW_Admin_Page_Customize_Styles {
|
|
696 |
|
697 |
?>
|
698 |
</select>
|
699 |
-
<label
|
700 |
</div>
|
701 |
</div>
|
702 |
|
703 |
<!-- animation on hover -->
|
704 |
<div class="row">
|
705 |
<div class="col s6">
|
706 |
-
<p
|
707 |
</div>
|
708 |
<div class="input-field col s6">
|
709 |
<select name="ccw_options_cs[an_on_hover]" class="select-2_2">
|
710 |
<option value="ccw-an" <?php echo $an_on_hover == 'ccw-an' ? 'SELECTED' : ''; ?> >Yes</option>
|
711 |
<option value="ccw-no-hover-an" <?php echo $an_on_hover == 'ccw-no-hover-an' ? 'SELECTED' : ''; ?> >No</option>
|
712 |
</select>
|
713 |
-
<label
|
714 |
</div>
|
715 |
-
<p class="description"
|
716 |
</div>
|
717 |
|
718 |
|
@@ -741,14 +741,14 @@ class CCW_Admin_Page_Customize_Styles {
|
|
741 |
<div id="ga-analytics" class="collapsible-header">Google Analytics </div>
|
742 |
<div class="collapsible-body">
|
743 |
|
744 |
-
<p class="description">
|
745 |
-
<p class="description">
|
746 |
<br><br>
|
747 |
|
748 |
<!-- Category Name -->
|
749 |
<div class="row">
|
750 |
<div class="col s6">
|
751 |
-
<p
|
752 |
</div>
|
753 |
<div class="input-field col s5">
|
754 |
<input name="ht_ccw_ga[ga_category]" value="<?php echo esc_attr( $ht_ccw_ga['ga_category'] ) ?>" type="text" class="" >
|
@@ -758,7 +758,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
758 |
<!-- Action Name -->
|
759 |
<div class="row">
|
760 |
<div class="col s6">
|
761 |
-
<p
|
762 |
</div>
|
763 |
<div class="input-field col s5">
|
764 |
<input name="ht_ccw_ga[ga_action]" value="<?php echo esc_attr( $ht_ccw_ga['ga_action'] ) ?>" type="text" class="" >
|
@@ -768,7 +768,7 @@ class CCW_Admin_Page_Customize_Styles {
|
|
768 |
<!-- Label Name -->
|
769 |
<div class="row">
|
770 |
<div class="col s6">
|
771 |
-
<p
|
772 |
</div>
|
773 |
<div class="input-field col s5">
|
774 |
<input name="ht_ccw_ga[ga_label]" value="<?php echo esc_attr( $ht_ccw_ga['ga_label'] ) ?>" type="text" class="" >
|
@@ -801,14 +801,14 @@ class CCW_Admin_Page_Customize_Styles {
|
|
801 |
<div id="fb-analytics" class="collapsible-header">Facebook Analytics </div>
|
802 |
<div class="collapsible-body">
|
803 |
|
804 |
-
<p class="description">
|
805 |
-
<p class="description">
|
806 |
<br><br>
|
807 |
|
808 |
<!-- Event Name -->
|
809 |
<div class="row">
|
810 |
<div class="col s6">
|
811 |
-
<p
|
812 |
</div>
|
813 |
<div class="input-field col s5">
|
814 |
<input name="ht_ccw_fb[fb_event_name]" value="<?php echo esc_attr( $ht_ccw_fb['fb_event_name'] ) ?>" type="text" class="" >
|
@@ -818,18 +818,18 @@ class CCW_Admin_Page_Customize_Styles {
|
|
818 |
<!-- Parameter 1 -->
|
819 |
<div class="row">
|
820 |
<div class="col s6">
|
821 |
-
<p
|
822 |
</div>
|
823 |
<div class="input-field col s5">
|
824 |
|
825 |
<div class="input-field col">
|
826 |
<input name="ht_ccw_fb[p1_name]" value="<?php echo esc_attr( $ht_ccw_fb['p1_name'] ) ?>" id="p1_name" type="text" class="" >
|
827 |
-
<label for="p1_name"
|
828 |
</div>
|
829 |
|
830 |
<div class="input-field col">
|
831 |
<input name="ht_ccw_fb[p1_value]" value="<?php echo esc_attr( $ht_ccw_fb['p1_value'] ) ?>" id="p1_value" type="text" class="" >
|
832 |
-
<label for="p1_value"
|
833 |
</div>
|
834 |
|
835 |
</div>
|
@@ -839,18 +839,18 @@ class CCW_Admin_Page_Customize_Styles {
|
|
839 |
<!-- Parameter 2 -->
|
840 |
<div class="row">
|
841 |
<div class="col s6">
|
842 |
-
<p
|
843 |
</div>
|
844 |
<div class="input-field col s5">
|
845 |
|
846 |
<div class="input-field col">
|
847 |
<input name="ht_ccw_fb[p2_name]" value="<?php echo esc_attr( $ht_ccw_fb['p2_name'] ) ?>" id="p2_name" type="text" class="" >
|
848 |
-
<label for="p2_name"
|
849 |
</div>
|
850 |
|
851 |
<div class="input-field col">
|
852 |
<input name="ht_ccw_fb[p2_value]" value="<?php echo esc_attr( $ht_ccw_fb['p2_value'] ) ?>" id="p2_value" type="text" class="" >
|
853 |
-
<label for="p2_value"
|
854 |
</div>
|
855 |
|
856 |
</div>
|
@@ -860,18 +860,18 @@ class CCW_Admin_Page_Customize_Styles {
|
|
860 |
<!-- Parameter 3 -->
|
861 |
<div class="row">
|
862 |
<div class="col s6">
|
863 |
-
<p
|
864 |
</div>
|
865 |
<div class="input-field col s5">
|
866 |
|
867 |
<div class="input-field col">
|
868 |
<input name="ht_ccw_fb[p3_name]" value="<?php echo esc_attr( $ht_ccw_fb['p3_name'] ) ?>" id="p3_name" type="text" class="" >
|
869 |
-
<label for="p3_name"
|
870 |
</div>
|
871 |
|
872 |
<div class="input-field col">
|
873 |
<input name="ht_ccw_fb[p3_value]" value="<?php echo esc_attr( $ht_ccw_fb['p3_value'] ) ?>" id="p3_value" type="text" class="" >
|
874 |
-
<label for="p3_value"
|
875 |
</div>
|
876 |
|
877 |
</div>
|
89 |
|
90 |
<div class="row">
|
91 |
<div class="col s6">
|
92 |
+
<p><?php _e( 'Text Color', 'click-to-chat-for-whatsapp' ); ?></p>
|
93 |
</div>
|
94 |
<div class="input-field col s6">
|
95 |
<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;" >
|
98 |
|
99 |
<div class="row">
|
100 |
<div class="col s6">
|
101 |
+
<p><?php _e( 'Text Color on Hover', 'click-to-chat-for-whatsapp' ); ?> </p>
|
102 |
</div>
|
103 |
<div class="input-field col s6">
|
104 |
<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;" >
|
107 |
|
108 |
<div class="row">
|
109 |
<div class="col s6">
|
110 |
+
<p><?php _e( 'Text Decoration', 'click-to-chat-for-whatsapp' ); ?> </p>
|
111 |
</div>
|
112 |
<div class="input-field col s6">
|
113 |
<select name="ccw_options_cs[s2_decoration]" class="select-2_2">
|
118 |
<option value="initial" <?php echo $s2_decoration_value == 'initial' ? 'SELECTED' : ''; ?> >initial</option>
|
119 |
<option value="inherit" <?php echo $s2_decoration_value == 'inherit' ? 'SELECTED' : ''; ?> >inherit</option>
|
120 |
</select>
|
121 |
+
<label><?php _e( 'Text Decoration', 'click-to-chat-for-whatsapp' ); ?> </label>
|
122 |
</div>
|
123 |
</div>
|
124 |
|
125 |
<div class="row">
|
126 |
<div class="col s6">
|
127 |
+
<p><?php _e( 'Text Decoration when Hover', 'click-to-chat-for-whatsapp' ); ?> </p>
|
128 |
</div>
|
129 |
<div class="input-field col s6">
|
130 |
<select name="ccw_options_cs[s2_decoration_onhover]" class="select-2_2">
|
135 |
<option value="initial" <?php echo $s2_decoration_onhover == 'initial' ? 'SELECTED' : ''; ?> >initial</option>
|
136 |
<option value="inherit" <?php echo $s2_decoration_onhover == 'inherit' ? 'SELECTED' : ''; ?> >inherit</option>
|
137 |
</select>
|
138 |
+
<label>Text Decoration on focus </label>
|
139 |
</div>
|
140 |
</div>
|
141 |
|
159 |
|
160 |
<div class="row">
|
161 |
<div class="col s6">
|
162 |
+
<p><?php _e( 'Image size', 'click-to-chat-for-whatsapp' ); ?></p>
|
163 |
</div>
|
164 |
<div class="input-field col s4">
|
165 |
<input name="ccw_options_cs[s3_icon_size]" value="<?php echo esc_attr( $ccw_style_3['s3_icon_size'] ) ?>" type="text" class="" >
|
187 |
|
188 |
<div class="row">
|
189 |
<div class="col s6">
|
190 |
+
<p><?php _e( 'Text Color', 'click-to-chat-for-whatsapp' ); ?> </p>
|
191 |
</div>
|
192 |
<div class="input-field col s6">
|
193 |
<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;" >
|
196 |
|
197 |
<div class="row">
|
198 |
<div class="col s6">
|
199 |
+
<p><?php _e( 'Background Color', 'click-to-chat-for-whatsapp' ); ?> </p>
|
200 |
</div>
|
201 |
<div class="input-field col s6">
|
202 |
<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;" >
|
223 |
|
224 |
<div class="row">
|
225 |
<div class="col s6">
|
226 |
+
<p>Color of icon </p>
|
227 |
</div>
|
228 |
<div class="input-field col s6">
|
229 |
<!-- style="height: 1.375rem;" or 22px -->
|
233 |
|
234 |
<div class="row">
|
235 |
<div class="col s6">
|
236 |
+
<p>Color of icon - when hover </p>
|
237 |
</div>
|
238 |
<div class="input-field col s6">
|
239 |
<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;" >
|
242 |
|
243 |
<div class="row">
|
244 |
<div class="col s6">
|
245 |
+
<p>Size of icon </p>
|
246 |
</div>
|
247 |
<div class="input-field col s4">
|
248 |
<input name="ccw_options_cs[s5_icon_size]" value="<?php echo esc_attr( $ccw_style_5['s5_icon_size'] ) ?>" type="text" class="" >
|
268 |
|
269 |
<div class="row">
|
270 |
<div class="col s6">
|
271 |
+
<p>Color of icon</p>
|
272 |
</div>
|
273 |
<div class="input-field col s6">
|
274 |
<!-- style="height: 1.375rem;" or 22px -->
|
278 |
|
279 |
<div class="row">
|
280 |
<div class="col s6">
|
281 |
+
<p>Color of icon - when hover </p>
|
282 |
</div>
|
283 |
<div class="input-field col s6">
|
284 |
<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;" >
|
287 |
|
288 |
<div class="row">
|
289 |
<div class="col s6">
|
290 |
+
<p>Size of icon</p>
|
291 |
</div>
|
292 |
<div class="input-field col s4">
|
293 |
<input name="ccw_options_cs[s6_icon_size]" value="<?php echo esc_attr( $ccw_style_6['s6_icon_size'] ) ?>" type="text" class="" >
|
296 |
|
297 |
<div class="row">
|
298 |
<div class="col s6">
|
299 |
+
<p>Circle color </p>
|
300 |
</div>
|
301 |
<div class="input-field col s6">
|
302 |
<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;" >
|
305 |
|
306 |
<div class="row">
|
307 |
<div class="col s6">
|
308 |
+
<p>Circle color - when hover </p>
|
309 |
</div>
|
310 |
<div class="input-field col s6">
|
311 |
<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;" >
|
315 |
|
316 |
<div class="row">
|
317 |
<div class="col s6">
|
318 |
+
<p>Circle Height</p>
|
319 |
</div>
|
320 |
<div class="input-field col s4">
|
321 |
<input name="ccw_options_cs[s6_circle_height]" value="<?php echo esc_attr( $ccw_style_6['s6_circle_height'] ) ?>" type="text" class="" >
|
324 |
|
325 |
<div class="row">
|
326 |
<div class="col s6">
|
327 |
+
<p>Circle Width</p>
|
328 |
</div>
|
329 |
<div class="input-field col s4">
|
330 |
<input name="ccw_options_cs[s6_circle_width]" value="<?php echo esc_attr( $ccw_style_6['s6_circle_width'] ) ?>" type="text" class="" >
|
333 |
|
334 |
<div class="row">
|
335 |
<div class="col s6">
|
336 |
+
<p>Circle Line Height</p>
|
337 |
</div>
|
338 |
<div class="input-field col s4">
|
339 |
<input name="ccw_options_cs[s6_line_height]" value="<?php echo esc_attr( $ccw_style_6['s6_line_height'] ) ?>" type="text" class="" >
|
340 |
</div>
|
341 |
</div>
|
342 |
|
343 |
+
<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>
|
344 |
|
345 |
</div>
|
346 |
</div>
|
364 |
|
365 |
<div class="row">
|
366 |
<div class="col s6">
|
367 |
+
<p>Color of icon</p>
|
368 |
</div>
|
369 |
<div class="input-field col s6">
|
370 |
<!-- style="height: 1.375rem;" or 22px -->
|
374 |
|
375 |
<div class="row">
|
376 |
<div class="col s6">
|
377 |
+
<p>Color of icon - when hover </p>
|
378 |
</div>
|
379 |
<div class="input-field col s6">
|
380 |
<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;" >
|
383 |
|
384 |
<div class="row">
|
385 |
<div class="col s6">
|
386 |
+
<p>Size of icon</p>
|
387 |
</div>
|
388 |
<div class="input-field col s4">
|
389 |
<input name="ccw_options_cs[s7_icon_size]" value="<?php echo esc_attr( $ccw_style_7['s7_icon_size'] ) ?>" type="text" class="" >
|
392 |
|
393 |
<div class="row">
|
394 |
<div class="col s6">
|
395 |
+
<p>box color </p>
|
396 |
</div>
|
397 |
<div class="input-field col s6">
|
398 |
<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;" >
|
401 |
|
402 |
<div class="row">
|
403 |
<div class="col s6">
|
404 |
+
<p>box color - when hover </p>
|
405 |
</div>
|
406 |
<div class="input-field col s6">
|
407 |
<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;" >
|
411 |
|
412 |
<div class="row">
|
413 |
<div class="col s6">
|
414 |
+
<p>box Height</p>
|
415 |
</div>
|
416 |
<div class="input-field col s4">
|
417 |
<input name="ccw_options_cs[s7_box_height]" value="<?php echo esc_attr( $ccw_style_7['s7_box_height'] ) ?>" type="text" class="" >
|
420 |
|
421 |
<div class="row">
|
422 |
<div class="col s6">
|
423 |
+
<p>box Width</p>
|
424 |
</div>
|
425 |
<div class="input-field col s4">
|
426 |
<input name="ccw_options_cs[s7_box_width]" value="<?php echo esc_attr( $ccw_style_7['s7_box_width'] ) ?>" type="text" class="" >
|
429 |
|
430 |
<div class="row">
|
431 |
<div class="col s6">
|
432 |
+
<p>box Line Height</p>
|
433 |
</div>
|
434 |
<div class="input-field col s4">
|
435 |
<input name="ccw_options_cs[s7_line_height]" value="<?php echo esc_attr( $ccw_style_7['s7_line_height'] ) ?>" type="text" class="" >
|
436 |
</div>
|
437 |
</div>
|
438 |
|
439 |
+
<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>
|
440 |
|
441 |
|
442 |
</div>
|
461 |
|
462 |
<div class="row">
|
463 |
<div class="col s6">
|
464 |
+
<p><?php _e( 'Text Color', 'click-to-chat-for-whatsapp' ); ?></p>
|
465 |
</div>
|
466 |
<div class="input-field col s6">
|
467 |
<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;" >
|
470 |
|
471 |
<div class="row">
|
472 |
<div class="col s6">
|
473 |
+
<p><?php _e( 'Background Color', 'click-to-chat-for-whatsapp' ); ?></p>
|
474 |
</div>
|
475 |
<div class="input-field col s6">
|
476 |
<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;" >
|
479 |
|
480 |
<div class="row">
|
481 |
<div class="col s6">
|
482 |
+
<p><?php _e( 'Icon color', 'click-to-chat-for-whatsapp' ); ?></p>
|
483 |
</div>
|
484 |
<div class="input-field col s6">
|
485 |
<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;" >
|
488 |
|
489 |
<div class="row">
|
490 |
<div class="col s6">
|
491 |
+
<p><?php _e( 'Text Color on hover', 'click-to-chat-for-whatsapp' ); ?></p>
|
492 |
</div>
|
493 |
<div class="input-field col s6">
|
494 |
<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;" >
|
497 |
|
498 |
<div class="row">
|
499 |
<div class="col s6">
|
500 |
+
<p><?php _e( 'Background Color on hover', 'click-to-chat-for-whatsapp' ); ?></p>
|
501 |
</div>
|
502 |
<div class="input-field col s6">
|
503 |
<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;" >
|
506 |
|
507 |
<div class="row">
|
508 |
<div class="col s6">
|
509 |
+
<p><?php _e( 'Icon color on hover', 'click-to-chat-for-whatsapp' ); ?></p>
|
510 |
</div>
|
511 |
<div class="input-field col s6">
|
512 |
<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;" >
|
515 |
|
516 |
<div class="row">
|
517 |
<div class="col s6">
|
518 |
+
<p>Icon float</p>
|
519 |
</div>
|
520 |
<div class="input-field col s6">
|
521 |
<select name="ccw_options_cs[s8_icon_float]" class="select-2_2">
|
523 |
<option value="right" <?php echo $s8_icon_float == 'right' ? 'SELECTED' : ''; ?> >right</option>
|
524 |
<option value="hide" <?php echo $s8_icon_float == 'hide' ? 'SELECTED' : ''; ?> >hide</option>
|
525 |
</select>
|
526 |
+
<label>Icon flow</label>
|
527 |
</div>
|
528 |
</div>
|
529 |
|
530 |
<!-- hidden value - as in array empty values are not updating .. -->
|
531 |
<div class="row hide">
|
532 |
<div class="col s6">
|
533 |
+
<p><?php _e( 'Icon size', 'click-to-chat-for-whatsapp' ); ?></p>
|
534 |
</div>
|
535 |
<div class="input-field col s4">
|
536 |
<input name="ccw_options_cs[s8_1_width]" value="<?php echo esc_attr( $ccw_style_8['s8_1_width'] ) ?>" type="text" class="" >
|
557 |
|
558 |
<div class="row">
|
559 |
<div class="col s6">
|
560 |
+
<p><?php _e( 'Image size', 'click-to-chat-for-whatsapp' ); ?></p>
|
561 |
</div>
|
562 |
<div class="input-field col s4">
|
563 |
<input name="ccw_options_cs[s9_icon_size]" value="<?php echo esc_attr( $ccw_style_9['s9_icon_size'] ) ?>" type="text" class="" >
|
579 |
?>
|
580 |
<ul class="collapsible" data-collapsible="accordion">
|
581 |
<li>
|
582 |
+
<div class="collapsible-header"><?php _e( 'Style 99 - own Image / GIF', 'click-to-chat-for-whatsapp' ); ?></div>
|
583 |
<div class="collapsible-body">
|
584 |
|
585 |
|
586 |
<div class="row">
|
587 |
<div class="input-field col s12">
|
588 |
<input name="ccw_options_cs[s99_desktop_img]" value="<?php echo esc_attr( $ccw_style_99_own_img['s99_desktop_img'] ) ?>" id="img-url-desktop" type="text" class="validate">
|
589 |
+
<label for="img-url-desktop"><?php _e( 'Image URL - Desktop', 'click-to-chat-for-whatsapp' ); ?> </label>
|
590 |
+
<p class="description">e.g. https://example.com/img.png - <a target="_blank" href="https://holithemes.com/whatsapp-chat/style-99-own-image/">own image - style 99</a> </p>
|
591 |
<p class="description">Image / GIF </p>
|
592 |
</div>
|
593 |
</div>
|
595 |
<div class="row">
|
596 |
<div class="input-field col s12">
|
597 |
<input name="ccw_options_cs[s99_mobile_img]" value="<?php echo esc_attr( $ccw_style_99_own_img['s99_mobile_img'] ) ?>" id="img-url-mobile" type="text" class="validate">
|
598 |
+
<label for="img-url-mobile"><?php _e( 'Image URL - Mobile', 'click-to-chat-for-whatsapp' ); ?> </label>
|
599 |
+
<p class="description">e.g. https://example.com/img.png - <a target="_blank" href="https://holithemes.com/whatsapp-chat/style-99-own-image/">own image - style 99</a> </p>
|
600 |
</div>
|
601 |
</div>
|
602 |
|
603 |
<br><hr><br>
|
604 |
<p class="description">Instead of changing the Heigth, Width - Add Image with pefect size, and keep this field blank </p>
|
605 |
+
<p class="description">If not then add only height or width for better result ( Heigth preferred ) <a target="_blank" href="https://holithemes.com/whatsapp-chat/style-99-own-image/">own image - style 99</a> </p>
|
606 |
<br>
|
607 |
|
608 |
<div class="row">
|
609 |
<div class="col s6">
|
610 |
+
<p><?php _e( 'Desktop - Image Height', 'click-to-chat-for-whatsapp' ); ?></p>
|
611 |
</div>
|
612 |
<div class="input-field col s4">
|
613 |
<input name="ccw_options_cs[s99_img_height_desktop]" value="<?php echo esc_attr( $ccw_style_99_own_img['s99_img_height_desktop'] ) ?>" type="text" class="" >
|
616 |
|
617 |
<div class="row">
|
618 |
<div class="col s6">
|
619 |
+
<p><?php _e( 'Desktop - Image Width', 'click-to-chat-for-whatsapp' ); ?></p>
|
620 |
</div>
|
621 |
<div class="input-field col s4">
|
622 |
<input name="ccw_options_cs[s99_img_width_desktop]" value="<?php echo esc_attr( $ccw_style_99_own_img['s99_img_width_desktop'] ) ?>" type="text" class="" >
|
626 |
|
627 |
<div class="row">
|
628 |
<div class="col s6">
|
629 |
+
<p><?php _e( 'Mobile - Image Height', 'click-to-chat-for-whatsapp' ); ?></p>
|
630 |
</div>
|
631 |
<div class="input-field col s4">
|
632 |
<input name="ccw_options_cs[s99_img_height_mobile]" value="<?php echo esc_attr( $ccw_style_99_own_img['s99_img_height_mobile'] ) ?>" type="text" class="" >
|
635 |
|
636 |
<div class="row">
|
637 |
<div class="col s6">
|
638 |
+
<p><?php _e( 'Mobile - Image Width', 'click-to-chat-for-whatsapp' ); ?></p>
|
639 |
</div>
|
640 |
<div class="input-field col s4">
|
641 |
<input name="ccw_options_cs[s99_img_width_mobile]" value="<?php echo esc_attr( $ccw_style_99_own_img['s99_img_width_mobile'] ) ?>" type="text" class="" >
|
642 |
</div>
|
643 |
</div>
|
644 |
|
645 |
+
<p class="description">E.g. 100px </p>
|
646 |
|
647 |
|
648 |
|
673 |
<div class="collapsible-header">Animations - alpha release </div>
|
674 |
<div class="collapsible-body">
|
675 |
|
676 |
+
<p class="description"> alpha stage, things may change, may not work as like this in next releases, </br> may need to reconfigure also .. </p>
|
677 |
+
<p class="description"> Animations for floating styles - <a target="_blank" href="https://holithemes.com/whatsapp-chat/animations/">more info</a> </p>
|
678 |
<br><br>
|
679 |
|
680 |
|
681 |
<!-- animation on load -->
|
682 |
<div class="row">
|
683 |
<div class="col s6">
|
684 |
+
<p>Animation on Page load</p>
|
685 |
</div>
|
686 |
<div class="input-field col s6">
|
687 |
<select name="ccw_options_cs[an_on_load]" class="select-2_2">
|
696 |
|
697 |
?>
|
698 |
</select>
|
699 |
+
<label>animation on page load</label>
|
700 |
</div>
|
701 |
</div>
|
702 |
|
703 |
<!-- animation on hover -->
|
704 |
<div class="row">
|
705 |
<div class="col s6">
|
706 |
+
<p>Animation on hover</p>
|
707 |
</div>
|
708 |
<div class="input-field col s6">
|
709 |
<select name="ccw_options_cs[an_on_hover]" class="select-2_2">
|
710 |
<option value="ccw-an" <?php echo $an_on_hover == 'ccw-an' ? 'SELECTED' : ''; ?> >Yes</option>
|
711 |
<option value="ccw-no-hover-an" <?php echo $an_on_hover == 'ccw-no-hover-an' ? 'SELECTED' : ''; ?> >No</option>
|
712 |
</select>
|
713 |
+
<label>Animation on mouse hover</label>
|
714 |
</div>
|
715 |
+
<p class="description">If Yes, Animation on hover - works based on - Animation on page load - value</p>
|
716 |
</div>
|
717 |
|
718 |
|
741 |
<div id="ga-analytics" class="collapsible-header">Google Analytics </div>
|
742 |
<div class="collapsible-body">
|
743 |
|
744 |
+
<p class="description"> Enable Google Analytics at plugin home settings - <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat' ); ?>">Click to Chat</a> </p>
|
745 |
+
<p class="description"> Event Values - <a target="_blank" href="https://holithemes.com/whatsapp-chat/google-analytics/"><?php _e( 'more info' , 'click-to-chat-for-whatsapp' ) ?></a> </p>
|
746 |
<br><br>
|
747 |
|
748 |
<!-- Category Name -->
|
749 |
<div class="row">
|
750 |
<div class="col s6">
|
751 |
+
<p>Category Name</p>
|
752 |
</div>
|
753 |
<div class="input-field col s5">
|
754 |
<input name="ht_ccw_ga[ga_category]" value="<?php echo esc_attr( $ht_ccw_ga['ga_category'] ) ?>" type="text" class="" >
|
758 |
<!-- Action Name -->
|
759 |
<div class="row">
|
760 |
<div class="col s6">
|
761 |
+
<p>Action Name</p>
|
762 |
</div>
|
763 |
<div class="input-field col s5">
|
764 |
<input name="ht_ccw_ga[ga_action]" value="<?php echo esc_attr( $ht_ccw_ga['ga_action'] ) ?>" type="text" class="" >
|
768 |
<!-- Label Name -->
|
769 |
<div class="row">
|
770 |
<div class="col s6">
|
771 |
+
<p>Label Name</p>
|
772 |
</div>
|
773 |
<div class="input-field col s5">
|
774 |
<input name="ht_ccw_ga[ga_label]" value="<?php echo esc_attr( $ht_ccw_ga['ga_label'] ) ?>" type="text" class="" >
|
801 |
<div id="fb-analytics" class="collapsible-header">Facebook Analytics </div>
|
802 |
<div class="collapsible-body">
|
803 |
|
804 |
+
<p class="description"> Enable Facebook Analytics at plugin home settings - <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat' ); ?>"><?php _e( 'Click to Chat' , 'click-to-chat-for-whatsapp' ) ?></a> </p>
|
805 |
+
<p class="description"> Event Parameters - <a target="_blank" href="https://holithemes.com/whatsapp-chat/facebook-analytics/"><?php _e( 'more info' , 'click-to-chat-for-whatsapp' ) ?></a> </p>
|
806 |
<br><br>
|
807 |
|
808 |
<!-- Event Name -->
|
809 |
<div class="row">
|
810 |
<div class="col s6">
|
811 |
+
<p>Event Name</p>
|
812 |
</div>
|
813 |
<div class="input-field col s5">
|
814 |
<input name="ht_ccw_fb[fb_event_name]" value="<?php echo esc_attr( $ht_ccw_fb['fb_event_name'] ) ?>" type="text" class="" >
|
818 |
<!-- Parameter 1 -->
|
819 |
<div class="row">
|
820 |
<div class="col s6">
|
821 |
+
<p>Custom Parameter 1</p>
|
822 |
</div>
|
823 |
<div class="input-field col s5">
|
824 |
|
825 |
<div class="input-field col">
|
826 |
<input name="ht_ccw_fb[p1_name]" value="<?php echo esc_attr( $ht_ccw_fb['p1_name'] ) ?>" id="p1_name" type="text" class="" >
|
827 |
+
<label for="p1_name">Name: </label>
|
828 |
</div>
|
829 |
|
830 |
<div class="input-field col">
|
831 |
<input name="ht_ccw_fb[p1_value]" value="<?php echo esc_attr( $ht_ccw_fb['p1_value'] ) ?>" id="p1_value" type="text" class="" >
|
832 |
+
<label for="p1_value">Value: </label>
|
833 |
</div>
|
834 |
|
835 |
</div>
|
839 |
<!-- Parameter 2 -->
|
840 |
<div class="row">
|
841 |
<div class="col s6">
|
842 |
+
<p>Custom Parameter 2</p>
|
843 |
</div>
|
844 |
<div class="input-field col s5">
|
845 |
|
846 |
<div class="input-field col">
|
847 |
<input name="ht_ccw_fb[p2_name]" value="<?php echo esc_attr( $ht_ccw_fb['p2_name'] ) ?>" id="p2_name" type="text" class="" >
|
848 |
+
<label for="p2_name">Name: </label>
|
849 |
</div>
|
850 |
|
851 |
<div class="input-field col">
|
852 |
<input name="ht_ccw_fb[p2_value]" value="<?php echo esc_attr( $ht_ccw_fb['p2_value'] ) ?>" id="p2_value" type="text" class="" >
|
853 |
+
<label for="p2_value">Value: </label>
|
854 |
</div>
|
855 |
|
856 |
</div>
|
860 |
<!-- Parameter 3 -->
|
861 |
<div class="row">
|
862 |
<div class="col s6">
|
863 |
+
<p>Custom Parameter 3</p>
|
864 |
</div>
|
865 |
<div class="input-field col s5">
|
866 |
|
867 |
<div class="input-field col">
|
868 |
<input name="ht_ccw_fb[p3_name]" value="<?php echo esc_attr( $ht_ccw_fb['p3_name'] ) ?>" id="p3_name" type="text" class="" >
|
869 |
+
<label for="p3_name">Name: </label>
|
870 |
</div>
|
871 |
|
872 |
<div class="input-field col">
|
873 |
<input name="ht_ccw_fb[p3_value]" value="<?php echo esc_attr( $ht_ccw_fb['p3_value'] ) ?>" id="p3_value" type="text" class="" >
|
874 |
+
<label for="p3_value">Value: </label>
|
875 |
</div>
|
876 |
|
877 |
</div>
|
prev/admin/class-ccw-admin-page.php
CHANGED
@@ -38,7 +38,7 @@ class CCW_Admin_Page {
|
|
38 |
add_settings_field( 'ccw_fb_analytics', __( 'Facebook Analytics' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_fb_analytics_cb' ), 'ccw_options_settings', 'ccw_settings' );
|
39 |
|
40 |
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' );
|
41 |
-
add_settings_field( 'ccw_list_id_tohide', __(
|
42 |
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' );
|
43 |
add_settings_field( 'ccw_custom_shortcode', __( 'Shortcode name' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_custom_shortcode_cb' ), 'ccw_options_settings', 'ccw_settings' );
|
44 |
add_settings_field( 'ccw_app_first', __( 'App First / If Cache Issue' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_app_first_cb' ), 'ccw_options_settings', 'ccw_settings' );
|
@@ -111,7 +111,7 @@ class CCW_Admin_Page {
|
|
111 |
<div class="row">
|
112 |
<div class="input-field col s12">
|
113 |
<select name="ccw_options[enable]" class="select-1">
|
114 |
-
<option value="1"
|
115 |
<option value="2" <?php echo esc_attr( $ccw_enable['enable'] ) == 2 ? 'SELECTED' : ''; ?> >Yes</option>
|
116 |
</select>
|
117 |
<label>enable</label>
|
@@ -173,9 +173,9 @@ class CCW_Admin_Page {
|
|
173 |
<option value="8" <?php echo $style_value == 8 ? 'SELECTED' : ''; ?> >Style-8</option>
|
174 |
<option value="9" <?php echo $style_value == 9 ? 'SELECTED' : ''; ?> >Style-9</option>
|
175 |
<option value="99" <?php echo $style_value == 99 ? 'SELECTED' : ''; ?> >Style-99 ( Add your own Image / GIF )</option>
|
176 |
-
<option value="0" <?php echo $style_value == 0 ? 'SELECTED' : ''; ?>
|
177 |
</select>
|
178 |
-
<label
|
179 |
<p class="description"> - <a target="_blank" href="https://www.holithemes.com/whatsapp-chat/styles/">List of Styles</a> </p>
|
180 |
<p class="description">These styles are customizable - <a target="_blank" href="<?php echo admin_url( 'admin.php?page=ccw-edit-styles' ); ?>">Customize Styles</a> </p>
|
181 |
|
@@ -232,7 +232,7 @@ class CCW_Admin_Page {
|
|
232 |
<div class="row">
|
233 |
<div class="input-field col s12">
|
234 |
<input name="ccw_options[initial]" value="<?php echo esc_attr( $ccw_initial['initial'] ) ?>" id="whatsapp_initial" type="text" class="input-margin">
|
235 |
-
<label for="whatsapp_initial"
|
236 |
<p class="description">Initial message ( pre-filled ), placeholder {{url}} to add webpage url - <a target="_blank" href="https://www.holithemes.com/whatsapp-chat/pre-filled-message/">more info</a> </p>
|
237 |
</div>
|
238 |
</div>
|
@@ -262,13 +262,13 @@ class CCW_Admin_Page {
|
|
262 |
<div class="row">
|
263 |
<div class="input-field col s12">
|
264 |
<select name="ccw_options[position]" class="select">
|
265 |
-
<option value="1" <?php echo $ccw_position_value == 1 ? 'SELECTED' : ''; ?>
|
266 |
-
<option value="2" <?php echo $ccw_position_value == 2 ? 'SELECTED' : ''; ?>
|
267 |
-
<option value="3" <?php echo $ccw_position_value == 3 ? 'SELECTED' : ''; ?>
|
268 |
-
<option value="4" <?php echo $ccw_position_value == 4 ? 'SELECTED' : ''; ?>
|
269 |
</select>
|
270 |
-
<label
|
271 |
-
<p class="description"
|
272 |
</div>
|
273 |
</div>
|
274 |
|
@@ -364,7 +364,7 @@ class CCW_Admin_Page {
|
|
364 |
|
365 |
<p class="description"> If Google Analytics is installed - creates an Event at there - <a target="_blank" href="https://www.holithemes.com/whatsapp-chat/google-analytics/">more info</a> </p>
|
366 |
<p class="description"> Customize Event Values - <a target="_blank" href="<?php echo admin_url( 'admin.php?page=ccw-edit-styles#ga-analytics' ); ?>"><?php _e( 'Customize Styles' , 'click-to-chat-for-whatsapp' ) ?></a> </p>
|
367 |
-
<p class="description"> Using - <a target="_blank" href="https://www.holithemes.com/google-analytics-for-click-to-chat-for-whatsapp-plugin/"
|
368 |
<?php
|
369 |
}
|
370 |
|
@@ -571,7 +571,7 @@ class CCW_Admin_Page {
|
|
571 |
<div class="input-field col s12">
|
572 |
<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="input-margin">
|
573 |
<label for="ccw_list_id_tohide">Id's list to Hide - add ',' after each id </label>
|
574 |
-
<p class="description"> Add Post, Pages, Media - ID's to hide,
|
575 |
</div>
|
576 |
</div>
|
577 |
<?php
|
@@ -584,8 +584,8 @@ class CCW_Admin_Page {
|
|
584 |
<div class="row">
|
585 |
<div class="input-field col s12">
|
586 |
<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="input-margin">
|
587 |
-
<label for="ccw_list_cat_tohide">Category name
|
588 |
-
<p class="description">Category name
|
589 |
</div>
|
590 |
</div>
|
591 |
<?php
|
@@ -600,15 +600,15 @@ class CCW_Admin_Page {
|
|
600 |
<input name="ccw_options[shortcode]" value="<?php echo esc_attr( $ccw_shortcode['shortcode'] ) ?>" id="shortcode" type="text" class="input-margin">
|
601 |
<label for="shortcode">shortcode name</label>
|
602 |
<?php
|
603 |
-
$
|
604 |
// global used here is defined by wordpress
|
605 |
foreach ($GLOBALS['shortcode_tags'] AS $key => $value) {
|
606 |
-
$
|
607 |
}
|
608 |
?>
|
609 |
-
<p class="description"> Default values is
|
610 |
-
<!-- <p class="description"> please dont add this already existing
|
611 |
-
<p class="description"> please dont change to already existing
|
612 |
</div>
|
613 |
</div>
|
614 |
<?php
|
38 |
add_settings_field( 'ccw_fb_analytics', __( 'Facebook Analytics' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_fb_analytics_cb' ), 'ccw_options_settings', 'ccw_settings' );
|
39 |
|
40 |
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' );
|
41 |
+
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' );
|
42 |
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' );
|
43 |
add_settings_field( 'ccw_custom_shortcode', __( 'Shortcode name' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_custom_shortcode_cb' ), 'ccw_options_settings', 'ccw_settings' );
|
44 |
add_settings_field( 'ccw_app_first', __( 'App First / If Cache Issue' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_app_first_cb' ), 'ccw_options_settings', 'ccw_settings' );
|
111 |
<div class="row">
|
112 |
<div class="input-field col s12">
|
113 |
<select name="ccw_options[enable]" class="select-1">
|
114 |
+
<option value="1">No</option>
|
115 |
<option value="2" <?php echo esc_attr( $ccw_enable['enable'] ) == 2 ? 'SELECTED' : ''; ?> >Yes</option>
|
116 |
</select>
|
117 |
<label>enable</label>
|
173 |
<option value="8" <?php echo $style_value == 8 ? 'SELECTED' : ''; ?> >Style-8</option>
|
174 |
<option value="9" <?php echo $style_value == 9 ? 'SELECTED' : ''; ?> >Style-9</option>
|
175 |
<option value="99" <?php echo $style_value == 99 ? 'SELECTED' : ''; ?> >Style-99 ( Add your own Image / GIF )</option>
|
176 |
+
<option value="0" <?php echo $style_value == 0 ? 'SELECTED' : ''; ?> >Hide on Desktop Devices</option>
|
177 |
</select>
|
178 |
+
<label>Select Style for Desktop</label>
|
179 |
<p class="description"> - <a target="_blank" href="https://www.holithemes.com/whatsapp-chat/styles/">List of Styles</a> </p>
|
180 |
<p class="description">These styles are customizable - <a target="_blank" href="<?php echo admin_url( 'admin.php?page=ccw-edit-styles' ); ?>">Customize Styles</a> </p>
|
181 |
|
232 |
<div class="row">
|
233 |
<div class="input-field col s12">
|
234 |
<input name="ccw_options[initial]" value="<?php echo esc_attr( $ccw_initial['initial'] ) ?>" id="whatsapp_initial" type="text" class="input-margin">
|
235 |
+
<label for="whatsapp_initial">Initial Message</label>
|
236 |
<p class="description">Initial message ( pre-filled ), placeholder {{url}} to add webpage url - <a target="_blank" href="https://www.holithemes.com/whatsapp-chat/pre-filled-message/">more info</a> </p>
|
237 |
</div>
|
238 |
</div>
|
262 |
<div class="row">
|
263 |
<div class="input-field col s12">
|
264 |
<select name="ccw_options[position]" class="select">
|
265 |
+
<option value="1" <?php echo $ccw_position_value == 1 ? 'SELECTED' : ''; ?> >bottom right</option>
|
266 |
+
<option value="2" <?php echo $ccw_position_value == 2 ? 'SELECTED' : ''; ?> >bottom left</option>
|
267 |
+
<option value="3" <?php echo $ccw_position_value == 3 ? 'SELECTED' : ''; ?> >top left</option>
|
268 |
+
<option value="4" <?php echo $ccw_position_value == 4 ? 'SELECTED' : ''; ?> >top right</option>
|
269 |
</select>
|
270 |
+
<label>Fixed position to place</label>
|
271 |
+
<p class="description">e.g. 10px - please add css units as suffix, e.g. 10px, 10%, 10rem, 10em .. <a target="_blank" href="https://www.holithemes.com/whatsapp-chat/position-to-place/">more info</a> </p>
|
272 |
</div>
|
273 |
</div>
|
274 |
|
364 |
|
365 |
<p class="description"> If Google Analytics is installed - creates an Event at there - <a target="_blank" href="https://www.holithemes.com/whatsapp-chat/google-analytics/">more info</a> </p>
|
366 |
<p class="description"> Customize Event Values - <a target="_blank" href="<?php echo admin_url( 'admin.php?page=ccw-edit-styles#ga-analytics' ); ?>"><?php _e( 'Customize Styles' , 'click-to-chat-for-whatsapp' ) ?></a> </p>
|
367 |
+
<p class="description"> Using - <a target="_blank" href="https://www.holithemes.com/google-analytics-for-click-to-chat-for-whatsapp-plugin/">Google Tag Manager</a> </p>
|
368 |
<?php
|
369 |
}
|
370 |
|
571 |
<div class="input-field col s12">
|
572 |
<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="input-margin">
|
573 |
<label for="ccw_list_id_tohide">Id's list to Hide - add ',' after each id </label>
|
574 |
+
<p class="description"> Add Post, Pages, Media - ID's to hide, Add multiple id's separate with a comma ( , ) - <a target="_blank" href="https://www.holithemes.com/whatsapp-chat/show-hide-styles-based-on-id/">more info</a> </p>
|
575 |
</div>
|
576 |
</div>
|
577 |
<?php
|
584 |
<div class="row">
|
585 |
<div class="input-field col s12">
|
586 |
<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="input-margin">
|
587 |
+
<label for="ccw_list_cat_tohide">Category name's to Hide - add ',' after each category name </label>
|
588 |
+
<p class="description">Category name's to hide, Add multiple Categories separate with a comma ( , ) - <a target="_blank" href="https://www.holithemes.com/whatsapp-chat/hide-styles-based-on-category/">more info</a> </p>
|
589 |
</div>
|
590 |
</div>
|
591 |
<?php
|
600 |
<input name="ccw_options[shortcode]" value="<?php echo esc_attr( $ccw_shortcode['shortcode'] ) ?>" id="shortcode" type="text" class="input-margin">
|
601 |
<label for="shortcode">shortcode name</label>
|
602 |
<?php
|
603 |
+
$shortcode_list = '';
|
604 |
// global used here is defined by wordpress
|
605 |
foreach ($GLOBALS['shortcode_tags'] AS $key => $value) {
|
606 |
+
$shortcode_list .= $key . ', ';
|
607 |
}
|
608 |
?>
|
609 |
+
<p class="description"> Default values is 'chat', can customize shortcode name - <a target="_blank" href="https://www.holithemes.com/whatsapp-chat/change-shortcode-name/">more info</a> </p>
|
610 |
+
<!-- <p class="description"> please dont add this already existing shortcode names - <?php echo $shortcode_list ?> </p> -->
|
611 |
+
<p class="description"> please dont change to already existing shortcode name </p>
|
612 |
</div>
|
613 |
</div>
|
614 |
<?php
|
prev/admin/default-values.php
CHANGED
@@ -1,32 +1,19 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
4 |
-
*
|
5 |
-
*
|
6 |
-
*
|
7 |
-
*
|
8 |
-
*
|
9 |
-
|
10 |
-
* @package ccw
|
11 |
-
* @since 1.0
|
12 |
-
*/
|
13 |
|
14 |
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 |
-
* enable, enable_sc - 2 - enable, 1 - disable ..
|
25 |
-
* new +: 919494429789
|
26 |
-
* new: 919908469612
|
27 |
-
* prev: 918897606725
|
28 |
-
*
|
29 |
-
* group id: 9EHLsEsOeJk6AVtE8AvXiA
|
30 |
*/
|
31 |
$values = array(
|
32 |
'enable' => '2',
|
@@ -37,7 +24,6 @@ $values = array(
|
|
37 |
'position' => '1',
|
38 |
'style' => '9',
|
39 |
'stylemobile' => '3',
|
40 |
-
|
41 |
'position-1_bottom' => '10px',
|
42 |
'position-1_right' => '10px',
|
43 |
'position-2_bottom' => '10px',
|
@@ -53,10 +39,6 @@ $values = array(
|
|
53 |
'group_id' => '',
|
54 |
|
55 |
);
|
56 |
-
|
57 |
-
// update_option( 'ccw_options', $values );
|
58 |
-
// add_option( 'ccw_options', $values );
|
59 |
-
|
60 |
$db_values = get_option( 'ccw_options', array() );
|
61 |
$update_values = array_merge($values, $db_values);
|
62 |
|
@@ -67,13 +49,8 @@ if ( isset( $update_values['number'] ) ) {
|
|
67 |
$update_values['number'] = '';
|
68 |
}
|
69 |
}
|
70 |
-
|
71 |
update_option('ccw_options', $update_values);
|
72 |
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
/**
|
78 |
* table name - "ccw_options_cs"
|
79 |
*
|
@@ -92,21 +69,16 @@ $values_cs = array(
|
|
92 |
's1_submit_btn_text_and_icon_color' => '#ffffff',
|
93 |
's1_width' => 'auto',
|
94 |
's1_btn_text' => 'Submit',
|
95 |
-
|
96 |
's2_text_color' => 'initial',
|
97 |
's2_text_color_onhover' => 'initial',
|
98 |
's2_decoration' => 'initial',
|
99 |
's2_decoration_onhover' => 'initial',
|
100 |
-
|
101 |
's3_icon_size' => '34px',
|
102 |
-
|
103 |
's4_text_color' => 'rgba(0, 0, 0, 0.6)',
|
104 |
's4_background_color' => '#e4e4e4',
|
105 |
-
|
106 |
's5_color' => '#25D366',
|
107 |
's5_hover_color' => '#00e51e',
|
108 |
's5_icon_size' => '24px',
|
109 |
-
|
110 |
's6_color' => '#ffffff',
|
111 |
's6_hover_color' => '#000',
|
112 |
's6_icon_size' => '24px',
|
@@ -115,7 +87,6 @@ $values_cs = array(
|
|
115 |
's6_circle_height' => '48px',
|
116 |
's6_circle_width' => '48px',
|
117 |
's6_line_height' => '48px',
|
118 |
-
|
119 |
's7_color' => '#ffffff',
|
120 |
's7_hover_color' => '#000',
|
121 |
's7_icon_size' => '24px',
|
@@ -124,7 +95,6 @@ $values_cs = array(
|
|
124 |
's7_box_height' => '48px',
|
125 |
's7_box_width' => '48px',
|
126 |
's7_line_height' => '48px',
|
127 |
-
|
128 |
's8_text_color' => '#ffffff',
|
129 |
's8_background_color' => '#26a69a',
|
130 |
's8_icon_color' => '#ffffff',
|
@@ -133,9 +103,7 @@ $values_cs = array(
|
|
133 |
's8_icon_color_onhover' => '#ffffff',
|
134 |
's8_icon_float' => 'right',
|
135 |
's8_1_width' => '',
|
136 |
-
|
137 |
's9_icon_size' => '48px',
|
138 |
-
|
139 |
's99_img_height_desktop' => '99px',
|
140 |
's99_img_width_desktop' => '',
|
141 |
's99_img_height_mobile' => '50px',
|
@@ -153,34 +121,24 @@ $db_values_cs = get_option( 'ccw_options_cs', array() );
|
|
153 |
$update_values_cs = array_merge($values_cs, $db_values_cs);
|
154 |
update_option('ccw_options_cs', $update_values_cs);
|
155 |
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
/**
|
161 |
* Google Analytics
|
162 |
* option - ht_ccw_ga
|
163 |
*/
|
164 |
$ccw_ga = array(
|
165 |
-
|
166 |
'ga_category' => 'Click to Chat for WhatsApp',
|
167 |
'ga_action' => 'Click',
|
168 |
'ga_label' => '{{url}}',
|
169 |
-
|
170 |
);
|
171 |
-
|
172 |
$db_ccw_ga = get_option( 'ht_ccw_ga', array() );
|
173 |
$update_ccw_ga = array_merge($ccw_ga, $db_ccw_ga);
|
174 |
update_option('ht_ccw_ga', $update_ccw_ga);
|
175 |
|
176 |
-
|
177 |
-
|
178 |
/**
|
179 |
* fb Analytics
|
180 |
* option - ht_ccw_fb
|
181 |
*/
|
182 |
$ccw_fb = array(
|
183 |
-
|
184 |
'fb_event_name' => 'Click to Chat Event',
|
185 |
'p1_name' => 'Category',
|
186 |
'p2_name' => 'Action',
|
@@ -188,39 +146,23 @@ $ccw_fb = array(
|
|
188 |
'p1_value' => 'Click to Chat',
|
189 |
'p2_value' => 'Click',
|
190 |
'p3_value' => '{{url}}',
|
191 |
-
|
192 |
);
|
193 |
-
|
194 |
$db_ccw_fb = get_option( 'ht_ccw_fb', array() );
|
195 |
$update_ccw_fb = array_merge($ccw_fb, $db_ccw_fb);
|
196 |
update_option('ht_ccw_fb', $update_ccw_fb);
|
197 |
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
// plugin details
|
207 |
$plugin_details = array(
|
208 |
-
'version' =>
|
209 |
);
|
210 |
-
|
211 |
// Always use update_option - override new values .. don't preseve already existing values
|
212 |
update_option( 'ccw_plugin_details', $plugin_details );
|
213 |
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
/**
|
218 |
* for new interface.. in advance..
|
219 |
*/
|
220 |
-
|
221 |
function new_options() {
|
222 |
|
223 |
-
|
224 |
$new_options = get_option( 'ht_ctc_chat_options' );
|
225 |
|
226 |
if ( ! isset( $new_options['number'] ) ) {
|
@@ -253,21 +195,12 @@ new_options();
|
|
253 |
*
|
254 |
* interface - option - yes new interface, no previous interface
|
255 |
*
|
256 |
-
* This have to run in previous interface also as 1.8, 1.8., 1.8.2 beta versions released
|
257 |
-
* as switch option is a check option
|
258 |
-
*
|
259 |
*/
|
260 |
function ht_ctc_switch() {
|
261 |
|
262 |
// here in prev inteface set default as 'no'
|
263 |
$interface = 'no';
|
264 |
|
265 |
-
// in 1.8.1, 1.8.2 beta releases used switch option as a checklist
|
266 |
-
$ccw_options = get_option('ccw_options');
|
267 |
-
if ( isset ( $ccw_options['switch_to_new'] ) ) {
|
268 |
-
$interface = 'yes';
|
269 |
-
}
|
270 |
-
|
271 |
// plugin details
|
272 |
$values = array(
|
273 |
'interface' => $interface,
|
1 |
<?php
|
2 |
/**
|
3 |
+
* set default values
|
4 |
+
*
|
5 |
+
* ccw_plugin_details - this values will be overrides
|
6 |
+
*
|
7 |
+
* @package ccw
|
8 |
+
* @since 1.0
|
9 |
+
*/
|
|
|
|
|
|
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
12 |
|
13 |
|
14 |
/**
|
15 |
* table name: "ccw_options"
|
16 |
+
* enable, enable_sc - 2 - enable, 1 - disable
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
*/
|
18 |
$values = array(
|
19 |
'enable' => '2',
|
24 |
'position' => '1',
|
25 |
'style' => '9',
|
26 |
'stylemobile' => '3',
|
|
|
27 |
'position-1_bottom' => '10px',
|
28 |
'position-1_right' => '10px',
|
29 |
'position-2_bottom' => '10px',
|
39 |
'group_id' => '',
|
40 |
|
41 |
);
|
|
|
|
|
|
|
|
|
42 |
$db_values = get_option( 'ccw_options', array() );
|
43 |
$update_values = array_merge($values, $db_values);
|
44 |
|
49 |
$update_values['number'] = '';
|
50 |
}
|
51 |
}
|
|
|
52 |
update_option('ccw_options', $update_values);
|
53 |
|
|
|
|
|
|
|
|
|
54 |
/**
|
55 |
* table name - "ccw_options_cs"
|
56 |
*
|
69 |
's1_submit_btn_text_and_icon_color' => '#ffffff',
|
70 |
's1_width' => 'auto',
|
71 |
's1_btn_text' => 'Submit',
|
|
|
72 |
's2_text_color' => 'initial',
|
73 |
's2_text_color_onhover' => 'initial',
|
74 |
's2_decoration' => 'initial',
|
75 |
's2_decoration_onhover' => 'initial',
|
|
|
76 |
's3_icon_size' => '34px',
|
|
|
77 |
's4_text_color' => 'rgba(0, 0, 0, 0.6)',
|
78 |
's4_background_color' => '#e4e4e4',
|
|
|
79 |
's5_color' => '#25D366',
|
80 |
's5_hover_color' => '#00e51e',
|
81 |
's5_icon_size' => '24px',
|
|
|
82 |
's6_color' => '#ffffff',
|
83 |
's6_hover_color' => '#000',
|
84 |
's6_icon_size' => '24px',
|
87 |
's6_circle_height' => '48px',
|
88 |
's6_circle_width' => '48px',
|
89 |
's6_line_height' => '48px',
|
|
|
90 |
's7_color' => '#ffffff',
|
91 |
's7_hover_color' => '#000',
|
92 |
's7_icon_size' => '24px',
|
95 |
's7_box_height' => '48px',
|
96 |
's7_box_width' => '48px',
|
97 |
's7_line_height' => '48px',
|
|
|
98 |
's8_text_color' => '#ffffff',
|
99 |
's8_background_color' => '#26a69a',
|
100 |
's8_icon_color' => '#ffffff',
|
103 |
's8_icon_color_onhover' => '#ffffff',
|
104 |
's8_icon_float' => 'right',
|
105 |
's8_1_width' => '',
|
|
|
106 |
's9_icon_size' => '48px',
|
|
|
107 |
's99_img_height_desktop' => '99px',
|
108 |
's99_img_width_desktop' => '',
|
109 |
's99_img_height_mobile' => '50px',
|
121 |
$update_values_cs = array_merge($values_cs, $db_values_cs);
|
122 |
update_option('ccw_options_cs', $update_values_cs);
|
123 |
|
|
|
|
|
|
|
|
|
124 |
/**
|
125 |
* Google Analytics
|
126 |
* option - ht_ccw_ga
|
127 |
*/
|
128 |
$ccw_ga = array(
|
|
|
129 |
'ga_category' => 'Click to Chat for WhatsApp',
|
130 |
'ga_action' => 'Click',
|
131 |
'ga_label' => '{{url}}',
|
|
|
132 |
);
|
|
|
133 |
$db_ccw_ga = get_option( 'ht_ccw_ga', array() );
|
134 |
$update_ccw_ga = array_merge($ccw_ga, $db_ccw_ga);
|
135 |
update_option('ht_ccw_ga', $update_ccw_ga);
|
136 |
|
|
|
|
|
137 |
/**
|
138 |
* fb Analytics
|
139 |
* option - ht_ccw_fb
|
140 |
*/
|
141 |
$ccw_fb = array(
|
|
|
142 |
'fb_event_name' => 'Click to Chat Event',
|
143 |
'p1_name' => 'Category',
|
144 |
'p2_name' => 'Action',
|
146 |
'p1_value' => 'Click to Chat',
|
147 |
'p2_value' => 'Click',
|
148 |
'p3_value' => '{{url}}',
|
|
|
149 |
);
|
|
|
150 |
$db_ccw_fb = get_option( 'ht_ccw_fb', array() );
|
151 |
$update_ccw_fb = array_merge($ccw_fb, $db_ccw_fb);
|
152 |
update_option('ht_ccw_fb', $update_ccw_fb);
|
153 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
// plugin details
|
155 |
$plugin_details = array(
|
156 |
+
'version' => HT_CTC_VERSION,
|
157 |
);
|
|
|
158 |
// Always use update_option - override new values .. don't preseve already existing values
|
159 |
update_option( 'ccw_plugin_details', $plugin_details );
|
160 |
|
|
|
|
|
|
|
161 |
/**
|
162 |
* for new interface.. in advance..
|
163 |
*/
|
|
|
164 |
function new_options() {
|
165 |
|
|
|
166 |
$new_options = get_option( 'ht_ctc_chat_options' );
|
167 |
|
168 |
if ( ! isset( $new_options['number'] ) ) {
|
195 |
*
|
196 |
* interface - option - yes new interface, no previous interface
|
197 |
*
|
|
|
|
|
|
|
198 |
*/
|
199 |
function ht_ctc_switch() {
|
200 |
|
201 |
// here in prev inteface set default as 'no'
|
202 |
$interface = 'no';
|
203 |
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
// plugin details
|
205 |
$values = array(
|
206 |
'interface' => $interface,
|
prev/admin/settings_page.php
CHANGED
@@ -28,9 +28,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
|
28 |
|
29 |
<div class="col s12 m12 xl6 admin_sidebar">
|
30 |
<div class="wca_card" style="display: none;">
|
31 |
-
|
32 |
-
// include_once 'commons/admin-sidebar.php';
|
33 |
-
?>
|
34 |
</div>
|
35 |
</div>
|
36 |
|
@@ -40,55 +38,35 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
|
40 |
|
41 |
|
42 |
<div class="row">
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
<div class="row">
|
47 |
-
|
48 |
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
57 |
</div>
|
58 |
-
<div class="card-action">
|
59 |
-
<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>
|
60 |
-
</div>
|
61 |
-
</div>
|
62 |
-
</div>
|
63 |
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
<
|
69 |
-
<
|
70 |
-
<
|
71 |
-
<br>
|
72 |
-
<p><?php // _e( 'WooCommerce' , 'click-to-chat-for-whatsapp' ) ?></p>
|
73 |
</div>
|
74 |
-
|
75 |
-
<a target="_blank" href="https://www.holithemes.com/plugins/click/"><?php _e( '' , 'click-to-chat-for-whatsapp' ) ?>HoliThemes Click</a>
|
76 |
-
</div>
|
77 |
-
</div>
|
78 |
-
</div> -->
|
79 |
-
|
80 |
-
<div class="collection with-header">
|
81 |
-
<div class="collection-header"><bold>HoliThemes On</bold></div>
|
82 |
-
<a target="_blank" href="https://www.facebook.com/holithemes/" class="collection-item">Facebook</a>
|
83 |
-
<a target="_blank" href="https://twitter.com/holithemes" class="collection-item">Twitter</a>
|
84 |
-
<a target="_blank" href="https://www.instagram.com/holithemes/" class="collection-item">Instagram</a>
|
85 |
-
<a target="_blank" href="https://www.youtube.com/channel/UC2Tf_WB9PWffO2B3tswWCGw" class="collection-item">YouTube</a>
|
86 |
-
<a target="_blank" href="https://www.linkedin.com/company/holithemes" class="collection-item">LinkedIn</a>
|
87 |
</div>
|
88 |
-
|
89 |
-
|
90 |
-
</div>
|
91 |
-
|
92 |
</div>
|
93 |
|
94 |
</div>
|
28 |
|
29 |
<div class="col s12 m12 xl6 admin_sidebar">
|
30 |
<div class="wca_card" style="display: none;">
|
31 |
+
<!-- sidebar content -->
|
|
|
|
|
32 |
</div>
|
33 |
</div>
|
34 |
|
38 |
|
39 |
|
40 |
<div class="row">
|
41 |
+
<div class="col s12 m12 l12 xl9">
|
42 |
+
<div class="row">
|
|
|
|
|
|
|
43 |
|
44 |
+
<div class="col s12 m6">
|
45 |
+
<div class="card blue-grey darken-1">
|
46 |
+
<div class="card-content white-text">
|
47 |
+
<span class="card-title">Plugin Review</span>
|
48 |
+
<br>
|
49 |
+
<p>If you like the plugin, please Support the Developers</p>
|
50 |
+
<br>
|
51 |
+
<p>By giving 5 Star rating</p>
|
52 |
+
</div>
|
53 |
+
<div class="card-action">
|
54 |
+
<a target="_blank" href="https://wordpress.org/support/plugin/click-to-chat-for-whatsapp/reviews/#new-post">Plugin Review</a>
|
55 |
+
</div>
|
56 |
+
</div>
|
57 |
</div>
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
+
<div class="collection with-header">
|
60 |
+
<div class="collection-header"><bold><?php _e( 'HoliThemes On', 'click-to-chat-for-whatsapp' ); ?></bold></div>
|
61 |
+
<a target="_blank" href="https://www.facebook.com/holithemes/" class="collection-item"><?php _e( 'Facebook', 'click-to-chat-for-whatsapp' ); ?></a>
|
62 |
+
<a target="_blank" href="https://twitter.com/holithemes" class="collection-item"><?php _e( 'Twitter', 'click-to-chat-for-whatsapp' ); ?></a>
|
63 |
+
<a target="_blank" href="https://www.instagram.com/holithemes/" class="collection-item"><?php _e( 'Instagram', 'click-to-chat-for-whatsapp' ); ?></a>
|
64 |
+
<a target="_blank" href="https://www.youtube.com/channel/UC2Tf_WB9PWffO2B3tswWCGw" class="collection-item"><?php _e( 'YouTube', 'click-to-chat-for-whatsapp' ); ?></a>
|
65 |
+
<a target="_blank" href="https://www.linkedin.com/company/holithemes" class="collection-item"><?php _e( 'LinkedIn', 'click-to-chat-for-whatsapp' ); ?></a>
|
|
|
|
|
66 |
</div>
|
67 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
</div>
|
69 |
+
</div>
|
|
|
|
|
|
|
70 |
</div>
|
71 |
|
72 |
</div>
|
prev/assets/js/admin_app.js
CHANGED
@@ -1,34 +1,24 @@
|
|
1 |
-
|
2 |
-
* Admin JavaScript
|
3 |
-
*/
|
4 |
-
|
5 |
jQuery(document).ready(function($) {
|
6 |
// wpColorPicker
|
7 |
$('.color-wp').wpColorPicker();
|
8 |
});
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
// initialize materialize function ..
|
14 |
document.addEventListener('DOMContentLoaded', function() {
|
15 |
-
|
16 |
// select
|
17 |
var elems = document.querySelectorAll('select');
|
18 |
-
|
19 |
|
20 |
// Collapsible
|
21 |
var elems = document.querySelectorAll('.collapsible');
|
22 |
-
|
23 |
|
24 |
});
|
25 |
|
26 |
|
27 |
jQuery(document).ready(function () {
|
28 |
|
29 |
-
// jQuery('.color-wp').wpColorPicker();
|
30 |
-
|
31 |
-
|
32 |
let position = document.querySelectorAll('.position');
|
33 |
|
34 |
let default_display = () => {
|
@@ -88,28 +78,9 @@ jQuery(document).ready(function () {
|
|
88 |
|
89 |
});
|
90 |
|
91 |
-
|
92 |
-
// can impove this code -
|
93 |
-
// https://stackoverflow.com/a/32631357/2591092
|
94 |
-
// https://stackoverflow.com/questions/11208021/jquery-add-css-class-depending-on-selectbox-option
|
95 |
-
|
96 |
});
|
97 |
|
98 |
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
// makes an ajax call
|
114 |
// if ccw_admin_sidebar_card option is not set or not equal to hide
|
115 |
// then show the card - set display: block
|
1 |
+
// Click to Chat - prev
|
|
|
|
|
|
|
2 |
jQuery(document).ready(function($) {
|
3 |
// wpColorPicker
|
4 |
$('.color-wp').wpColorPicker();
|
5 |
});
|
6 |
|
|
|
|
|
|
|
7 |
// initialize materialize function ..
|
8 |
document.addEventListener('DOMContentLoaded', function() {
|
|
|
9 |
// select
|
10 |
var elems = document.querySelectorAll('select');
|
11 |
+
M.FormSelect.init(elems, {});
|
12 |
|
13 |
// Collapsible
|
14 |
var elems = document.querySelectorAll('.collapsible');
|
15 |
+
M.Collapsible.init(elems, {});
|
16 |
|
17 |
});
|
18 |
|
19 |
|
20 |
jQuery(document).ready(function () {
|
21 |
|
|
|
|
|
|
|
22 |
let position = document.querySelectorAll('.position');
|
23 |
|
24 |
let default_display = () => {
|
78 |
|
79 |
});
|
80 |
|
|
|
|
|
|
|
|
|
|
|
81 |
});
|
82 |
|
83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
// makes an ajax call
|
85 |
// if ccw_admin_sidebar_card option is not set or not equal to hide
|
86 |
// then show the card - set display: block
|
prev/assets/js/app.js
CHANGED
@@ -25,10 +25,7 @@ var fb_analytics = ht_ccw_var.fb_analytics;
|
|
25 |
|
26 |
var title = ht_ccw_var.page_title;
|
27 |
|
28 |
-
|
29 |
-
/**
|
30 |
-
* Analytics
|
31 |
-
*/
|
32 |
ht_ccw_clickevent();
|
33 |
|
34 |
function ht_ccw_clickevent() {
|
25 |
|
26 |
var title = ht_ccw_var.page_title;
|
27 |
|
28 |
+
// Analytics
|
|
|
|
|
|
|
29 |
ht_ccw_clickevent();
|
30 |
|
31 |
function ht_ccw_clickevent() {
|
prev/inc/class-ccw-add-styles-scripts.php
CHANGED
@@ -24,15 +24,15 @@ class CCW_Add_Styles_Scripts {
|
|
24 |
*/
|
25 |
function ccw_register_files() {
|
26 |
|
27 |
-
wp_register_style('ccw_main_css', plugins_url( 'prev/assets/css/mainstyles.css',
|
28 |
wp_enqueue_style('ccw_main_css');
|
29 |
|
30 |
|
31 |
-
wp_register_style('ccw_mdstyle8_css', plugins_url( 'new/inc/assets/css/mdstyle8.css',
|
32 |
// needs - s8
|
33 |
// wp_enqueue_style('ccw_mdstyle8_css');
|
34 |
|
35 |
-
wp_enqueue_script( 'ccw_app', plugins_url( 'prev/assets/js/app.js',
|
36 |
|
37 |
// As now - for floating style - enqueue md style added like this
|
38 |
// but for shortcodes enqueue while calling that template file
|
24 |
*/
|
25 |
function ccw_register_files() {
|
26 |
|
27 |
+
wp_register_style('ccw_main_css', plugins_url( 'prev/assets/css/mainstyles.css', HT_CTC_PLUGIN_FILE ), '', HT_CTC_VERSION );
|
28 |
wp_enqueue_style('ccw_main_css');
|
29 |
|
30 |
|
31 |
+
wp_register_style('ccw_mdstyle8_css', plugins_url( 'new/inc/assets/css/mdstyle8.css', HT_CTC_PLUGIN_FILE ), '', HT_CTC_VERSION );
|
32 |
// needs - s8
|
33 |
// wp_enqueue_style('ccw_mdstyle8_css');
|
34 |
|
35 |
+
wp_enqueue_script( 'ccw_app', plugins_url( 'prev/assets/js/app.js', HT_CTC_PLUGIN_FILE ), array ( 'jquery' ), HT_CTC_VERSION, true );
|
36 |
|
37 |
// As now - for floating style - enqueue md style added like this
|
38 |
// but for shortcodes enqueue while calling that template file
|
prev/inc/class-ccw-shortcode.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* shortcodes
|
4 |
-
* base
|
5 |
* for list of attribute support check -> shortcode_atts ( $a )
|
6 |
*
|
7 |
* @package ccw
|
@@ -17,7 +17,7 @@ class CCW_Shortcode {
|
|
17 |
|
18 |
// Register shortcode
|
19 |
public function ccw_shortcodes_init() {
|
20 |
-
$shortcode_name = ht_ccw()->variables->get_option['shortcode'];
|
21 |
// add_shortcode('chat', 'shortcode');
|
22 |
add_shortcode( $shortcode_name, array( $this, 'shortcode' ) );
|
23 |
}
|
@@ -42,7 +42,7 @@ class CCW_Shortcode {
|
|
42 |
* there is an advantage if return here -
|
43 |
* instead of doing this before loading this file.
|
44 |
*
|
45 |
-
* now the
|
46 |
* If return here -
|
47 |
* there is no content for that
|
48 |
* so shortcode added in post will be hide / null.
|
@@ -174,12 +174,9 @@ class CCW_Shortcode {
|
|
174 |
}
|
175 |
|
176 |
if ( 'group_chat' == $is_group ) {
|
177 |
-
// $redirect_page = plugins_url( "prev/inc/whatsapp-url-group.php?id=$group_id", HT_CCW_PLUGIN_FILE );
|
178 |
$img_click_link = "window.open('https://chat.whatsapp.com/$group_id', '_blank')";
|
179 |
$redirect_a = "https://chat.whatsapp.com/$group_id";
|
180 |
} else {
|
181 |
-
// $base_url = plugins_url( "prev/inc/whatsapp-url.php", HT_CCW_PLUGIN_FILE );
|
182 |
-
// $redirect_page = $base_url . "?num=$num&text=$initial_text&m=$is_mobile";
|
183 |
$img_click_link = "window.open('https://api.whatsapp.com/send?phone=$num&text=$initial_text', '_blank')";
|
184 |
$redirect_a = "https://api.whatsapp.com/send?phone=$num&text=$initial_text";
|
185 |
}
|
@@ -193,12 +190,9 @@ class CCW_Shortcode {
|
|
193 |
|
194 |
// App First - so mobile based url
|
195 |
if ( 'group_chat' == $is_group ) {
|
196 |
-
// $redirect_page = plugins_url( "prev/inc/whatsapp-url-group.php?id=$group_id", HT_CCW_PLUGIN_FILE );
|
197 |
$img_click_link = "window.open('https://chat.whatsapp.com/$group_id', '_blank')";
|
198 |
$redirect_a = "https://chat.whatsapp.com/$group_id";
|
199 |
} else {
|
200 |
-
// $base_url = plugins_url( "prev/inc/whatsapp-url.php", HT_CCW_PLUGIN_FILE );
|
201 |
-
// $redirect_page = $base_url . "?num=$num&text=$initial_text&m=1";
|
202 |
$img_click_link = "window.open('https://api.whatsapp.com/send?phone=$num&text=$initial_text', '_blank')";
|
203 |
$redirect_a = "https://api.whatsapp.com/send?phone=$num&text=$initial_text";
|
204 |
}
|
@@ -207,12 +201,9 @@ class CCW_Shortcode {
|
|
207 |
|
208 |
// General - Desktop url
|
209 |
if ( 'group_chat' == $is_group ) {
|
210 |
-
// $redirect_page = plugins_url( "prev/inc/whatsapp-url-group.php?id=$group_id", HT_CCW_PLUGIN_FILE );
|
211 |
$img_click_link = "window.open('https://chat.whatsapp.com/$group_id', '_blank')";
|
212 |
$redirect_a = "https://chat.whatsapp.com/$group_id";
|
213 |
} else {
|
214 |
-
// $base_url = plugins_url( "prev/inc/whatsapp-url.php", HT_CCW_PLUGIN_FILE );
|
215 |
-
// $redirect_page = $base_url . "?num=$num&text=$initial_text&m=0";
|
216 |
$img_click_link = "window.open('https://web.whatsapp.com/send?phone=$num&text=$initial_text', '_blank')";
|
217 |
$redirect_a = "https://web.whatsapp.com/send?phone=$num&text=$initial_text";
|
218 |
}
|
@@ -222,9 +213,6 @@ class CCW_Shortcode {
|
|
222 |
}
|
223 |
|
224 |
|
225 |
-
// $redirect_page = plugins_url( "/prev/inc/whatsapp-url.php?num=$num", HT_CCW_PLUGIN_FILE );
|
226 |
-
// $img_click_link = "window.open('https://web.whatsapp.com/send?phone=$num&text=', '_blank')";
|
227 |
-
|
228 |
$position = $a["position"];
|
229 |
$top = $a["top"];
|
230 |
$right = $a["right"];
|
@@ -235,7 +223,7 @@ class CCW_Shortcode {
|
|
235 |
|
236 |
|
237 |
// style - 9 - green square
|
238 |
-
$img_link_s9 = plugins_url("./new/inc/assets/img/whatsapp-icon-square.svg",
|
239 |
|
240 |
|
241 |
$css = '';
|
@@ -262,7 +250,7 @@ class CCW_Shortcode {
|
|
262 |
$css .= 'display:none;';
|
263 |
}
|
264 |
|
265 |
-
// By default
|
266 |
// if plan to show, then add hide='show' ( actually something not equal to 'hide' )
|
267 |
if ( 'fixed' == $position && 'show' !== $home && ( is_home() || is_category() || is_archive() ) ) {
|
268 |
$css .= 'display:none;';
|
@@ -286,12 +274,12 @@ class CCW_Shortcode {
|
|
286 |
$o = '';
|
287 |
|
288 |
// shortcode template file path
|
289 |
-
$sc_path = plugin_dir_path(
|
290 |
|
291 |
if ( is_file( $sc_path ) ) {
|
292 |
include $sc_path;
|
293 |
} else {
|
294 |
-
$img_link = plugins_url("./new/inc/assets/img/whatsapp-logo.svg",
|
295 |
$o .= '<div class="ccw_plugin">';
|
296 |
$o .= '<img class="img-icon-sc sc_item pointer style-3-sc" src="'.$img_link.'" alt="WhatsApp chat" onclick="'.$img_click_link.'" style="height: 50px; '.$css.' " >';
|
297 |
$o .= '</div>';
|
1 |
<?php
|
2 |
/**
|
3 |
* shortcodes
|
4 |
+
* base shortcode name is [chat]
|
5 |
* for list of attribute support check -> shortcode_atts ( $a )
|
6 |
*
|
7 |
* @package ccw
|
17 |
|
18 |
// Register shortcode
|
19 |
public function ccw_shortcodes_init() {
|
20 |
+
$shortcode_name = esc_attr( ht_ccw()->variables->get_option['shortcode'] );
|
21 |
// add_shortcode('chat', 'shortcode');
|
22 |
add_shortcode( $shortcode_name, array( $this, 'shortcode' ) );
|
23 |
}
|
42 |
* there is an advantage if return here -
|
43 |
* instead of doing this before loading this file.
|
44 |
*
|
45 |
+
* now the shortcode exists - what ever
|
46 |
* If return here -
|
47 |
* there is no content for that
|
48 |
* so shortcode added in post will be hide / null.
|
174 |
}
|
175 |
|
176 |
if ( 'group_chat' == $is_group ) {
|
|
|
177 |
$img_click_link = "window.open('https://chat.whatsapp.com/$group_id', '_blank')";
|
178 |
$redirect_a = "https://chat.whatsapp.com/$group_id";
|
179 |
} else {
|
|
|
|
|
180 |
$img_click_link = "window.open('https://api.whatsapp.com/send?phone=$num&text=$initial_text', '_blank')";
|
181 |
$redirect_a = "https://api.whatsapp.com/send?phone=$num&text=$initial_text";
|
182 |
}
|
190 |
|
191 |
// App First - so mobile based url
|
192 |
if ( 'group_chat' == $is_group ) {
|
|
|
193 |
$img_click_link = "window.open('https://chat.whatsapp.com/$group_id', '_blank')";
|
194 |
$redirect_a = "https://chat.whatsapp.com/$group_id";
|
195 |
} else {
|
|
|
|
|
196 |
$img_click_link = "window.open('https://api.whatsapp.com/send?phone=$num&text=$initial_text', '_blank')";
|
197 |
$redirect_a = "https://api.whatsapp.com/send?phone=$num&text=$initial_text";
|
198 |
}
|
201 |
|
202 |
// General - Desktop url
|
203 |
if ( 'group_chat' == $is_group ) {
|
|
|
204 |
$img_click_link = "window.open('https://chat.whatsapp.com/$group_id', '_blank')";
|
205 |
$redirect_a = "https://chat.whatsapp.com/$group_id";
|
206 |
} else {
|
|
|
|
|
207 |
$img_click_link = "window.open('https://web.whatsapp.com/send?phone=$num&text=$initial_text', '_blank')";
|
208 |
$redirect_a = "https://web.whatsapp.com/send?phone=$num&text=$initial_text";
|
209 |
}
|
213 |
}
|
214 |
|
215 |
|
|
|
|
|
|
|
216 |
$position = $a["position"];
|
217 |
$top = $a["top"];
|
218 |
$right = $a["right"];
|
223 |
|
224 |
|
225 |
// style - 9 - green square
|
226 |
+
$img_link_s9 = plugins_url("./new/inc/assets/img/whatsapp-icon-square.svg", HT_CTC_PLUGIN_FILE );
|
227 |
|
228 |
|
229 |
$css = '';
|
250 |
$css .= 'display:none;';
|
251 |
}
|
252 |
|
253 |
+
// By default position: fixed style hide on home screen,
|
254 |
// if plan to show, then add hide='show' ( actually something not equal to 'hide' )
|
255 |
if ( 'fixed' == $position && 'show' !== $home && ( is_home() || is_category() || is_archive() ) ) {
|
256 |
$css .= 'display:none;';
|
274 |
$o = '';
|
275 |
|
276 |
// shortcode template file path
|
277 |
+
$sc_path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'prev/inc/commons/styles-list-sc/sc-style-' . $style. '.php';
|
278 |
|
279 |
if ( is_file( $sc_path ) ) {
|
280 |
include $sc_path;
|
281 |
} else {
|
282 |
+
$img_link = plugins_url("./new/inc/assets/img/whatsapp-logo.svg", HT_CTC_PLUGIN_FILE );
|
283 |
$o .= '<div class="ccw_plugin">';
|
284 |
$o .= '<img class="img-icon-sc sc_item pointer style-3-sc" src="'.$img_link.'" alt="WhatsApp chat" onclick="'.$img_click_link.'" style="height: 50px; '.$css.' " >';
|
285 |
$o .= '</div>';
|
prev/inc/class-ht-ccw-chat.php
CHANGED
@@ -214,8 +214,6 @@ class HT_CCW_Chat {
|
|
214 |
}
|
215 |
|
216 |
|
217 |
-
// require_once HT_CCW_PLUGIN_DIR .'inc/commons/positions.php';
|
218 |
-
|
219 |
if( 1 == $position ) {
|
220 |
$p1 = 'bottom:'.esc_attr( $values['position-1_bottom'] );
|
221 |
$p2 = 'right:'.esc_attr( $values['position-1_right'] );
|
@@ -232,7 +230,7 @@ class HT_CCW_Chat {
|
|
232 |
|
233 |
|
234 |
|
235 |
-
include_once
|
236 |
|
237 |
}
|
238 |
|
214 |
}
|
215 |
|
216 |
|
|
|
|
|
217 |
if( 1 == $position ) {
|
218 |
$p1 = 'bottom:'.esc_attr( $values['position-1_bottom'] );
|
219 |
$p2 = 'right:'.esc_attr( $values['position-1_right'] );
|
230 |
|
231 |
|
232 |
|
233 |
+
include_once HT_CTC_PLUGIN_DIR .'prev/inc/commons/styles.php';
|
234 |
|
235 |
}
|
236 |
|
prev/inc/class-ht-ccw-register.php
CHANGED
@@ -25,7 +25,7 @@ class HT_CCW_Register {
|
|
25 |
}
|
26 |
|
27 |
// add default values to options db
|
28 |
-
include_once(
|
29 |
}
|
30 |
|
31 |
// when plugin deactivate
|
@@ -41,7 +41,7 @@ class HT_CCW_Register {
|
|
41 |
|
42 |
$ccw_plugin_details = get_option('ccw_plugin_details');
|
43 |
|
44 |
-
if (
|
45 |
// to update the plugin - just like activate plugin
|
46 |
self::activate();
|
47 |
|
25 |
}
|
26 |
|
27 |
// add default values to options db
|
28 |
+
include_once( HT_CTC_PLUGIN_DIR . '/prev/admin/default-values.php' );
|
29 |
}
|
30 |
|
31 |
// when plugin deactivate
|
41 |
|
42 |
$ccw_plugin_details = get_option('ccw_plugin_details');
|
43 |
|
44 |
+
if ( HT_CTC_VERSION !== $ccw_plugin_details['version'] ) {
|
45 |
// to update the plugin - just like activate plugin
|
46 |
self::activate();
|
47 |
|
prev/inc/class-ht-ccw.php
CHANGED
@@ -19,30 +19,12 @@ if ( ! class_exists( 'HT_CCW' ) ) :
|
|
19 |
|
20 |
class HT_CCW {
|
21 |
|
22 |
-
/**
|
23 |
-
* plugin version
|
24 |
-
*
|
25 |
-
* it's private to this class,
|
26 |
-
* out side of this class use defined constant
|
27 |
-
* HT_CCW_VERSION
|
28 |
-
*
|
29 |
-
* @uses to define constant - HT_CCW_VERSION
|
30 |
-
*
|
31 |
-
* @var float
|
32 |
-
*
|
33 |
-
* if this changed dont forgot to change in plugin header content
|
34 |
-
* click-to-chat.php - Version
|
35 |
-
*/
|
36 |
-
// private $version = '1.7';
|
37 |
-
|
38 |
-
|
39 |
/**
|
40 |
* singleton instance
|
41 |
*
|
42 |
* @var HT_CCW
|
43 |
*/
|
44 |
private static $instance = null;
|
45 |
-
|
46 |
|
47 |
/**
|
48 |
* wp_is_mobile - if true then 1, else 2
|
@@ -51,7 +33,6 @@ class HT_CCW {
|
|
51 |
*/
|
52 |
public $device_type;
|
53 |
|
54 |
-
|
55 |
/**
|
56 |
* instance of HT_CCW_Variables
|
57 |
*
|
@@ -61,7 +42,6 @@ class HT_CCW {
|
|
61 |
*/
|
62 |
public $variables = null;
|
63 |
|
64 |
-
|
65 |
/**
|
66 |
* main instance - HT_CCW
|
67 |
*
|
@@ -75,7 +55,6 @@ class HT_CCW {
|
|
75 |
return self::$instance;
|
76 |
}
|
77 |
|
78 |
-
|
79 |
public function __clone() {
|
80 |
wc_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'click-to-chat-for-whatsapp' ), '1.0' );
|
81 |
}
|
@@ -84,102 +63,53 @@ class HT_CCW {
|
|
84 |
wc_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'click-to-chat-for-whatsapp' ), '1.0' );
|
85 |
}
|
86 |
|
87 |
-
|
88 |
-
|
89 |
/**
|
90 |
* constructor
|
91 |
-
*
|
92 |
-
*
|
93 |
*/
|
94 |
public function __construct() {
|
95 |
-
$this->define_constants();
|
96 |
-
|
97 |
$this->basic();
|
98 |
-
|
99 |
$this->includes();
|
100 |
$this->hooks();
|
101 |
}
|
102 |
-
|
103 |
|
104 |
|
105 |
|
106 |
-
/**
|
107 |
-
* Define Constants
|
108 |
-
*
|
109 |
-
* @return void
|
110 |
-
*/
|
111 |
-
private function define_constants() {
|
112 |
-
|
113 |
-
// $this->define( 'HT_CCW_VERSION', $this->version );
|
114 |
-
|
115 |
-
$this->define( 'HT_CCW_WP_MIN_VERSION', '4.6' );
|
116 |
-
$this->define( 'HT_CCW_PLUGIN_DIR', plugin_dir_path( HT_CCW_PLUGIN_FILE ) );
|
117 |
-
$this->define( 'HT_CCW_PLUGIN_BASENAME', plugin_basename( HT_CCW_PLUGIN_FILE ) );
|
118 |
-
|
119 |
-
$this->define( 'HT_CCW_OPTIONS_PAGE_SLUG', 'click-to-chat' );
|
120 |
-
$this->define( 'HT_CCW_OPTIONS_PAGE_SLUG_CUSTOM_STYLES', 'ccw-edit-styles' );
|
121 |
-
}
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
/**
|
127 |
* add the basic things
|
128 |
-
*
|
129 |
* calling this before include, initilize other things
|
130 |
-
*
|
131 |
* because this things may useful before initilize other things
|
132 |
-
*
|
133 |
* e.g. include, initialize files based on device, user settings
|
134 |
*/
|
135 |
private function basic() {
|
136 |
|
137 |
-
include_once
|
138 |
-
include_once
|
139 |
|
140 |
$this->device_type = new HT_CCW_IsMobile();
|
141 |
$this->variables = new HT_CCW_Variables();
|
142 |
-
|
143 |
-
}
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
/**
|
149 |
-
* @uses this->define_constants
|
150 |
-
*
|
151 |
-
* @param string $name Constant name
|
152 |
-
* @param string.. $value Constant value
|
153 |
-
*/
|
154 |
-
private function define( $name, $value ) {
|
155 |
-
if ( ! defined( $name ) ) {
|
156 |
-
define( $name, $value );
|
157 |
-
}
|
158 |
}
|
159 |
|
160 |
-
|
161 |
-
|
162 |
|
|
|
163 |
/**
|
164 |
* include plugin file
|
165 |
*/
|
166 |
private function includes() {
|
167 |
|
168 |
// include in admin and front pages
|
169 |
-
include_once
|
170 |
-
// include_once HT_CCW_PLUGIN_DIR .'prev/inc/commons/class-ht-ccw-variables.php';
|
171 |
-
// include_once HT_CCW_PLUGIN_DIR .'prev/inc/commons/class-ht-ccw-ismobile.php';
|
172 |
-
|
173 |
|
174 |
// is_admin ? include file to admin area : include files to non-admin area
|
175 |
if ( is_admin() ) {
|
176 |
-
include_once
|
177 |
} else {
|
178 |
-
include_once
|
179 |
-
include_once
|
180 |
|
181 |
-
// include_once
|
182 |
-
include_once
|
183 |
|
184 |
}
|
185 |
}
|
@@ -209,7 +139,7 @@ class HT_CCW {
|
|
209 |
// add_filter( 'the_excerpt', 'do_shortcode');
|
210 |
|
211 |
// settings page link
|
212 |
-
add_filter( 'plugin_action_links_' .
|
213 |
|
214 |
// when plugin updated - check version diff
|
215 |
add_action('plugins_loaded', array( 'HT_CCW_Register', 'version_check' ) );
|
19 |
|
20 |
class HT_CCW {
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
/**
|
23 |
* singleton instance
|
24 |
*
|
25 |
* @var HT_CCW
|
26 |
*/
|
27 |
private static $instance = null;
|
|
|
28 |
|
29 |
/**
|
30 |
* wp_is_mobile - if true then 1, else 2
|
33 |
*/
|
34 |
public $device_type;
|
35 |
|
|
|
36 |
/**
|
37 |
* instance of HT_CCW_Variables
|
38 |
*
|
42 |
*/
|
43 |
public $variables = null;
|
44 |
|
|
|
45 |
/**
|
46 |
* main instance - HT_CCW
|
47 |
*
|
55 |
return self::$instance;
|
56 |
}
|
57 |
|
|
|
58 |
public function __clone() {
|
59 |
wc_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'click-to-chat-for-whatsapp' ), '1.0' );
|
60 |
}
|
63 |
wc_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'click-to-chat-for-whatsapp' ), '1.0' );
|
64 |
}
|
65 |
|
|
|
|
|
66 |
/**
|
67 |
* constructor
|
68 |
+
* includes() -> include files
|
69 |
+
* hooks() -> run hooks
|
70 |
*/
|
71 |
public function __construct() {
|
|
|
|
|
72 |
$this->basic();
|
|
|
73 |
$this->includes();
|
74 |
$this->hooks();
|
75 |
}
|
|
|
76 |
|
77 |
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
/**
|
80 |
* add the basic things
|
|
|
81 |
* calling this before include, initilize other things
|
|
|
82 |
* because this things may useful before initilize other things
|
|
|
83 |
* e.g. include, initialize files based on device, user settings
|
84 |
*/
|
85 |
private function basic() {
|
86 |
|
87 |
+
include_once HT_CTC_PLUGIN_DIR .'prev/inc/commons/class-ht-ccw-ismobile.php';
|
88 |
+
include_once HT_CTC_PLUGIN_DIR .'prev/inc/commons/class-ht-ccw-variables.php';
|
89 |
|
90 |
$this->device_type = new HT_CCW_IsMobile();
|
91 |
$this->variables = new HT_CCW_Variables();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
}
|
93 |
|
|
|
|
|
94 |
|
95 |
+
|
96 |
/**
|
97 |
* include plugin file
|
98 |
*/
|
99 |
private function includes() {
|
100 |
|
101 |
// include in admin and front pages
|
102 |
+
include_once HT_CTC_PLUGIN_DIR .'prev/inc/class-ht-ccw-register.php';
|
|
|
|
|
|
|
103 |
|
104 |
// is_admin ? include file to admin area : include files to non-admin area
|
105 |
if ( is_admin() ) {
|
106 |
+
include_once HT_CTC_PLUGIN_DIR . 'prev/admin/admin.php';
|
107 |
} else {
|
108 |
+
include_once HT_CTC_PLUGIN_DIR . 'prev/inc/class-ccw-add-styles-scripts.php';
|
109 |
+
include_once HT_CTC_PLUGIN_DIR . 'prev/inc/class-ccw-shortcode.php';
|
110 |
|
111 |
+
// include_once HT_CTC_PLUGIN_DIR . 'prev/inc/class-ht-ccw-floating-style.php';
|
112 |
+
include_once HT_CTC_PLUGIN_DIR . 'prev/inc/class-ht-ccw-chat.php';
|
113 |
|
114 |
}
|
115 |
}
|
139 |
// add_filter( 'the_excerpt', 'do_shortcode');
|
140 |
|
141 |
// settings page link
|
142 |
+
add_filter( 'plugin_action_links_' . HT_CTC_PLUGIN_BASENAME, array( 'HT_CCW_Register', 'plugin_action_links' ) );
|
143 |
|
144 |
// when plugin updated - check version diff
|
145 |
add_action('plugins_loaded', array( 'HT_CCW_Register', 'version_check' ) );
|
prev/inc/commons/styles-list-sc/sc-style-3.php
CHANGED
@@ -4,7 +4,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
|
4 |
|
5 |
$s3_icon_size = $a['s3_icon_size'];
|
6 |
|
7 |
-
$img_link = plugins_url("./new/inc/assets/img/whatsapp-logo.svg",
|
8 |
|
9 |
|
10 |
$s3_icon_size = $s3_icon_size;
|
4 |
|
5 |
$s3_icon_size = $a['s3_icon_size'];
|
6 |
|
7 |
+
$img_link = plugins_url("./new/inc/assets/img/whatsapp-logo.svg", HT_CTC_PLUGIN_FILE );
|
8 |
|
9 |
|
10 |
$s3_icon_size = $s3_icon_size;
|
prev/inc/commons/styles-list-sc/sc-style-4.php
CHANGED
@@ -9,7 +9,7 @@ $s4_background_color = $a['s4_background_color'];
|
|
9 |
$s4_text_color = $s4_text_color;
|
10 |
$s4_background_color = $s4_background_color;
|
11 |
|
12 |
-
$img_link_s4 = plugins_url("./new/inc/assets/img/whatsapp-logo-32x32.png",
|
13 |
|
14 |
$o .= '<div class="ccw_plugin sc_item '.$inline_issue.' " style=" '.$css.' " >';
|
15 |
$o .= '<div class="style-4 chip pointer ccw-analytics" data-ccw="style-4-sc" style=" color: '.$s4_text_color.'; background-color: '.$s4_background_color.' " onclick="'.$img_click_link.'">';
|
9 |
$s4_text_color = $s4_text_color;
|
10 |
$s4_background_color = $s4_background_color;
|
11 |
|
12 |
+
$img_link_s4 = plugins_url("./new/inc/assets/img/whatsapp-logo-32x32.png", HT_CTC_PLUGIN_FILE );
|
13 |
|
14 |
$o .= '<div class="ccw_plugin sc_item '.$inline_issue.' " style=" '.$css.' " >';
|
15 |
$o .= '<div class="style-4 chip pointer ccw-analytics" data-ccw="style-4-sc" style=" color: '.$s4_text_color.'; background-color: '.$s4_background_color.' " onclick="'.$img_click_link.'">';
|
prev/inc/commons/styles-list-sc/sc-style-99.php
CHANGED
@@ -35,7 +35,7 @@ if( 1 == $is_mobile ) {
|
|
35 |
}
|
36 |
|
37 |
if ( '' == $own_image ) {
|
38 |
-
$own_image = plugins_url( './new/inc/assets/img/whatsapp-logo.svg',
|
39 |
}
|
40 |
|
41 |
|
35 |
}
|
36 |
|
37 |
if ( '' == $own_image ) {
|
38 |
+
$own_image = plugins_url( './new/inc/assets/img/whatsapp-logo.svg', HT_CTC_PLUGIN_FILE );
|
39 |
}
|
40 |
|
41 |
|
prev/inc/commons/styles-list/style-2.php
CHANGED
@@ -1,4 +1,7 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
2 |
|
3 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
4 |
|
@@ -9,7 +12,6 @@ $s2_decoration = esc_attr( $ccw_options_cs['s2_decoration'] );
|
|
9 |
$s2_decoration_onhover = esc_attr( $ccw_options_cs['s2_decoration_onhover'] );
|
10 |
?>
|
11 |
<div class="ccw_plugin chatbot" style="<?php echo $p1 ?>; <?php echo $p2 ?>;">
|
12 |
-
<!-- style 2 -->
|
13 |
<div class="style2 animated <?php echo $an_on_load .' '. $an_on_hover ?> ">
|
14 |
<a href="<?php echo $redirect_a ?>"
|
15 |
style="color: <?php echo $s2_text_color ?>; text-decoration: <?php echo $s2_decoration ?>;"
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* plain link
|
4 |
+
*/
|
5 |
|
6 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
7 |
|
12 |
$s2_decoration_onhover = esc_attr( $ccw_options_cs['s2_decoration_onhover'] );
|
13 |
?>
|
14 |
<div class="ccw_plugin chatbot" style="<?php echo $p1 ?>; <?php echo $p2 ?>;">
|
|
|
15 |
<div class="style2 animated <?php echo $an_on_load .' '. $an_on_hover ?> ">
|
16 |
<a href="<?php echo $redirect_a ?>"
|
17 |
style="color: <?php echo $s2_text_color ?>; text-decoration: <?php echo $s2_decoration ?>;"
|
prev/inc/commons/styles-list/style-3.php
CHANGED
@@ -1,4 +1,7 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
2 |
|
3 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
4 |
|
@@ -7,10 +10,9 @@ $s3_icon_size = esc_attr( $ccw_options_cs['s3_icon_size'] );
|
|
7 |
|
8 |
?>
|
9 |
<div class="ccw_plugin chatbot" style="<?php echo $p1 ?>; <?php echo $p2 ?>;" >
|
10 |
-
<!-- style 3 logo -->
|
11 |
<div class="ccw_style3 animated <?php echo $an_on_load .' '. $an_on_hover ?> ">
|
12 |
<a target="_blank" href="<?php echo $redirect_a ?>" class="img-icon-a nofocus">
|
13 |
-
<img class="img-icon ccw-analytics" id="style-3" data-ccw="style-3" style="height: <?php echo $s3_icon_size ?>;" src="<?php echo plugins_url( "./new/inc/assets/img/whatsapp-logo.svg",
|
14 |
</a>
|
15 |
</div>
|
16 |
</div>
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* logo
|
4 |
+
*/
|
5 |
|
6 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
7 |
|
10 |
|
11 |
?>
|
12 |
<div class="ccw_plugin chatbot" style="<?php echo $p1 ?>; <?php echo $p2 ?>;" >
|
|
|
13 |
<div class="ccw_style3 animated <?php echo $an_on_load .' '. $an_on_hover ?> ">
|
14 |
<a target="_blank" href="<?php echo $redirect_a ?>" class="img-icon-a nofocus">
|
15 |
+
<img class="img-icon ccw-analytics" id="style-3" data-ccw="style-3" style="height: <?php echo $s3_icon_size ?>;" src="<?php echo plugins_url( "./new/inc/assets/img/whatsapp-logo.svg", HT_CTC_PLUGIN_FILE ) ?>" alt="WhatsApp chat">
|
16 |
</a>
|
17 |
</div>
|
18 |
</div>
|
prev/inc/commons/styles-list/style-4.php
CHANGED
@@ -1,4 +1,7 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
2 |
|
3 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
4 |
|
@@ -8,11 +11,10 @@ $s4_background_color = esc_attr( $ccw_options_cs['s4_background_color'] );
|
|
8 |
|
9 |
?>
|
10 |
<div class="ccw_plugin chatbot" style="<?php echo $p1 ?>; <?php echo $p2 ?>;">
|
11 |
-
<!-- style 4 chip - logo+text -->
|
12 |
<div class="style4 animated <?php echo $an_on_load .' '. $an_on_hover ?>">
|
13 |
<a target="_blank" href="<?php echo $redirect_a ?>" class="nofocus">
|
14 |
<div class="chip style-4 ccw-analytics" id="style-4" data-ccw="style-4" style="background-color: <?php echo $s4_background_color ?>; color: <?php echo $s4_text_color ?>">
|
15 |
-
<img src="<?php echo plugins_url( './new/inc/assets/img/whatsapp-logo-32x32.png',
|
16 |
<?php echo $val ?>
|
17 |
</div>
|
18 |
</a>
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* chip - logo+text
|
4 |
+
*/
|
5 |
|
6 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
7 |
|
11 |
|
12 |
?>
|
13 |
<div class="ccw_plugin chatbot" style="<?php echo $p1 ?>; <?php echo $p2 ?>;">
|
|
|
14 |
<div class="style4 animated <?php echo $an_on_load .' '. $an_on_hover ?>">
|
15 |
<a target="_blank" href="<?php echo $redirect_a ?>" class="nofocus">
|
16 |
<div class="chip style-4 ccw-analytics" id="style-4" data-ccw="style-4" style="background-color: <?php echo $s4_background_color ?>; color: <?php echo $s4_text_color ?>">
|
17 |
+
<img src="<?php echo plugins_url( './new/inc/assets/img/whatsapp-logo-32x32.png', HT_CTC_PLUGIN_FILE ) ?>" class="ccw-analytics" id="s4-icon" data-ccw="style-4" alt="WhatsApp">
|
18 |
<?php echo $val ?>
|
19 |
</div>
|
20 |
</a>
|
prev/inc/commons/styles-list/style-5.php
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
|
|
3 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
4 |
|
5 |
// $ccw_options_cs = get_option('ccw_options_cs');
|
@@ -7,7 +9,6 @@ $s5_color = esc_attr( $ccw_options_cs['s5_color'] );
|
|
7 |
$s5_hover_color = esc_attr( $ccw_options_cs['s5_hover_color'] );
|
8 |
$s5_icon_size = esc_attr( $ccw_options_cs['s5_icon_size'] );
|
9 |
?>
|
10 |
-
<!-- plan icon - similar to sytle-3 , here is an icon -->
|
11 |
<div class="ccw_plugin">
|
12 |
<div class="style-5 chatbot nofocus animated <?php echo $an_on_load .' '. $an_on_hover ?>" style="<?php echo $p1 ?>; <?php echo $p2 ?>;">
|
13 |
<a target="_blank" class="nofocus icon icon-whatsapp2 icon-2 ccw-analytics" id="stye-5" data-ccw="style-5"
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* plan icon - similar to sytle-3, an icon
|
4 |
+
*/
|
5 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
6 |
|
7 |
// $ccw_options_cs = get_option('ccw_options_cs');
|
9 |
$s5_hover_color = esc_attr( $ccw_options_cs['s5_hover_color'] );
|
10 |
$s5_icon_size = esc_attr( $ccw_options_cs['s5_icon_size'] );
|
11 |
?>
|
|
|
12 |
<div class="ccw_plugin">
|
13 |
<div class="style-5 chatbot nofocus animated <?php echo $an_on_load .' '. $an_on_hover ?>" style="<?php echo $p1 ?>; <?php echo $p2 ?>;">
|
14 |
<a target="_blank" class="nofocus icon icon-whatsapp2 icon-2 ccw-analytics" id="stye-5" data-ccw="style-5"
|
prev/inc/commons/styles-list/style-6.php
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
|
|
3 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
4 |
|
5 |
// $ccw_options_cs = get_option('ccw_options_cs');
|
@@ -16,7 +18,7 @@ $s6_line_height = esc_attr( $ccw_options_cs['s6_line_height'] );
|
|
16 |
$s6_css_icon = "color: $s6_color; font-size: $s6_icon_size;";
|
17 |
$s6_css_div = "background-color: $s6_circle_background_color; height: $s6_circle_height; width: $s6_circle_width; line-height: $s6_line_height; ";
|
18 |
?>
|
19 |
-
|
20 |
<div class="ccw_plugin">
|
21 |
<div class="chatbot btn_only_style_div_circle pointer ccw-analytics animated <?php echo $an_on_load .' '. $an_on_hover ?>" id="style-6" data-ccw="style-6"
|
22 |
style="<?php echo $p1 ?>; <?php echo $p2 ?>; <?php echo $s6_css_div ?>"
|
@@ -24,6 +26,5 @@ $s6_css_div = "background-color: $s6_circle_background_color; height: $s6_circle
|
|
24 |
onmouseout = "this.style.backgroundColor = '<?php echo $s6_circle_background_color ?>', document.getElementsByClassName('ccw-s6-icon')[0].style.color = '<?php echo $s6_color ?>' "
|
25 |
onclick = "<?php echo $redirect ?>" >
|
26 |
<span class="icon icon-whatsapp2 ccw-s6-icon nofocus ccw-analytics" id="s6-icon" data-ccw="style-6" style="<?php echo $s6_css_icon ?>"></span>
|
27 |
-
<!-- instead of a tag - if added span also it works fine - as div has onclick link added -->
|
28 |
</div>
|
29 |
</div>
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* button with icon - circle
|
4 |
+
*/
|
5 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
6 |
|
7 |
// $ccw_options_cs = get_option('ccw_options_cs');
|
18 |
$s6_css_icon = "color: $s6_color; font-size: $s6_icon_size;";
|
19 |
$s6_css_div = "background-color: $s6_circle_background_color; height: $s6_circle_height; width: $s6_circle_width; line-height: $s6_line_height; ";
|
20 |
?>
|
21 |
+
|
22 |
<div class="ccw_plugin">
|
23 |
<div class="chatbot btn_only_style_div_circle pointer ccw-analytics animated <?php echo $an_on_load .' '. $an_on_hover ?>" id="style-6" data-ccw="style-6"
|
24 |
style="<?php echo $p1 ?>; <?php echo $p2 ?>; <?php echo $s6_css_div ?>"
|
26 |
onmouseout = "this.style.backgroundColor = '<?php echo $s6_circle_background_color ?>', document.getElementsByClassName('ccw-s6-icon')[0].style.color = '<?php echo $s6_color ?>' "
|
27 |
onclick = "<?php echo $redirect ?>" >
|
28 |
<span class="icon icon-whatsapp2 ccw-s6-icon nofocus ccw-analytics" id="s6-icon" data-ccw="style-6" style="<?php echo $s6_css_icon ?>"></span>
|
|
|
29 |
</div>
|
30 |
</div>
|
prev/inc/commons/styles-list/style-7.php
CHANGED
@@ -1,4 +1,7 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
2 |
|
3 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
4 |
|
@@ -16,7 +19,6 @@ $s7_line_height = esc_attr( $ccw_options_cs['s7_line_height'] );
|
|
16 |
$s7_css_icon = "color: $s7_color; font-size: $s7_icon_size;";
|
17 |
$s7_css_div = "background-color: $s7_box_background_color; height: $s7_box_height; width: $s7_box_width; line-height: $s7_line_height; ";
|
18 |
?>
|
19 |
-
<!-- button with icon - box -->
|
20 |
<div class="ccw_plugin">
|
21 |
<div class="chatbot btn_only_style_div pointer ccw-analytics animated <?php echo $an_on_load .' '. $an_on_hover ?>" id="style-7" data-ccw="style-7"
|
22 |
style="<?php echo $p1 ?>; <?php echo $p2 ?>; <?php echo $s7_css_div ?>"
|
@@ -24,6 +26,5 @@ $s7_css_div = "background-color: $s7_box_background_color; height: $s7_box_heigh
|
|
24 |
onmouseout = "this.style.backgroundColor = '<?php echo $s7_box_background_color ?>', document.getElementsByClassName('ccw-s7-icon')[0].style.color = '<?php echo $s7_color ?>' "
|
25 |
onclick = "<?php echo $redirect ?>" >
|
26 |
<span class="icon icon-whatsapp2 ccw-s7-icon nofocus ccw-analytics" id="s7-icon" data-ccw="style-7" style="<?php echo $s7_css_icon ?>"></span>
|
27 |
-
<!-- instead of a tag - if added span also it works fine - as div has onclick link added -->
|
28 |
</div>
|
29 |
</div>
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* button with icon - box
|
4 |
+
*/
|
5 |
|
6 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
7 |
|
19 |
$s7_css_icon = "color: $s7_color; font-size: $s7_icon_size;";
|
20 |
$s7_css_div = "background-color: $s7_box_background_color; height: $s7_box_height; width: $s7_box_width; line-height: $s7_line_height; ";
|
21 |
?>
|
|
|
22 |
<div class="ccw_plugin">
|
23 |
<div class="chatbot btn_only_style_div pointer ccw-analytics animated <?php echo $an_on_load .' '. $an_on_hover ?>" id="style-7" data-ccw="style-7"
|
24 |
style="<?php echo $p1 ?>; <?php echo $p2 ?>; <?php echo $s7_css_div ?>"
|
26 |
onmouseout = "this.style.backgroundColor = '<?php echo $s7_box_background_color ?>', document.getElementsByClassName('ccw-s7-icon')[0].style.color = '<?php echo $s7_color ?>' "
|
27 |
onclick = "<?php echo $redirect ?>" >
|
28 |
<span class="icon icon-whatsapp2 ccw-s7-icon nofocus ccw-analytics" id="s7-icon" data-ccw="style-7" style="<?php echo $s7_css_icon ?>"></span>
|
|
|
29 |
</div>
|
30 |
</div>
|
prev/inc/commons/styles-list/style-8.php
CHANGED
@@ -1,4 +1,7 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
2 |
|
3 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
4 |
|
@@ -17,7 +20,6 @@ $s8_icon_float = esc_attr( $ccw_options_cs['s8_icon_float'] );
|
|
17 |
|
18 |
|
19 |
?>
|
20 |
-
<!-- material button - text , icon -->
|
21 |
<div class="ccw_plugin mdstyle8 chatbot" style="<?php echo $p1 ?>; <?php echo $p2 ?>;">
|
22 |
<div class="style8 animated <?php echo $an_on_load .' '. $an_on_hover ?>">
|
23 |
<a target="_blank" class="btn ccw-analytics" id="style-8" data-ccw="style-8"
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* material button - text , icon
|
4 |
+
*/
|
5 |
|
6 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
7 |
|
20 |
|
21 |
|
22 |
?>
|
|
|
23 |
<div class="ccw_plugin mdstyle8 chatbot" style="<?php echo $p1 ?>; <?php echo $p2 ?>;">
|
24 |
<div class="style8 animated <?php echo $an_on_load .' '. $an_on_hover ?>">
|
25 |
<a target="_blank" class="btn ccw-analytics" id="style-8" data-ccw="style-8"
|
prev/inc/commons/styles-list/style-9.php
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
|
|
3 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
4 |
|
5 |
// $ccw_options_cs = get_option('ccw_options_cs');
|
@@ -7,10 +9,9 @@ $s9_icon_size = esc_attr( $ccw_options_cs['s9_icon_size'] );
|
|
7 |
?>
|
8 |
|
9 |
<div class="ccw_plugin chatbot" style="<?php echo $p1 ?>; <?php echo $p2 ?>;">
|
10 |
-
<!-- style 9 logo -->
|
11 |
<div class="ccw_style9 animated <?php echo $an_on_load .' '. $an_on_hover ?>">
|
12 |
<a target="_blank" href="<?php echo $redirect_a ?>" class="img-icon-a nofocus">
|
13 |
-
<img class="img-icon ccw-analytics" id="style-9" data-ccw="style-9" style="height: <?php echo $s9_icon_size ?>;" src="<?php echo plugins_url( './new/inc/assets/img/whatsapp-icon-square.svg',
|
14 |
</a>
|
15 |
</div>
|
16 |
</div>
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* logo
|
4 |
+
*/
|
5 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
6 |
|
7 |
// $ccw_options_cs = get_option('ccw_options_cs');
|
9 |
?>
|
10 |
|
11 |
<div class="ccw_plugin chatbot" style="<?php echo $p1 ?>; <?php echo $p2 ?>;">
|
|
|
12 |
<div class="ccw_style9 animated <?php echo $an_on_load .' '. $an_on_hover ?>">
|
13 |
<a target="_blank" href="<?php echo $redirect_a ?>" class="img-icon-a nofocus">
|
14 |
+
<img class="img-icon ccw-analytics" id="style-9" data-ccw="style-9" style="height: <?php echo $s9_icon_size ?>;" src="<?php echo plugins_url( './new/inc/assets/img/whatsapp-icon-square.svg', HT_CTC_PLUGIN_FILE ) ?>" alt="WhatsApp chat">
|
15 |
</a>
|
16 |
</div>
|
17 |
</div>
|
prev/inc/commons/styles-list/style-99.php
CHANGED
@@ -43,13 +43,12 @@ if( 1 == $is_mobile ) {
|
|
43 |
}
|
44 |
|
45 |
if ( '' == $own_image ) {
|
46 |
-
$own_image = plugins_url( './new/inc/assets/img/whatsapp-logo.svg',
|
47 |
}
|
48 |
|
49 |
?>
|
50 |
|
51 |
<div class="ccw_plugin chatbot" style="<?php echo $p1 ?>; <?php echo $p2 ?>;">
|
52 |
-
<!-- style 9 logo -->
|
53 |
<div class="ccw_style_99 animated <?php echo $an_on_load .' '. $an_on_hover ?>">
|
54 |
<a target="_blank" href="<?php echo $redirect_a ?>" class="img-icon-a nofocus">
|
55 |
<img class="own-img ccw-analytics" id="style-9" data-ccw="style-99-own-image" style="<?php echo $img_css ?>" src="<?php echo $own_image ?>" alt="WhatsApp chat">
|
43 |
}
|
44 |
|
45 |
if ( '' == $own_image ) {
|
46 |
+
$own_image = plugins_url( './new/inc/assets/img/whatsapp-logo.svg', HT_CTC_PLUGIN_FILE );
|
47 |
}
|
48 |
|
49 |
?>
|
50 |
|
51 |
<div class="ccw_plugin chatbot" style="<?php echo $p1 ?>; <?php echo $p2 ?>;">
|
|
|
52 |
<div class="ccw_style_99 animated <?php echo $an_on_load .' '. $an_on_hover ?>">
|
53 |
<a target="_blank" href="<?php echo $redirect_a ?>" class="img-icon-a nofocus">
|
54 |
<img class="own-img ccw-analytics" id="style-9" data-ccw="style-99-own-image" style="<?php echo $img_css ?>" src="<?php echo $own_image ?>" alt="WhatsApp chat">
|
prev/inc/commons/styles.php
CHANGED
@@ -49,12 +49,9 @@ if( 1 == $is_mobile ) {
|
|
49 |
|
50 |
|
51 |
if ( 'group_chat' == $return_type ) {
|
52 |
-
// $redirect_page = plugins_url( "prev/inc/whatsapp-url-group.php?id=$group_id", HT_CCW_PLUGIN_FILE );
|
53 |
$redirect = "window.open('https://chat.whatsapp.com/$group_id', '_blank')";
|
54 |
$redirect_a = "https://chat.whatsapp.com/$group_id";
|
55 |
} else {
|
56 |
-
// $base_url = plugins_url( "prev/inc/whatsapp-url.php", HT_CCW_PLUGIN_FILE );
|
57 |
-
// $redirect_page = $base_url . "?num=$num&text=$initial_text&m=$is_mobile";
|
58 |
$redirect = "window.open('https://api.whatsapp.com/send?phone=$num&text=$initial_text', '_blank')";
|
59 |
$redirect_a = "https://api.whatsapp.com/send?phone=$num&text=$initial_text";
|
60 |
}
|
@@ -68,13 +65,9 @@ if( 1 == $is_mobile ) {
|
|
68 |
|
69 |
// App First - so mobile based url
|
70 |
if ( 'group_chat' == $return_type ) {
|
71 |
-
// $redirect_page = plugins_url( "prev/inc/whatsapp-url-group.php?id=$group_id", HT_CCW_PLUGIN_FILE );
|
72 |
$redirect = "window.open('https://chat.whatsapp.com/$group_id', '_blank')";
|
73 |
$redirect_a = "https://chat.whatsapp.com/$group_id";
|
74 |
} else {
|
75 |
-
// an issue addin another url in plugin_url - in {{url}} https:// - one / is missing is
|
76 |
-
// $base_url = plugins_url( "prev/inc/whatsapp-url.php", HT_CCW_PLUGIN_FILE );
|
77 |
-
// $redirect_page = $base_url . "?num=$num&text=$initial_text&m=1";
|
78 |
$redirect = "window.open('https://api.whatsapp.com/send?phone=$num&text=$initial_text', '_blank')";
|
79 |
$redirect_a = "https://api.whatsapp.com/send?phone=$num&text=$initial_text";
|
80 |
}
|
@@ -84,12 +77,9 @@ if( 1 == $is_mobile ) {
|
|
84 |
|
85 |
// General - Desktop url
|
86 |
if ( 'group_chat' == $return_type ) {
|
87 |
-
// $redirect_page = plugins_url( "prev/inc/whatsapp-url-group.php?id=$group_id", HT_CCW_PLUGIN_FILE );
|
88 |
$redirect = "window.open('https://chat.whatsapp.com/$group_id', '_blank')";
|
89 |
$redirect_a = "https://chat.whatsapp.com/$group_id";
|
90 |
} else {
|
91 |
-
// $base_url = plugins_url( "prev/inc/whatsapp-url.php", HT_CCW_PLUGIN_FILE );
|
92 |
-
// $redirect_page = $base_url . "?num=$num&text=$initial_text&m=0";
|
93 |
$redirect = "window.open('https://web.whatsapp.com/send?phone=$num&text=$initial_text', '_blank')";
|
94 |
$redirect_a = "https://web.whatsapp.com/send?phone=$num&text=$initial_text";
|
95 |
}
|
@@ -100,22 +90,25 @@ if( 1 == $is_mobile ) {
|
|
100 |
}
|
101 |
|
102 |
|
103 |
-
if ( isset ( $_POST['subject'] ) ) {
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
}
|
116 |
|
117 |
// floating style template path
|
118 |
-
$path = plugin_dir_path(
|
|
|
|
|
|
|
|
|
119 |
|
120 |
if ( is_file( $path ) ) {
|
121 |
include_once $path;
|
49 |
|
50 |
|
51 |
if ( 'group_chat' == $return_type ) {
|
|
|
52 |
$redirect = "window.open('https://chat.whatsapp.com/$group_id', '_blank')";
|
53 |
$redirect_a = "https://chat.whatsapp.com/$group_id";
|
54 |
} else {
|
|
|
|
|
55 |
$redirect = "window.open('https://api.whatsapp.com/send?phone=$num&text=$initial_text', '_blank')";
|
56 |
$redirect_a = "https://api.whatsapp.com/send?phone=$num&text=$initial_text";
|
57 |
}
|
65 |
|
66 |
// App First - so mobile based url
|
67 |
if ( 'group_chat' == $return_type ) {
|
|
|
68 |
$redirect = "window.open('https://chat.whatsapp.com/$group_id', '_blank')";
|
69 |
$redirect_a = "https://chat.whatsapp.com/$group_id";
|
70 |
} else {
|
|
|
|
|
|
|
71 |
$redirect = "window.open('https://api.whatsapp.com/send?phone=$num&text=$initial_text', '_blank')";
|
72 |
$redirect_a = "https://api.whatsapp.com/send?phone=$num&text=$initial_text";
|
73 |
}
|
77 |
|
78 |
// General - Desktop url
|
79 |
if ( 'group_chat' == $return_type ) {
|
|
|
80 |
$redirect = "window.open('https://chat.whatsapp.com/$group_id', '_blank')";
|
81 |
$redirect_a = "https://chat.whatsapp.com/$group_id";
|
82 |
} else {
|
|
|
|
|
83 |
$redirect = "window.open('https://web.whatsapp.com/send?phone=$num&text=$initial_text', '_blank')";
|
84 |
$redirect_a = "https://web.whatsapp.com/send?phone=$num&text=$initial_text";
|
85 |
}
|
90 |
}
|
91 |
|
92 |
|
93 |
+
// if ( isset ( $_POST['subject'] ) ) {
|
94 |
+
// $num = esc_attr( $values['number'] );
|
95 |
+
// $subject = sanitize_text_field( $_POST['subject'] );
|
96 |
+
// $url = "$redirect_a&text=$subject";
|
97 |
|
98 |
+
// if ( headers_sent() ) {
|
99 |
+
// die('<script type="text/javascript">window.location.href="' . $url . '";</script>');
|
100 |
+
// } else {
|
101 |
+
// header('Location: ' . $url);
|
102 |
+
// die();
|
103 |
+
// }
|
104 |
+
// }
|
|
|
105 |
|
106 |
// floating style template path
|
107 |
+
$path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'prev/inc/commons/styles-list/style-' . $style. '.php';
|
108 |
+
|
109 |
+
$version = HT_CTC_VERSION;
|
110 |
+
$comment = "<!-- Click to Chat - prev - https://holithemes.com/plugins/click-to-chat/ v$version -->";
|
111 |
+
echo $comment;
|
112 |
|
113 |
if ( is_file( $path ) ) {
|
114 |
include_once $path;
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Click to Chat ===
|
2 |
Requires at least: 4.6
|
3 |
-
Tested up to: 5.
|
4 |
Requires PHP: 5.6
|
5 |
Contributors: holithemes
|
6 |
-
Stable tag:
|
7 |
-
Tags: whatsapp, whatsapp
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -28,6 +28,17 @@ Add your 'WhatsApp' or 'WhatsApp Business' Number. And let your website visitors
|
|
28 |
|
29 |
**Desktop:** Navigates to Webpage(web.whatsapp.com) / WhatsApp Desktop App.
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
= 💎 Styles =
|
32 |
|
33 |
Select Style that matches your Website design.
|
@@ -42,8 +53,10 @@ Instead of selecting a pre-defined style, add any image/Animated image/GIF.
|
|
42 |
|
43 |
= ✳️ Position to Place =
|
44 |
|
45 |
-
> Add styles at any position of the screen
|
46 |
-
(not limited to fixed positions).
|
|
|
|
|
47 |
|
48 |
= ⏩ Pre-filled Message =
|
49 |
|
@@ -52,34 +65,43 @@ Text that appears at the WhatsApp chat window when the user clicks on the Image/
|
|
52 |
Users can start the conversation easily.
|
53 |
|
54 |
Add variables to change values dynamically
|
55 |
-
|
|
|
56 |
{site} -> Website Title
|
57 |
{title} -> Page Title
|
58 |
{url} -> Web page URL
|
59 |
-
|
60 |
|
61 |
With these variables we can understand from which page the user started WhatsApp chat.
|
62 |
|
63 |
[Pre-filled Message](https://holithemes.com/plugins/click-to-chat/pre-filled-message/)
|
64 |
|
65 |
-
=
|
66 |
-
|
67 |
-
Creates an Event when the user clicks on WhatsApp Icon/button.
|
68 |
|
69 |
-
|
70 |
|
71 |
-
|
72 |
-
|
73 |
-
= 👓 Show/Hide =
|
74 |
-
|
75 |
-
Show or Hide styles based on Post type, Post ID, Category, Device Type(Mobile, Dekstop).
|
76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
= 📒 Change Values at page level =
|
78 |
|
79 |
> Change 'WhatsApp Number', 'Call to Action' at the page level
|
80 |
|
81 |
[Page level settings](https://holithemes.com/plugins/click-to-chat/change-values-at-page-level/)
|
82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
= 🌈 Eight Styles + own Image =
|
84 |
|
85 |
1. **Style-1:** Button, appears as the theme button.
|
@@ -96,6 +118,23 @@ Show or Hide styles based on Post type, Post ID, Category, Device Type(Mobile, D
|
|
96 |
|
97 |
✏️ [Styles are customizable](https://holithemes.com/plugins/click-to-chat/customize-styles/)
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
= ⛳ Shortcodes =
|
100 |
|
101 |
Use shortcodes to add the icon/button with inline the Posts content, widgets.
|
@@ -130,8 +169,9 @@ Let users share your website with their WhatsApp contacts and get more leads.
|
|
130 |
== screenshots ==
|
131 |
|
132 |
1. 8 Styles, 1 Add own image / GIF Style
|
133 |
-
1. Chat Settings - Enter WhatsApp Number, prefilled message, call to action,
|
134 |
-
1.
|
|
|
135 |
1. Change Values at page level: 'WhatsApp Number', 'Call to action', 'Group ID'
|
136 |
1. Add style at any position of the screen
|
137 |
1. Shortcodes - add style with inline the content
|
@@ -144,6 +184,7 @@ Let users share your website with their WhatsApp contacts and get more leads.
|
|
144 |
1. Share settings page
|
145 |
1. Hide on Selected pages
|
146 |
1. Show on Selected pages
|
|
|
147 |
|
148 |
|
149 |
== Installation ==
|
@@ -177,11 +218,11 @@ number: 6123456789
|
|
177 |
Makes user to start the conversation easily.
|
178 |
|
179 |
Add variables to change values dynamically
|
180 |
-
|
181 |
{url} -> Web page URL
|
182 |
{title} -> Page Title
|
183 |
{site} -> Website Title
|
184 |
-
|
185 |
|
186 |
E.g.
|
187 |
|
@@ -189,12 +230,36 @@ E.g.
|
|
189 |
Name:
|
190 |
I like to know more information about this {title}, {url}.
|
191 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
With this prefilled text, we can know from which page the user started the conversation, regarding which they contacted us and their details
|
193 |
|
194 |
= Call to Action =
|
195 |
|
196 |
Text that appears along with the icon/button.
|
197 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
Call to actions are avialble for these Styles: 1, 4, 5, 6, 8
|
199 |
For styles 2, 3, 7 call to action will display when mouse hovers on the icon/Image.
|
200 |
|
@@ -208,7 +273,7 @@ Select styles based on Device.
|
|
208 |
|
209 |
Styles are customizable according to your theme/usecase.
|
210 |
|
211 |
-
= Position
|
212 |
|
213 |
Add Styles at any position of the screen (not just fixed to selected positions).
|
214 |
|
@@ -232,6 +297,15 @@ Plugin supports all CSS units as suffix. (px, %, rem,...)
|
|
232 |
|
233 |
[position to place](https://holithemes.com/plugins/click-to-chat/position-to-place/)
|
234 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
235 |
= Shortcodes Attributes =
|
236 |
|
237 |
Shortcodes by default get values from settings page. Override this values using attributes.
|
@@ -282,7 +356,7 @@ Share Text - E.g.
|
|
282 |
* Check WhatsApp number entered with country code
|
283 |
* Check Show/Hide settings
|
284 |
|
285 |
-
|
286 |
|
287 |
= ❤️ Support / Contact =
|
288 |
|
@@ -290,7 +364,7 @@ For any issues with the plugin / suggestions:
|
|
290 |
|
291 |
* please create a [new topic](https://wordpress.org/support/plugin/click-to-chat-for-whatsapp/)
|
292 |
|
293 |
-
* 📧
|
294 |
|
295 |
* [WhatsApp us](http://api.whatsapp.com/send?phone=919494429789&text=Hi%20HoliThemes,%20I%20have%20a%20question:)
|
296 |
|
@@ -309,13 +383,81 @@ Thank you so much from "Click to Chat" developers, HoliThemes.
|
|
309 |
* Activate the plugin through the "Plugins" menu in WordPress.
|
310 |
|
311 |
= From Dashboard ( WordPress admin ) =
|
312 |
-
*
|
313 |
* click on 'update now'
|
|
|
|
|
|
|
314 |
|
315 |
After Activate the plugin, add WhatsApp Number at plugin settings.
|
316 |
|
317 |
== Changelog ==
|
318 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
319 |
= 2.8.3 =
|
320 |
* Fix: Cache issue - Hide based on device - now detects based on screen size
|
321 |
|
1 |
=== Click to Chat ===
|
2 |
Requires at least: 4.6
|
3 |
+
Tested up to: 5.5.3
|
4 |
Requires PHP: 5.6
|
5 |
Contributors: holithemes
|
6 |
+
Stable tag: 2.12.1
|
7 |
+
Tags: whatsapp, whatsapp business, click to chat, whatsapp chat, whatsapp support, whatsapp group, whatsapp message, social chat, whatsapp wordpress, whatsapp floating button, whatsapp icon, holithemes
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
28 |
|
29 |
**Desktop:** Navigates to Webpage(web.whatsapp.com) / WhatsApp Desktop App.
|
30 |
|
31 |
+
= Next v3.0 =
|
32 |
+
|
33 |
+
[Download v3.0-beta.1 from Plugin Development Version](https://wordpress.org/plugins/click-to-chat-for-whatsapp/advanced/#plugin-download-history-stats:~:text=Please%20select%20a%20specific%20version%20to%20download).
|
34 |
+
|
35 |
+
* Call to Action for Style-2, 3, 7.
|
36 |
+
* New 'Style-7 Extend'.
|
37 |
+
* Style-3 is now Style-3, 'Style-3 Extend'.
|
38 |
+
* Improved Style-7, Style-8.
|
39 |
+
* Animations
|
40 |
+
* New Variable for prefilled message. [url] - replaces with full url including parameters.
|
41 |
+
|
42 |
= 💎 Styles =
|
43 |
|
44 |
Select Style that matches your Website design.
|
53 |
|
54 |
= ✳️ Position to Place =
|
55 |
|
56 |
+
> Add styles at any position of the screen
|
57 |
+
(not limited to fixed positions).
|
58 |
+
|
59 |
+
> can set different positions for Mobile and Desktop.
|
60 |
|
61 |
= ⏩ Pre-filled Message =
|
62 |
|
65 |
Users can start the conversation easily.
|
66 |
|
67 |
Add variables to change values dynamically
|
68 |
+
|
69 |
+
`
|
70 |
{site} -> Website Title
|
71 |
{title} -> Page Title
|
72 |
{url} -> Web page URL
|
73 |
+
`
|
74 |
|
75 |
With these variables we can understand from which page the user started WhatsApp chat.
|
76 |
|
77 |
[Pre-filled Message](https://holithemes.com/plugins/click-to-chat/pre-filled-message/)
|
78 |
|
79 |
+
= 🎁 WooCommerce =
|
|
|
|
|
80 |
|
81 |
+
Seperate 'pre-filled message', 'call to action' settings for WooCommerce Single product pages.
|
82 |
|
83 |
+
Additional, variables to change values dynamically
|
|
|
|
|
|
|
|
|
84 |
|
85 |
+
`
|
86 |
+
{product} -> Product Name
|
87 |
+
{price} -> Product Price (current price)
|
88 |
+
{regular_price} -> Regular product price (with out any sale)
|
89 |
+
{sku} ->Stock keeping unit
|
90 |
+
`
|
91 |
= 📒 Change Values at page level =
|
92 |
|
93 |
> Change 'WhatsApp Number', 'Call to Action' at the page level
|
94 |
|
95 |
[Page level settings](https://holithemes.com/plugins/click-to-chat/change-values-at-page-level/)
|
96 |
|
97 |
+
= 📈 Analytics =
|
98 |
+
|
99 |
+
Creates an Event when the user clicks on WhatsApp Icon/button.
|
100 |
+
|
101 |
+
[Google Analytics](https://holithemes.com/plugins/click-to-chat/google-analytics/)
|
102 |
+
|
103 |
+
[Facebook Pixel](https://holithemes.com/plugins/click-to-chat/facebook-pixel/)
|
104 |
+
|
105 |
= 🌈 Eight Styles + own Image =
|
106 |
|
107 |
1. **Style-1:** Button, appears as the theme button.
|
118 |
|
119 |
✏️ [Styles are customizable](https://holithemes.com/plugins/click-to-chat/customize-styles/)
|
120 |
|
121 |
+
= 🔆 Localization =
|
122 |
+
|
123 |
+
compatible with [WPML](https://wpml.org/), Polylang.
|
124 |
+
|
125 |
+
Easy to setup different values for language
|
126 |
+
* WhatsApp Number
|
127 |
+
* Call to Action
|
128 |
+
* Pre-filled message
|
129 |
+
|
130 |
+
= 🔯 Performance =
|
131 |
+
|
132 |
+
* Rich in features but frontend of the site content is very light weight. We highly concentrate on performance.
|
133 |
+
|
134 |
+
= 👓 Show/Hide =
|
135 |
+
|
136 |
+
Show or Hide styles based on Post type, Post ID, Category, Device Type(Mobile, Desktop).
|
137 |
+
|
138 |
= ⛳ Shortcodes =
|
139 |
|
140 |
Use shortcodes to add the icon/button with inline the Posts content, widgets.
|
169 |
== screenshots ==
|
170 |
|
171 |
1. 8 Styles, 1 Add own image / GIF Style
|
172 |
+
1. Chat Settings - Enter WhatsApp Number, prefilled message, call to action, desktop: web view / desktop app view
|
173 |
+
1. Desktop settings - style, position to place
|
174 |
+
1. Mobile settings - style, position to place
|
175 |
1. Change Values at page level: 'WhatsApp Number', 'Call to action', 'Group ID'
|
176 |
1. Add style at any position of the screen
|
177 |
1. Shortcodes - add style with inline the content
|
184 |
1. Share settings page
|
185 |
1. Hide on Selected pages
|
186 |
1. Show on Selected pages
|
187 |
+
1. prefilled, call to action for WooCommerce single product pages
|
188 |
|
189 |
|
190 |
== Installation ==
|
218 |
Makes user to start the conversation easily.
|
219 |
|
220 |
Add variables to change values dynamically
|
221 |
+
`
|
222 |
{url} -> Web page URL
|
223 |
{title} -> Page Title
|
224 |
{site} -> Website Title
|
225 |
+
`
|
226 |
|
227 |
E.g.
|
228 |
|
230 |
Name:
|
231 |
I like to know more information about this {title}, {url}.
|
232 |
|
233 |
+
Additional variables for WooCommerce single product pages
|
234 |
+
```
|
235 |
+
{product} -> Product Name
|
236 |
+
{price} -> Product Price (current price might be the sale price/regular price)
|
237 |
+
{regular_price} -> Regular product price (with out any sale)
|
238 |
+
{sku} ->Stock keeping unit
|
239 |
+
```
|
240 |
+
|
241 |
+
E.g.
|
242 |
+
|
243 |
+
Hi {site}!!
|
244 |
+
Name:
|
245 |
+
I like to buy this {product}, {url}
|
246 |
+
|
247 |
+
|
248 |
With this prefilled text, we can know from which page the user started the conversation, regarding which they contacted us and their details
|
249 |
|
250 |
= Call to Action =
|
251 |
|
252 |
Text that appears along with the icon/button.
|
253 |
|
254 |
+
E.g.
|
255 |
+
|
256 |
+
`WhatsApp us`
|
257 |
+
|
258 |
+
For WooCommerce single product pages
|
259 |
+
E.g.
|
260 |
+
|
261 |
+
`Chat to buy, only {sku} stock left`
|
262 |
+
|
263 |
Call to actions are avialble for these Styles: 1, 4, 5, 6, 8
|
264 |
For styles 2, 3, 7 call to action will display when mouse hovers on the icon/Image.
|
265 |
|
273 |
|
274 |
Styles are customizable according to your theme/usecase.
|
275 |
|
276 |
+
= Position to place the styles =
|
277 |
|
278 |
Add Styles at any position of the screen (not just fixed to selected positions).
|
279 |
|
297 |
|
298 |
[position to place](https://holithemes.com/plugins/click-to-chat/position-to-place/)
|
299 |
|
300 |
+
= Localization - WPML, Polylang =
|
301 |
+
|
302 |
+
From WPML, Polylang navigatge to 'String Translations' and filter strings 'Click to chat for whatsapp' and change value based on language.
|
303 |
+
|
304 |
+
* User Input (Plugin Settings values): - 'Click to chat for WhatsApp'
|
305 |
+
* Admin strings (Plugin Settings) - text domain: 'click-to-chat-for-whatsapp'
|
306 |
+
|
307 |
+
> Help plugin by [Translating Setting page strings(admin content), Readme text](https://translate.wordpress.org/projects/wp-plugins/click-to-chat-for-whatsapp/)
|
308 |
+
|
309 |
= Shortcodes Attributes =
|
310 |
|
311 |
Shortcodes by default get values from settings page. Override this values using attributes.
|
356 |
* Check WhatsApp number entered with country code
|
357 |
* Check Show/Hide settings
|
358 |
|
359 |
+
For any queries, please contact us.
|
360 |
|
361 |
= ❤️ Support / Contact =
|
362 |
|
364 |
|
365 |
* please create a [new topic](https://wordpress.org/support/plugin/click-to-chat-for-whatsapp/)
|
366 |
|
367 |
+
* 📧 clicktochat@holithemes.com
|
368 |
|
369 |
* [WhatsApp us](http://api.whatsapp.com/send?phone=919494429789&text=Hi%20HoliThemes,%20I%20have%20a%20question:)
|
370 |
|
383 |
* Activate the plugin through the "Plugins" menu in WordPress.
|
384 |
|
385 |
= From Dashboard ( WordPress admin ) =
|
386 |
+
* When a new version released - you can see 'update now' link at wp-admin -> plugins
|
387 |
* click on 'update now'
|
388 |
+
or
|
389 |
+
* since WordPress 5.5, If auto update for the plugin is enabled.
|
390 |
+
plugin will update automatically when new version is released
|
391 |
|
392 |
After Activate the plugin, add WhatsApp Number at plugin settings.
|
393 |
|
394 |
== Changelog ==
|
395 |
|
396 |
+
= 2.12.1 =
|
397 |
+
* Fix: Style-4 img position issue.
|
398 |
+
* Updated: admin page
|
399 |
+
|
400 |
+
= 2.12 =
|
401 |
+
* Localization - compatibile with WPML, Polylang.
|
402 |
+
- WhatsApp Number
|
403 |
+
- Call to Action
|
404 |
+
- Pre-filled Message
|
405 |
+
|
406 |
+
= 2.11 =
|
407 |
+
* User Interface: Desktop, Mobile settings
|
408 |
+
* Updated: Style-3, extended Settings
|
409 |
+
* Updated: Style-4 Emebed default svg image, Image size, position
|
410 |
+
* Updated: Style-8
|
411 |
+
|
412 |
+
= 2.10.2 =
|
413 |
+
* performance improvement
|
414 |
+
* Fixed minor issues
|
415 |
+
|
416 |
+
= 2.10.1 =
|
417 |
+
* Updated: Position to Place
|
418 |
+
|
419 |
+
= 2.10 =
|
420 |
+
* New: position for mobile (now can set different positions for mobile, desktop)
|
421 |
+
* Improved User Interface, Performance
|
422 |
+
|
423 |
+
* Admin side changes
|
424 |
+
- Enable/disable Group, Share feature options swifted to "Customize" -> "Other Settings"
|
425 |
+
- "Customize Styles" menu renamed as "Customize"
|
426 |
+
|
427 |
+
= 2.9.2 =
|
428 |
+
* Improved User Interface, Performance
|
429 |
+
* Updated: Change values at page level settings
|
430 |
+
|
431 |
+
= 2.9.1 =
|
432 |
+
* Option to set delete settings when plugin uninstalls
|
433 |
+
* Updated: WooCommerce related features
|
434 |
+
* Updated: if number blank
|
435 |
+
* Added a fallback call_to_action for some styles
|
436 |
+
|
437 |
+
= 2.9 =
|
438 |
+
|
439 |
+
* Introduction WooCommerce related features
|
440 |
+
- 'Pre-filled message' for single product pages
|
441 |
+
with variables {product}, {price}, {regular_price}, {sku}
|
442 |
+
- 'Call to Action' for single product pages
|
443 |
+
* Admin notice - if WhatsApp number not added.
|
444 |
+
* Updated Style-4
|
445 |
+
|
446 |
+
= 2.8.5 =
|
447 |
+
* Style-2, Style-3 Improved.
|
448 |
+
* Updated: Show/Hide Settings
|
449 |
+
* Updated: Hide based on device (Mobile, Desktop)
|
450 |
+
* Updated: Customize Styles
|
451 |
+
* Updated: Style-5
|
452 |
+
* Updated: Style-7
|
453 |
+
* Fix: '&' symbol at prefilled message
|
454 |
+
* Fix: Style-1 if no Call to Action
|
455 |
+
|
456 |
+
= 2.8.4 =
|
457 |
+
* Updated: WhatsApp number at page level settings
|
458 |
+
* Updated: Display Styles after WhatsApp Number is added.
|
459 |
+
* Updated: Shortcode number attribute
|
460 |
+
|
461 |
= 2.8.3 =
|
462 |
* Fix: Cache issue - Hide based on device - now detects based on screen size
|
463 |
|