From ee28f8b43467437db5a136789ebec010ccecf7f1 Mon Sep 17 00:00:00 2001 From: CodeShakingSheep <19874562+CodeShakingSheep@users.noreply.github.com> Date: Tue, 9 Jan 2024 23:53:56 +0100 Subject: [PATCH] Make floating popup work with self-hosted instance --- inc/class.embed.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/inc/class.embed.php b/inc/class.embed.php index 2e758cd..2e1176a 100644 --- a/inc/class.embed.php +++ b/inc/class.embed.php @@ -36,7 +36,7 @@ private function embed($atts): string $output .= ''; break; case 3: - $output = $this->get_floating_popup_embed_script($atts['url'], $atts['text']); + $output = $this->get_floating_popup_embed_script($atts['url'], $atts['text'], $atts['customCalInstance']); break; default: $output = '
'; @@ -77,14 +77,22 @@ public function get_inline_embed_script($url, $custom_cal_url): string * * @param $url Booking link * @param $text Button text + * @param $custom_cal_url Custom cal.com URL (if self-hosted instance is used) * @return string */ - public function get_floating_popup_embed_script($url, $text): string + public function get_floating_popup_embed_script($url, $text, $custom_cal_url): string { $button_text = strlen($text) > 0 ? '"buttonText":"' . $text . '"' : ''; $script = '';