2
0

fix(wp): 🐛 When URL is empty

This commit is contained in:
Baptiste Arnaud
2022-03-28 14:47:19 +02:00
parent 194a5fbae1
commit 84dda32b13
4 changed files with 18 additions and 6 deletions

View File

@ -25,6 +25,9 @@ class Typebot_Public
$url = str_starts_with(get_option('url'), 'https://typebot.io')
? 'https://viewer.typebot.io' . '/' . explode('/', get_option('url'))[3]
: get_option('url');
if (!$url) {
return;
}
if (
get_option('popup_included_pages') !== null &&
get_option('popup_included_pages') !== ''
@ -94,6 +97,9 @@ class Typebot_Public
$url = str_starts_with(get_option('url'), 'https://typebot.io')
? 'https://viewer.typebot.io' . '/' . explode('/', get_option('url'))[3]
: get_option('url');
if (!$url) {
return;
}
$chat_icon = get_option('chat_icon');
if (
get_option('chat_included_pages') !== null &&
@ -248,6 +254,9 @@ class Typebot_Public
$url = sanitize_text_field($attributes['url']);
}
}
if (!$url) {
return;
}
$container_id = 'typebot-container-' . $this->generateRandomString(4);
return '<script>' .