Skip to content

Commit da948a6

Browse files
use wp_print_inline_script tag for printing inline <script>, see #298
1 parent dd6909b commit da948a6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/class-script-loader.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ public static function print_js_object()
9898
// path to store the cookie in (will be subdirectory if website root is in subdirectory)
9999
'cookie_path' => self::get_cookie_path(),
100100
];
101-
echo '<script>window.koko_analytics = ', json_encode($script_config), ';</script>';
101+
$data = 'window.koko_analytics = ' . \json_encode($script_config) . ';';
102+
wp_print_inline_script_tag($data);
102103
}
103104

104105
public static function print_amp_analytics_tag()

0 commit comments

Comments
 (0)