option_value('posttypes'); if (!is_array($posttypes)) { $posttypes = array(); } if (!is_singular($posttypes)) { $is_deactivated = true; } } // deactivate display of the functions if ($is_deactivated) { return; } essb_click2chat_draw(); } function essb_click2chat_draw($settings = array()) { global $post; $shortcode_call = false; $click2chat_text = essb_option_value('click2chat_text'); $click2chat_bgcolor = essb_option_value('click2chat_bgcolor'); $click2chat_color = essb_option_value('click2chat_color'); $click2chat_icon = essb_option_value('click2chat_icon'); $click2chat_location = essb_option_value('click2chat_location'); $click2chat_welcome_text = essb_option_value('click2chat_welcome_text'); if ($click2chat_bgcolor != '' || $click2chat_color != '') { echo ''; } if (isset($settings['shortcode'])) { $shortcode_call = true; $button_text = isset($settings['text']) ? $settings['text'] : $click2chat_text; $button_background = isset($settings['background']) ? $settings['background'] : $click2chat_bgcolor; $button_color = isset($settings['color']) ? $settings['color'] : $click2chat_color; $button_icon = isset($settings['icon']) ? $settings['icon'] : $click2chat_icon; $button_align = isset($settings['align']) ? $settings['align'] : 'left'; if ($button_background != '' || $button_color != '') { echo ''; } } if ($click2chat_location == '') { $click2chat_location = 'right'; } if ($click2chat_text == '') { $click2chat_text = __('Chat With Us', 'essb'); } if ($shortcode_call) { if ($button_text != '') { $click2chat_text = $button_text; } } if ($click2chat_icon == '') { $click2chat_icon = 'comments'; } if ($shortcode_call) { if ($button_icon != '') { $click2chat_icon = $button_icon; } } if ($shortcode_call) { echo '
'; } echo '
'; echo ''.$click2chat_text.''; echo '
'; if ($shortcode_call) { echo '
'; } echo '
'; echo '
'; echo ''; if ($click2chat_welcome_text != '') { echo '
'; echo $click2chat_welcome_text; echo '
'; } echo '
'; echo '
'; for ($i=1;$i<=4;$i++) { $operator = 'click2chat_operator'.$i.'_'; if (essb_option_bool_value($operator.'active')) { $name = essb_option_value($operator.'name'); $title = essb_option_value($operator.'title'); $number = essb_option_value($operator.'number'); $app = essb_option_value($operator.'app'); $image = essb_option_value($operator.'image'); $text = essb_option_value($operator.'text'); if ($app == '') { $app = 'whatsapp'; } if ($image == '') { $image = ' '; } else { $image = ''; } if ($text != '' && isset($post)) { $url = get_permalink(); $title_plain = $post->post_title; $text = str_replace('[title]', $title_plain, $text); $text = str_replace('[url]', $url, $text); } echo '
'; echo '
'.$image.'
'; echo '
'; echo ''.$title.''; echo ''.$name.''; echo ''.($app == 'viber' ? 'Viber' : 'WhatsApp').''; echo '
'; echo '
'; } } echo '
'; echo '
'; } if (essb_option_bool_value('click2chat_activate')) { add_action('wp_footer', 'essb_click2chat_register'); } }