From 37b3e5a2608b1abcc00efa2bd97671c49127ca3c Mon Sep 17 00:00:00 2001 From: clem Date: Mon, 24 Jun 2024 16:39:33 +0700 Subject: [PATCH 1/2] Statamic v5 fix code embed --- src/TrackingCodeTags.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TrackingCodeTags.php b/src/TrackingCodeTags.php index 2b2a078..279e48e 100644 --- a/src/TrackingCodeTags.php +++ b/src/TrackingCodeTags.php @@ -38,7 +38,7 @@ public function createLink(string $tag): string $output = ''; foreach($scripts as $script){ - $output .= $script; + $output .= $script['code']; } $output .= ''; return $output; From 69ba5fb47c395c46083f3d2f224e3d4c32fe803f Mon Sep 17 00:00:00 2001 From: clem Date: Thu, 25 Jul 2024 08:05:59 +0700 Subject: [PATCH 2/2] Support older version yaml files --- src/TrackingCodeTags.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/TrackingCodeTags.php b/src/TrackingCodeTags.php index 279e48e..7181db2 100644 --- a/src/TrackingCodeTags.php +++ b/src/TrackingCodeTags.php @@ -38,7 +38,11 @@ public function createLink(string $tag): string $output = ''; foreach($scripts as $script){ - $output .= $script['code']; + if (is_array($script)) { + $script = $script['code']; + } + + $output .= $script; } $output .= ''; return $output;