'', 'is_mobile' => 'checked', 'is_desktop' => 'checked', 'image_id' => '', 'title' => $social['title'], 'bg_color' => "", ]; } $is_pro = false; $disabled = ""; if(!$is_pro) { $disabled = "disabled"; } if (!isset($value['value'])) { $value['value'] = ""; } if (!isset($value['bg_color']) || empty($value['bg_color'])) { $value['bg_color'] = $social['color']; // Initialize background color value if not exists. 2.1.0 change } if($social['slug'] == "Twitter" && ($value['bg_color'] == "#1ab2e8" || $value['bg_color'] == "rgb(26, 178, 232)") ) { $value['bg_color'] = "#000000"; } $value['bg_color'] = $this->validate_color($value['bg_color'], $social['color']); if (!isset($value['image_id'])) { $value['image_id'] = ''; // Initialize custom image id if not exists. 2.1.0 change } if (!isset($value['title'])) { $value['title'] = $social['title']; // Initialize title if not exists. 2.1.0 change } if (!isset($value['fa_icon'])) { $value['fa_icon'] = ""; // Initialize title if not exists. 2.1.0 change } $is_agent = 0; $color = ""; if (!empty($value['bg_color'])) { $color = "background-color: ".esc_attr($value['bg_color']); // set background color of icon if exists } $value['value'] = esc_attr(wp_unslash($value['value'])); $value['title'] = esc_attr(wp_unslash($value['title'])); $svg_icon = $social['svg']; $help_title = ""; $help_text = ""; $help_link = ""; $channel_type = ""; $placeholder = $social['example']; if (empty($channel_type)) { $channel_type = $social['slug']; } // Check if the 'value' field is not empty if (!empty($value['value'])) { // Extract the social slug for readability $socialSlug = $social['slug']; } $chatwayIcons = $this->chatwayIcons; $positions = [ 'above-chaty' => esc_html__("An icon above Chaty’s icon", "chaty"), 'inside-chaty' => esc_html__("Show it as one of Chaty’s channel", "chaty"), 'outside-chaty' => esc_html__("Place manually from the Chatway settings", "chaty"), ]; if(isset($_REQUEST['position']) && isset($positions[$_REQUEST['position']])) { $value['chatway_position'] = esc_attr($_REQUEST['position']); } else { $addChatway = is_plugin_active('chatway-live-chat/chatway.php') ? true : false; $isChatwayAdded = get_option('cht_is_chatway_added', false); if ($addChatway && !$isChatwayAdded) { $value['chatway_position'] = 'outside-chaty'; } } if(isset($_GET['chaty_action']) && $_GET['chaty_action'] == 'add_chatway') { if(isset($_REQUEST['chatway_position']) && isset($positions[$_REQUEST['chatway_position']])) { $value['chatway_position'] = esc_attr($_REQUEST['chatway_position']); } } $chtPosition = isset($value['chatway_position'])?$value['chatway_position']:'above-chaty'; if(!isset($positions[$chtPosition])) { $chtPosition = 'above-chaty'; } $imgClass = ''; $imageId = $value['image_id']; if (!empty($value['fa_icon'])) { $imgClass = "icon-active"; $value['chatway_icon'] = 'custom-image'; } else if(!empty($imageId)) { $imageUrl = wp_get_attachment_image_src($imageId, "full")[0]; // get custom image URL if exists if ($imageUrl == "") { $value['chatway_icon'] = 'icon_1'; $imageUrl = CHT_PLUGIN_URL."admin/assets/images/chaty-default.png"; // Initialize with default image if custom image is not exists } else { $imgClass = "img-active"; } } $chtIcon = isset($value['chatway_icon'])?$value['chatway_icon']:'icon_1'; if($chtIcon != 'custom-image' && !isset($chatwayIcons[$chtIcon])) { $chtIcon = 'icon_1'; } if($chtIcon != 'custom-image') { $svg_icon = $chatwayIcons[$chtIcon]; } ?>
  • " data-channel="" id="chaty-social-">
    ">
    " id="chaty_image_">
    $icon) { ?> value="" name="cht_social_[chatway_icon]" id="chatway-custom-image" />
    Custom Image
    del_space($social['slug'])); $slug = str_replace(' ', '_', $slug); $is_desktop = isset($value['is_desktop']) && $value['is_desktop'] == "checked" ? "checked" : ''; $is_mobile = isset($value['is_mobile']) && $value['is_mobile'] == "checked" ? "checked" : ''; ?>
    " id="-close-btn" onclick="toggle_chaty_setting('')">
    ">