PluginProbe
ووسلام – همگام سازی ووکامرس و باسلام / trunk
ووسلام – همگام سازی ووکامرس و باسلام vtrunk
1.10.17 1.10.15 1.10.14 1.10.13 1.10.12 1.10.10 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2 1.10.1 1.10.0 1.9.2 1.9.1 1.9.0 1.8.8 1.8.5 1.8.6 1.8.7 1.8.4 1.7.6 All 50 releases
sync-basalam / includes / Utilities / ChatWidget.php

ChatWidget.php in ووسلام – همگام سازی ووکامرس و باسلام trunk, at includes/Utilities/ChatWidget.php

28 lines 633 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace SyncBasalam\Utilities;
4
5 use SyncBasalam\Admin\Settings\SettingsConfig;
6
7 defined('ABSPATH') || exit;
8
9 class ChatWidget
10 {
11 public static function shouldLoadWidget()
12 {
13 $token = syncBasalamSettings()->hasToken();
14 if (!$token) return false;
15
16 return true;
17 }
18
19 public static function addTokenToWidgetScript($tag, $handle, $src)
20 {
21 if ($handle !== 'basalam-chat-widget-script') return $tag;
22
23 $token = syncBasalamSettings()->getSettings(SettingsConfig::TOKEN);
24
25 return sprintf('<script src="%s" token="%s"></script>', esc_url($src), esc_attr($token));
26 }
27 }
28