PK �:FZ�̖��P �P
readme.txtnu �[��� === Click to Chat - HoliThemes ===
Requires at least: 4.7
Tested up to: 6.7.1
Requires PHP: 5.6
Contributors: holithemes
Stable tag: 4.15
Tags: whatsapp, whatsapp business, click to chat, whatsapp chat, WooCommerce WhatsApp
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
WhatsApp Chat🔥. Let's make your Web page visitors contact you through 'WhatsApp', 'WhatsApp Business'. Add matching Widget✅
== Description ==
WhatsApp Chat. Let's make your Web page visitors contact you through "WhatsApp" or "WhatsApp Business" with a single click (WhatsApp Chat, Group).
[Demo](https://holithemes.com/plugins/click-to-chat/list-of-styles/) | [Documentation](https://holithemes.com/plugins/click-to-chat/) | [Support](https://holithemes.com/plugins/click-to-chat/support/) | [PRO](https://holithemes.com/plugins/click-to-chat/pricing/)
== WhatsApp Chat ==
Add 'WhatsApp' or 'WhatsApp Business' Number and let your website visitors contact you with a single click.
**📱 Mobile:** Open the WhatsApp Mobile App for a seamless connection.
**💻 Desktop:** Direct visitors to the WhatsApp Desktop App or Web WhatsApp page (web.whatsapp.com)
== 💎 Styles ==
Select a style that complements the design of your website.
* 8 pre-defined customizable styles/designs
* Add your own Image/GIF
* Custom Element/Design (convert any element to a WhatsApp Chat element)
* Shortcodes (Add WhatsApp button/icon with inline the content)
* Different Styles, Positions for Mobile, Desktop
* Choose a style and customize it to match the website's design
[list of Styles](https://holithemes.com/plugins/click-to-chat/list-of-styles/) | 🎨[Customize Styles](https://holithemes.com/plugins/click-to-chat/customize-styles/)
= 💡 Add Own Image =
Instead of selecting a pre-defined style, add any Image/Animated-image/GIF.
== 🌈 Custom Element ==
Convert any Element as a WhatsApp Chat Element by adding
* Class/ID name: 'ctc_chat' (or)
* Href/link: '#ctc_chat'
The custom design element will navigate to WhatsApp based on plugin settings (WhatsApp Number, pre-filled message, Analytics, .... ).
(e.g. menu item, button, image, link - just add ctc_chat as a class name)
[Custom Element](https://holithemes.com/plugins/click-to-chat/custom-element/)
== 🎉 Greetings Dialog ==
Encourage user participation by displaying the right message at the right time.
Add the greeting dialog text, Image/GIf, emojis with the rich text editor.
Font can well decorate with font size, font family, links, text color, text background color, bold, italic, list, alignment, and more.
* [Greetings-1](https://holithemes.com/plugins/click-to-chat/greetings-1/): Customizable Design
* [Greetings-2](https://holithemes.com/plugins/click-to-chat/greetings-2/): Content Specific Design
= 📝 Form Filling =
Get the necessary information from the website visitors before initiating the chat.
* Get an email notification when the user fills out the form.
* Call a webhook with the form data to integrate with other applications. Using integrations tools add data in Google Sheet, CRM and many more applications.
* Form data can be prefilled in the WhatsApp chat window.
PRO: [Greetings-Form](https://holithemes.com/plugins/click-to-chat/greetings-form/)
= 👥 Multi-Agent =
Add multiple WhatsApp chat accounts within a single Greetings dialog.
* We can set different time ranges for each agent. (24x7 or multiple time ranges for each day of the week).
* Offline Agents
* Chat when offline (display agent with next available time).
* Disable chat (display agent with next available time).
* Hide offline agents
PRO: [Multi-Agent](https://holithemes.com/plugins/click-to-chat/multi-agent)
= ⌛ Greetings Actions =
* **Click**: Displays Greetings when clicked on any element with the Class name: 'ctc_greetings'
* **ViewPort**: Displays Greetings When an element is in/reached viewport(25% margin) with the Class name: 'ctc_greetings_now' [PRO]
* **Time, Scroll** Display Greetings based on time, scroll [PRO]
[Actions](https://holithemes.com/plugins/click-to-chat/greetings-actions/)
== 🔴 Notification Badge ==
Get user attention by displaying a notification badge on the WhatsApp Chat element.
Customize the notification badge with the notification count, text color, background color, border color, and time delay to display the notification badge.
[Notification Badge](https://holithemes.com/plugins/click-to-chat/notification-badge/)
== ✳️ Position to Place ==
* Add WhatsApp at any position of the screen
(not limited to fixed positions).
* Different positions for Mobile and Desktop.
== ⏩ Pre-filled Message ==
Text that appears in the WhatsApp chat window when the user clicks on the WhatsApp.
Users can easily start the conversation.
Variables to change values dynamically
* **{site}** -> Website Title
* **{title}** -> Page Title
* **{url}** -> Web page URL
* **[url]** -> Web page full URL including query parameters
With these variables, we can understand from which page the user started WhatsApp chat.
[Pre-filled Message](https://holithemes.com/plugins/click-to-chat/pre-filled-message/)
== 🛍️ WooCommerce ==
== WooCommerce product pages ==
For WooCommerce, single product pages can overwrite the main setings to add a product specific message using dynamic variables.
* Pre-filled Message
* Call to Action
* Greetings Template, Content [PRO]
Additional variables, specific to WooCommerce single product page to change values dynamically
* **{product}** -> Product Name
* **{price}** -> Product Price (current price)
* **{regular_price}** -> Regular product price (without any sale)
* **{sku}** -> Stock keeping unit
For Shop, Cart, Checkout, and Account pages we can overwrite at page level settings
== Add WhatsApp - Single Product Pages ==
Add WhatsApp button or icon at WooCommerce single product pages.
* Before Main Content
* Before Product
* Before Product Summary
* Product Summary
* Before Add to Cart Form
* Before Cart Button
* After Cart Button
* After Add to Cart Form
* After Product
* After product summary
We can add dynamic variables for the Call to Action.
E.g. Buy {product}
{product} will be replaced with the product name for all product pages.
[Add WhatsApp Icon/Button in WooCommerce Product pages](https://holithemes.com/plugins/click-to-chat/add-whatsapp-in-woocommerce-single-product-pages/)
= Add WhatsApp - Shop Page =
Add WhatsApp to WooCommerce Products list (shop page, related products list)
[Shop page](https://holithemes.com/plugins/click-to-chat/whatsapp-chat-in-woocommerce-shop-page/)
== 📒 Page Level Settings ==
At the page level, we can overwrite the settings for each post. We can add a different Whatsapp Number, Prefilled Message, Call to Action for each post
(while editing the post, in the right sidebar 'Click to Chat' meta box)
* WhatsApp Number
* Call to Action
* Pre-filled Message
* Display Settings
PRO:
* Change Styles
* Time Delay
* Scroll Delay
* Greetings Template
* Greetings Header, Main, Bottom Content
[Page-level settings](https://holithemes.com/plugins/click-to-chat/change-values-at-page-level/)
== 📈 Analytics ==
Creates an Event when the user clicks on the WhatsApp Icon/button.
[Google Analytics](https://holithemes.com/plugins/click-to-chat/google-analytics/)
[Meta Pixel](https://holithemes.com/plugins/click-to-chat/facebook-pixel/)
[Google Ads Conversations](https://holithemes.com/plugins/click-to-chat/google-ads-conversion/)
== Webhooks ==
Connect other applications using Integrate, Automation tools like Zapier, IFTTT, Pipedream, etc.
[Webhooks](https://holithemes.com/plugins/click-to-chat/webhooks)
== ⭐ PRO ==
* Multi-Agent: Displays multiple WhatsApp chat accounts
* Set multiple time ranges for each agent's availability
* Hide offline agents or display agent when offline with next available time
* Random Numbers: Navigates to a random WhatsApp number from the predefined list
* Form: Get the necessary information from the website visitors, before initiating the chat
* Get an email notification when the user fills out the form.
* Use webhooks to send form data to external apps in real-time for seamless integration.
* Prefill WhatsApp messages with user-provided form data to streamline conversations
* Business hours: Offline/Online Settings
* Set business hours for a specific time range within a day, specific days in a week.
* Hide the widget during offline hours or automatically change the WhatsApp numbers and call to action.
* Display based on website visitor's country
* Webhooks - Dynamic variables
* {url} - Current page URL.
* {time} - Time user interacted with the WhatsApp Button/Icon.
* {number} - WhatsApp Number associated with the icon/button.
* Get values from url parameters by adding name with in single square brackets E.g. [gclid], [utm_source]
* Get values from cookies by adding the name with in double square brackets. E.g. [[cookie_name]]
* Get additional values at Google Analytics, Meta Pixel
* Get values from url parameters. E.g. [gclid], [utm_source]
* Get values from cookies. E.g. [[cookie_name]]
* Greetings Actions: (for all greeting dialogs: Greetings-1, Greetings-2, Form, Multi-agent)
* Display greetings dynamically based on user actions such as
* Time: Time spent on the page,
* Scroll: Page scroll percentage,
* Click: specific button clicks
* ViewPort: when an element becomes visible in the viewport.
* Position to place
* Fixed: Fixed position on the screen (default position)
* Absolute: Fixed position to the body content. (Moves when the user scrolls the page)
* Time Delay & Scroll Delay: Display WhatsApp widget after a specified time delay or once the user scrolls a certain percentage of the page.
* Display based on Website visitor's login status
* Page-level settings: Fine-tune WhatsApp button behavior for individual pages. Change styles, time delays, scroll delay, Greetings Template, and Greetings Content
* WooCommerce: Customize WhatsApp widget behavior specifically for WooCommerce pages
* Overwrite greetings template, Content for Single product pages.
* Overwrite settings for Shop, Checkout, and Account pages at page-level settings
🔆 [PRO](https://holithemes.com/plugins/click-to-chat/pricing/)
== 🎯 Localization ==
Click to Chat is Compatible with translation plugins. [WPML](https://wpml.org/), Polylang.
It is easy to set up different values for each language
* WhatsApp Number
* Call to Action
* Pre-filled Message
* Greetings Content
* Group ID
* Share Text
Setup for [WPML](https://holithemes.com/plugins/click-to-chat/translate-click-to-chat-settings-using-wpml-plugin/), [Polylang](https://holithemes.com/plugins/click-to-chat/translate-click-to-chat-settings-using-polylang-plugin/)
== 🚀 Performance ==
* Rich in features, but the site’s front end is very lightweight.
We highly concentrate on speed and performance.
== 👓 Display Settings ==
Show/Hide styles based on
* Post type
* Post Id
* Category name
* Device Type(Mobile, Desktop)
* WooCommerce single product pages
PRO:
* Time delay
* Scroll delay
* Selected time range in a day
* Selected Days in a week
* Website visitor login status
* Website visitor country
== ✅ Opt-in ==
Make the website users opt-in / accept consent before initiating the chat.
[Opt-in](https://holithemes.com/plugins/click-to-chat/opt-in/)
== ⛳ Shortcodes ==
Use shortcodes to instead a WhatsApp icon or button with inline the Post content, widget area.
change the default setting values using shortcode attributes - WhatsApp Number, Style, Pre-filled message, Call to Action.
= Chat Shortcodes =
[ht-ctc-chat]
To change the WhatsApp number use the 'number' attribute
[ht-ctc-chat number=915123456789]
[Shortcodes for Chat](https://holithemes.com/plugins/click-to-chat/shortcodes-chat/)
= Group =
Enable the Group chat feature and add WhatsApp Group id in the plugin settings.
Make it easy for your customers to join Whatsapp Group.
[Group](https://holithemes.com/plugins/click-to-chat/group-chat-feature/)
= Share =
Let users share your website with their WhatsApp contacts and get more leads.
[Share](https://holithemes.com/plugins/click-to-chat/share-feature/)
= 🌏 Help Translate The Plugin =
Help by [Translating the plugin](https://translate.wordpress.org/projects/wp-plugins/click-to-chat-for-whatsapp/) to be available in more languages
== screenshots ==
1. 8 Styles, 1 Add your own image or GIF. Add at any position to the screen (Desktop, Mobile: can set different styles, positions)
1. Select a style and customize it to match your website design.
1. Chat Settings - Enter WhatsApp Number, prefilled message, call to action, desktop: web view / desktop app view
1. Style, position to place (at any position of the screen) - Desktop, Mobile
1. Add WhatsApp Menu item (Custom Element)
1. Change Values at the page level: 'WhatsApp Number', 'Call to action', 'Group ID'
1. Style - 5 - Image with content box
1. Style - 8 - Materialize button
1. Style - 99 - Add your own Image / GIF(Animated Image)
1. Customize Styles
1. Enable Group, Share Settings
1. Group settings page
1. Share settings page
1. Display settings
1. Webhooks
1. prefilled, call to action for WooCommerce single product pages
1. Animations
1. Analytics - Google Analytics, Meta Pixel, Google Ads Conversations
== Installation ==
= From Dashboard ( WordPress admin ) =
* plugins -> Add New
* search for 'click to chat'
* click on Install Now and then Activate.
= using FTP or similar =
* Unzip "Click-to-Chat" file and
* Upload "Click-to-Chat" folder to the "/wp-content/plugins/" directory.
* Activate the plugin through the "Plugins" menu in WordPress.
== Frequently Asked Questions ==
= WhatsApp Number =
Enter the WhatsApp number with country code
E.g.
country code +1
number: 6123456789
** WhatsApp number: 16123456789 **
(WhatsApp Number)[https://holithemes.com/plugins/click-to-chat/whatsapp-number/]
= Pre-filled Message =
Text that appears in the WhatsApp chat window when the user clicks on the WhatsApp.
Add variables to change values dynamically
`
{url} -> Web page URL
{title} -> Page Title
{site} -> Website Title
`
E.g.
Hi {site}!!
I like to know more information about this {title}, {url}.
Variables for WooCommerce single product pages
`
{product} -> Product Name
{price} -> Product Price (current price might be the sale price/regular price)
{regular_price} -> Regular product price (with out any sale)
{sku} ->Stock keeping unit
`
E.g.
Hi {site}!!
Name:
I like to buy this {product}, {url}
With this prefilled text, we can know from which page the user started the conversation, the purpose of the contact, and their details
[Pre-filled Message](https://holithemes.com/plugins/click-to-chat/pre-filled-message/)
[Pre-filled Message for WooCommerce](https://holithemes.com/plugins/click-to-chat/woocommerce-single-product-pages/)
= Select Styles =
Select Styles/widget that matches the design
* customize the style to match the website design.
* Add your own Image/GIF
* Custom Element/Design (convert any element to a WhatsApp Chat element)
* Select differnt Styles for mobile, desktop to match the website design.
= Position to place the styles =
Add Styles at any position of the screen (not just fixed to selected positions).
*Position to place* settings
E.g.
> bottom-right corner:
bottom: 10px
right: 10px
> Center of the Screen (bottom-center)
bottom: 10px
right: 50%
> Center of the Screen (left-center)
bottom: 50%
right: 10px
Plugin supports all CSS units as the suffix. (px, %, rem,...)
[position to place](https://holithemes.com/plugins/click-to-chat/position-to-place/)
= GDPR =
"Click to Chat" don't collect any of the user data and don't use cookies.
User consent before starting the chat.
[Opt-in](https://holithemes.com/plugins/click-to-chat/opt-in/)
= Display only on selected countries =
[Display based on country](https://holithemes.com/plugins/click-to-chat/display-based-on-country/)
= Show/Hide on Selected pages/devices =
[Show only on selected pages](https://holithemes.com/plugins/click-to-chat/show-only-on-selected-pages/)
[Hide only on selected pages](https://holithemes.com/plugins/click-to-chat/hide-only-on-selected-pages/)
[Show/Hide on Mobile/Desktop](https://holithemes.com/plugins/click-to-chat/show-hide-on-mobile-desktop/)
= Localization: Change number, content for each language / page =
We can change values for each language if using WPML, Polylang for translation.
[Multilingual](https://holithemes.com/plugins/click-to-chat/multilingual/)
From WPML / Polylang Settings -> 'String Translations' and filter strings to 'Click to chat for WhatsApp' and change value based on language.
* User Input (Plugin Settings values): - 'Click to chat for WhatsApp'
* Admin strings (Plugin Settings) - text domain: 'click-to-chat-for-whatsapp'
[Page-level settings](https://holithemes.com/plugins/click-to-chat/change-values-at-page-level/)
= WhatsApp Group Invite/chat =
[Enable Group Feature](https://holithemes.com/plugins/click-to-chat/enable-group-feature/) Add [WhatsApp group id](https://holithemes.com/plugins/click-to-chat/find-whatsapp-group-id/) at plugin settings page. and let user join in WhatsApp Group.
= WhatsApp Share =
[Enable Share feature](https://holithemes.com/plugins/click-to-chat/enable-share-feature/) and let users share your website easily.
Add variables to change values dynamically
{url} -> Web page URL
{title} -> Page Title
{site} -> Website Title
Share Text - E.g.
> Checkout this Awesome page {title}, {url}
= AMP Compatibility =
Click to Chat is Compatible with (AMP)[https://wordpress.org/plugins/amp/] plugin. AMP won't load plugins JavaScript files so limited functionality available.
= 🔧 Basic Troubleshooting =
* Clear cache
* from Cache plugins
* Server side cache (some hosting providers adds cache functionality by default)
* CDN cache (Cache invalidation)
* Check Display settings
* (page level settings)[https://holithemes.com/plugins/click-to-chat/change-values-at-page-level/]
✍️ For any queries, please contact us.
= ❤️ Support / Contact =
For any issues with the plugin / suggestions:
* WordPress [new topic](https://wordpress.org/support/plugin/click-to-chat-for-whatsapp/#new-topic-0)
= ⭐️ Give Support =
If you like the plugin, support the developers by giving [5 star rating](https://wordpress.org/support/plugin/click-to-chat-for-whatsapp/reviews/#new-post)
Thank you so much in advance from "Click to Chat" Team
== Upgrade Notice ==
= using FTP or similar =
* Delete Click-to-Chat folder - your setting will not lost.
* unzip Click-to-Chat file and
* Upload "Click-to-Chat" folder to the "/wp-content/plugins/" directory.
* Activate the plugin through the "Plugins" menu in WordPress.
= From Dashboard ( WordPress admin ) =
* When a new version is released - we can see the 'update now' link at wp-admin -> plugins
* click on 'update now'
or
* since WordPress 5.5, If auto update for the plugin is enabled, the plugin will update automatically when a new version is released
After Activating the plugin, add a WhatsApp Number in the plugin settings.
== Changelog ==
= 4.15 =
* Fix: Page-level settings not working properly.
* Fix: Alignment issues at admin setting pages
= 4.14 =
* Enhancement: Show or hide the admin demo.
= 4.13 =
* Fix: Alignment issues at admin setting pages
= 4.12.1 =
* Fix: Hover effects for Style-7 Extend
* Fix: Dual lines issue for Style-8 with large call to action text
= 4.12 =
* Fix: Custom CSS Code block not allowing quotes at front end
= 4.11 =
* New: Custom CSS Code block.
= 4.10 =
* Fix: Page level display settings for WooCommerce single product page
= 4.9 =
* Fix: Display based on device not working as expected on iPad Pro
[Changelog](https://holithemes.com/plugins/click-to-chat/changelog/)PK �:FZ`d�� index.phpnu �[��� <?php
// Silence is golden.PK �:FZR1� � click-to-chat.phpnu �[��� <?php
/*
Plugin Name: Click to Chat
Plugin URI: https://wordpress.org/plugins/click-to-chat-for-whatsapp/
Description: Lets make your Web page visitors contact you through WhatsApp with a single click/tap
Version: 4.15
Author: HoliThemes
Author URI: https://holithemes.com/plugins/click-to-chat/
License: GPL2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: click-to-chat-for-whatsapp
*/
if ( ! defined( 'WPINC' ) ) {
die('dont try to call this directly');
}
// ctc - Version - update version at readme 'Stable tag'
if ( ! defined( 'HT_CTC_VERSION' ) ) {
define( 'HT_CTC_VERSION', '4.15' );
}
// define HT_CTC_PLUGIN_FILE
if ( ! defined( 'HT_CTC_PLUGIN_FILE' ) ) {
define( 'HT_CTC_PLUGIN_FILE', __FILE__ );
}
// define HT_CTC_PLUGIN_DIR
if ( ! defined( 'HT_CTC_PLUGIN_DIR' ) ) {
define( 'HT_CTC_PLUGIN_DIR', plugin_dir_path( HT_CTC_PLUGIN_FILE ) );
}
include_once 'common/class-ht-ctc-switch.php';PK �:FZ@��¢ � + new/admin/class-ht-ctc-admin-group-page.phpnu �[��� <?php
/**
* group settings page - admin
*
* group chat options ..
*
* @package ctc
* @subpackage admin
* @since 2.0
*/
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! class_exists( 'HT_CTC_Admin_Group_Page' ) ) :
class HT_CTC_Admin_Group_Page {
public function menu() {
add_submenu_page(
'click-to-chat',
'Group Chat/Invite',
'Group',
'manage_options',
'click-to-chat-group-feature',
array( $this, 'settings_page' )
);
}
public function settings_page() {
if ( ! current_user_can('manage_options') ) {
return;
}
?>
<div class="wrap ctc-admin-group-page">
<?php settings_errors(); ?>
<div class="row">
<div class="col s12 m12 xl8 options">
<form action="options.php" method="post" class="">
<?php settings_fields( 'ht_ctc_group_page_settings_fields' ); ?>
<?php do_settings_sections( 'ht_ctc_group_page_settings_sections_do' ) ?>
<?php submit_button() ?>
</form>
</div>
<!-- <div class="col s12 m12 xl6 ht-ctc-admin-sidebar">
</div> -->
</div>
</div>
<?php
}
public function settings() {
// main settings - options enable .. group, share ..
// chat options
register_setting( 'ht_ctc_group_page_settings_fields', 'ht_ctc_group' , array( $this, 'options_sanitize' ) );
add_settings_section( 'ht_ctc_main_page_settings_sections_add', '', array( $this, 'main_settings_section_cb' ), 'ht_ctc_group_page_settings_sections_do' );
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' );
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' );
add_settings_field( 'group_ctc_desktop', __( 'Style, Position', 'click-to-chat-for-whatsapp'), array( $this, 'group_ctc_device_cb' ), 'ht_ctc_group_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
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' );
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' );
}
public function main_settings_section_cb() {
?>
<h1>Group Chat/Invite</h1>
<?php
do_action('ht_ctc_ah_admin' );
}
// WhatsApp Group ID.
function group_id_cb() {
$options = get_option('ht_ctc_group');
$value = ( isset( $options['group_id']) ) ? esc_attr( $options['group_id'] ) : '';
?>
<div class="row">
<div class="input-field col s12">
<input name="ht_ctc_group[group_id]" value="<?= $value ?>" id="whatsapp_group_id" type="text" class="input-margin">
<label for="whatsapp_group_id"><?php _e( 'WhatsApp Group ID', 'click-to-chat-for-whatsapp' ); ?>.</label>
<p class="description"><?php _e( 'Enter WhatsApp Group ID. E.g. 9EHLsEsOeJk6AVtE8AvXiA', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/find-whatsapp-group-id/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
</div>
</div>
<?php
}
// call to action
function group_cta_cb() {
$options = get_option('ht_ctc_group');
$value = ( isset( $options['call_to_action']) ) ? esc_attr( $options['call_to_action'] ) : '';
?>
<div class="row">
<div class="input-field col s12">
<input name="ht_ctc_group[call_to_action]" value="<?= $value ?>" id="call_to_action" type="text" class="input-margin">
<label for="call_to_action"><?php _e( 'Call to Action', 'click-to-chat-for-whatsapp' ); ?></label>
<p class="description"> <?php _e( 'Text that appears along with WhatsApp icon/button', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/call-to-action/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
</div>
</div>
<?php
}
// device based settings - style, position
function group_ctc_device_cb() {
$options = get_option('ht_ctc_group');
$dbrow = 'ht_ctc_group';
$type = 'group';
include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-device-settings.php';
}
// show/hide
function group_show_hide_cb() {
$options = get_option('ht_ctc_group');
$dbrow = 'ht_ctc_group';
$type = 'group';
include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-show-hide.php';
}
function group_shortcode_cb() {
?>
<p class="description"><?php _e( 'Shortcodes for Group Chat', 'click-to-chat-for-whatsapp' ); ?>: [ht-ctc-group] - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/shortcodes-group/">more info</a></p>
<?php
}
/**
* Sanitize each setting field as needed
*
* @since 2.0
* @param array $input Contains all settings fields as array keys
*/
public function options_sanitize( $input ) {
if ( ! current_user_can( 'manage_options' ) ) {
wp_die( 'not allowed to modify - please contact admin ' );
}
$new_input = array();
foreach ($input as $key => $value) {
if ( is_array( $input[$key] ) ) {
// key: display
if ( function_exists('sanitize_textarea_field') ) {
$new_input[$key] = map_deep( $input[$key], 'sanitize_textarea_field' );
} else {
$new_input[$key] = map_deep( $input[$key], 'sanitize_text_field' );
}
} else {
if ( 'side_1_value' == $key || 'side_2_value' == $key || 'mobile_side_1_value' == $key || 'mobile_side_2_value' == $key ) {
$input[$key] = str_replace( ' ', '', $input[$key] );
if ( is_numeric($input[$key]) ) {
$input[$key] = $input[$key] . 'px';
}
if ( '' == $input[$key] ) {
$input[$key] = '0px';
}
$new_input[$key] = sanitize_text_field( $input[$key] );
} else {
$new_input[$key] = sanitize_text_field( $input[$key] );
}
}
// if( isset( $input[$key] ) ) {
// $new_input[$key] = sanitize_text_field( $input[$key] );
// }
}
// l10n
foreach ($input as $key => $value) {
if ( 'group_id' == $key || 'call_to_action' == $key ) {
do_action( 'wpml_register_single_string', 'Click to Chat for WhatsApp', $key.'__group', $input[$key] );
}
}
do_action('ht_ctc_ah_admin_after_sanitize' );
return $new_input;
}
}
$ht_ctc_admin_group_page = new HT_CTC_Admin_Group_Page();
add_action('admin_menu', array($ht_ctc_admin_group_page, 'menu') );
add_action('admin_init', array($ht_ctc_admin_group_page, 'settings') );
endif; // END class_exists checkPK �:FZ�ZT� � new/admin/components/number.phpnu �[��� <?php
/**
* number
*/
if ( ! defined( 'ABSPATH' ) ) exit;
$title = (isset($input['title'])) ? esc_attr($input['title']) : '';
$description = (isset($input['description'])) ? esc_attr($input['description']) : '';
$label = (isset($input['label'])) ? esc_attr($input['label']) : '';
$placeholder = (isset($input['placeholder'])) ? esc_attr($input['placeholder']) : '';
$min = (isset($input['min'])) ? esc_attr($input['min']) : '';
$parent_class = (isset($input['parent_class'])) ? $input['parent_class'] : '';
$attr = '';
if ('' !== $min) {
$attr .= " min=$min ";
}
?>
<div class="row ctc_component_number <?= $parent_class ?>">
<div class="input-field col s12">
<input name="<?= $dbrow ?>[<?= $db_key ?>]" type="number" <?= $attr ?> value="<?= $db_value ?>" placeholder="<?= $placeholder ?>"/>
<label for="pre_filled"><?= $label ?></label>
<p class="description"><?= $description ?></p>
</div>
</div>PK �:FZ u�� � new/admin/components/heading.phpnu �[��� <?php
/**
* @deprecated 4.15 favor of new/admin/components/content.php - $title
*/
if ( ! defined( 'ABSPATH' ) ) exit;
$title = (isset($input['title'])) ? $input['title'] : '';
$parent_class = (isset($input['parent_class'])) ? $input['parent_class'] : '';
?>
<div class="row ctc_component_heading <?= $parent_class ?>">
<p class="description ht_ctc_subtitle"><?php _e( $title, 'click-to-chat-for-whatsapp' ); ?> </p>
</div>PK �:FZM�rsM M * new/admin/components/collapsible_start.phpnu �[��� <?php
/**
* collapsible - start code
*
*/
if ( ! defined( 'ABSPATH' ) ) exit;
$title = (isset($input['title'])) ? esc_attr($input['title']) : '';
$description = (isset($input['description'])) ? $input['description'] : '';
$active = 'active';
$collapsible = (isset($input['collapsible'])) ? $input['collapsible'] : '';
if ('no' == $collapsible) {
$active = '';
}
$ul_class = (isset($input['ul_class'])) ? $input['ul_class'] : '';
?>
<ul class="collapsible <?= $ul_class ?>">
<li class="<?= $active ?>">
<div class="collapsible-header" id="showhide_settings"><?= $title ?>
<span class="right_icon dashicons dashicons-arrow-down-alt2"></span>
</div>
<div class="collapsible-body">
<?php
if ('' !== $description) {
?>
<p class="description"><?= $description; ?></p>
<br>
<?php
}PK �:FZw~t^ ^ ! new/admin/components/textarea.phpnu �[��� <?php
/**
* text
*/
if ( ! defined( 'ABSPATH' ) ) exit;
$title = (isset($input['title'])) ? $input['title'] : '';
$description = (isset($input['description'])) ? $input['description'] : '';
$label = (isset($input['label'])) ? $input['label'] : '';
$placeholder = (isset($input['placeholder'])) ? $input['placeholder'] : '';
$parent_class = (isset($input['parent_class'])) ? $input['parent_class'] : '';
?>
<div class="row ctc_component_textarea <?= $parent_class ?>">
<div class="input-field col s12">
<textarea name="<?= $dbrow ?>[<?= $db_key ?>]" style="min-height: 84px;" placeholder="<?= $placeholder ?>" id="pre_filled" class="materialize-textarea input-margin"><?= $db_value ?></textarea>
<label for="pre_filled"><?= $label ?></label>
<p class="description"><?= $description ?></p>
</div>
</div>PK �:FZ>�:�M M $ new/admin/components/editor_lite.phpnu �[���
<?php
/**
* editor
*
*
* $db_value is santized esc_attr - so call db again.. and reassing $db_value
*/
if ( ! defined( 'ABSPATH' ) ) exit;
$title = (isset($input['title'])) ? $input['title'] : '';
$description = (isset($input['description'])) ? $input['description'] : '';
$label = (isset($input['label'])) ? $input['label'] : '';
$placeholder = (isset($input['placeholder'])) ? $input['placeholder'] : '';
$parent_style = (isset($input['parent_style'])) ? $input['parent_style'] : '';
$parent_class = (isset($input['parent_class'])) ? $input['parent_class'] : '';
if ( ! function_exists( 'ctc_tinymce_add_font_sizes' ) ) {
function ctc_tinymce_add_font_sizes( $buttons ) {
array_unshift( $buttons, 'fontselect' );
array_unshift( $buttons, 'fontsizeselect' );
return $buttons;
}
}
add_filter( 'mce_buttons_2', 'ctc_tinymce_add_font_sizes' );
// db_value call again for editor. and santize using wp_kses
$db_value = ( isset( $options[$db_key]) ) ? $options[$db_key] : '';
if ( '' !== $db_value ) {
$allowed_html = wp_kses_allowed_html( 'post' );
$db_value = html_entity_decode(wp_kses($db_value, $allowed_html));
}
?>
<div class="row ctc_component_editor <?= $parent_class ?>" style="<?= $parent_style ?>">
<?php
if ( '' !== $title ) {
?>
<p class="description ht_ctc_subtitle" style="margin-top: 12px;"><?php _e( $title, 'click-to-chat-for-whatsapp' ); ?> </p>
<?php
}
?>
<?php
$content = $db_value;
$editor_id = $db_key;
$args = [
'textarea_name' => "$dbrow"."[$db_key]",
'textarea_rows' => 10,
'editor_height' => 150,
'media_buttons' => false,
'teeny' => false,
'tinymce' => array(
'toolbar1' => 'bold, link, italic, underline, forecolor, backcolor, fontsizeselect, fontselect, undo, redo, removeformat',
'toolbar2' => false,
'fontsize_formats' => "6px 8px 10px 12px 13px 14px 15px 16px 18px 20px 24px 28px 32px 36px",
)
];
wp_editor( $content, $editor_id, $args );
?>
<p class="description"><?= $description ?></p>
</div>PK �:FZr�,� new/admin/components/select.phpnu �[��� <?php
/**
* Color
*
*
* list - is an array of values.. adding direclty..
* list_cb - get from ht-h-list.php
*/
if ( ! defined( 'ABSPATH' ) ) exit;
$title = (isset($input['title'])) ? $input['title'] : '';
$description = (isset($input['description'])) ? $input['description'] : '';
$parent_class = (isset($input['parent_class'])) ? $input['parent_class'] : '';
$parent_id = (isset($input['parent_id'])) ? $input['parent_id'] : '';
// list
$list = [];
if (isset($input['list'])) {
$list = $input['list'];
} elseif (isset($input['list_cb'])) {
$list_cb = $input['list_cb'];
$lists_file = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/admin/components/list/ht-ctc-admin-list-page.php';
if ( is_file( $lists_file ) ) {
include_once $lists_file;
$lists_instance = HT_CTC_Admin_List_Page::instance();
$list = ( class_exists('HT_CTC_Admin_List_Page') && method_exists('HT_CTC_Admin_List_Page',$list_cb) ) ? $lists_instance->$list_cb() : [];
}
}
?>
<div class="row ctc_component_select <?= $parent_class ?>" id="<?= $parent_id ?>" style="margin:0;">
<?php
if ( '' !== $title ) {
?>
<p class="description"><?php _e( $title, 'click-to-chat-for-whatsapp' ); ?> </p>
<?php
}
?>
<div class="row">
<div class="input-field col s12">
<select name="<?= $dbrow ?>[<?= $db_key ?>]" class="">
<?php
foreach ($list as $k => $v) {
?>
<option value="<?= $k ?>" <?= $db_value == $k ? 'SELECTED' : ''; ?> ><?= $v ?></option>
<?php
}
?>
</select>
<p class="description"><?= $description ?></p>
</div>
</div>
</div>PK �:FZ��
�
new/admin/components/editor.phpnu �[���
<?php
/**
* editor
*
*
* $db_value is santized esc_attr - so call db again.. and reassing $db_value
*/
if ( ! defined( 'ABSPATH' ) ) exit;
$title = (isset($input['title'])) ? $input['title'] : '';
$description = (isset($input['description'])) ? $input['description'] : '';
$label = (isset($input['label'])) ? $input['label'] : '';
$placeholder = (isset($input['placeholder'])) ? $input['placeholder'] : '';
$parent_style = (isset($input['parent_style'])) ? $input['parent_style'] : '';
$parent_class = (isset($input['parent_class'])) ? $input['parent_class'] : '';
// function ctc_edit_quicktags( $qtInit, $editor_id = 'content' ) {
// $qtInit['buttons'] = 'strong,code,more,close';
// return $qtInit;
// }
// add_filter( 'quicktags_settings', 'ctc_edit_quicktags', 10, 2 );
// if ( ! function_exists( 'ctc_tiny_mce_toolbar_settings' ) ) {
// function ctc_tiny_mce_toolbar_settings( $args ) {
// $args['fontsize_formats'] = "6px 8px 10px 12px 13px 14px 15px 16px 18px 20px 24px 28px 32px 36px";
// return $args;
// }
// }
// add_filter( 'tiny_mce_before_init', 'ctc_tiny_mce_toolbar_settings' );
// if ( ! function_exists( 'ctc_tinymce_mce_buttons' ) ) {
// function ctc_tinymce_mce_buttons( $buttons ) {
// return $buttons;
// }
// }
// add_filter( 'mce_buttons', 'ctc_tinymce_mce_buttons' );
if ( ! function_exists( 'ctc_tinymce_mce_buttons_2' ) ) {
function ctc_tinymce_mce_buttons_2( $buttons ) {
$key = array_search( 'forecolor', $buttons );
// add after forecolor
if ( $key !== false && is_int( $key ) ) {
array_splice( $buttons, $key+1, 0, 'backcolor' );
}
// add at first
array_unshift( $buttons, 'fontselect' );
array_unshift( $buttons, 'fontsizeselect' );
return $buttons;
}
}
add_filter( 'mce_buttons_2', 'ctc_tinymce_mce_buttons_2' );
// db_value call again for editor. and santize using wp_kses
$db_value = ( isset( $options[$db_key]) ) ? $options[$db_key] : '';
if ( '' !== $db_value ) {
$allowed_html = wp_kses_allowed_html( 'post' );
// $allowed_html['iframe'] = array(
// 'src' => true,
// 'height' => true,
// 'width' => true,
// 'frameborder' => true,
// 'allowfullscreen' => true,
// 'title' => true,
// 'allow' => true,
// 'autoplay' => true,
// 'clipboard-write' => true,
// 'encrypted-media' => true,
// 'gyroscope' => true,
// 'picture-in-picture' => true,
// );
$db_value = html_entity_decode(wp_kses($db_value, $allowed_html));
}
?>
<div class="row ctc_component_editor <?= $parent_class ?>" style="<?= $parent_style ?>">
<p class="description ht_ctc_subtitle" style="margin-top: 2px;"><?php _e( $title, 'click-to-chat-for-whatsapp' ); ?> </p>
<?php
$content = $db_value;
$editor_id = $db_key;
$args = [
'textarea_name' => "$dbrow"."[$db_key]",
'textarea_rows' => 10,
'editor_height' => 250,
// 'media_buttons' => false,
'drag_drop_upload' => true,
'tinymce' => array(
'textarea_rows'=> 10,
'fontsize_formats' => "6px 8px 10px 12px 13px 14px 15px 16px 18px 20px 24px 28px 32px 36px",
'wordpress_adv_hidden' => false,
)
];
wp_editor( $content, $editor_id, $args );
?>
<p class="description" style="padding-left: 0.9rem;"><?= $description ?></p>
</div>PK �:FZ?IJ#� � '