add files
This commit is contained in:
36
template-parts/header/scripts.php
Normal file
36
template-parts/header/scripts.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<!--[header/scripts]-->
|
||||
|
||||
<script defer src="https://setka.media/scr/versioned/1/bundle.1-1-0.js"></script>
|
||||
|
||||
<link href="https://setka.media/scr/versioned/1/bundle.1-1-0.css" rel="stylesheet">
|
||||
|
||||
<script>
|
||||
function getCookie(name) {
|
||||
let matches = document.cookie.match(new RegExp(
|
||||
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
|
||||
));
|
||||
return matches ? decodeURIComponent(matches[1]) : undefined;
|
||||
}
|
||||
|
||||
|
||||
function setCookie(name, value, options = {}) {
|
||||
options = {
|
||||
path: '/',
|
||||
expires: 0
|
||||
};
|
||||
if (options.expires.toUTCString) {
|
||||
options.expires = options.expires.toUTCString();
|
||||
}
|
||||
let updatedCookie = encodeURIComponent(name) + "=" + encodeURIComponent(value);
|
||||
for (let optionKey in options) {
|
||||
updatedCookie += "; " + optionKey;
|
||||
let optionValue = options[optionKey];
|
||||
if (optionValue !== true) {
|
||||
updatedCookie += "=" + optionValue;
|
||||
}
|
||||
}
|
||||
document.cookie = updatedCookie;
|
||||
}
|
||||
</script>
|
||||
|
||||
<!--[/header/scripts]-->
|
||||
Reference in New Issue
Block a user