| 1 |
<?php |
| 2 |
require_once('AdoptDBConfig.php'); |
| 3 |
|
| 4 |
function Adp_wpbHook_javascript() |
| 5 |
{ |
| 6 |
?> |
| 7 |
<?php $idconsetimeto = AdpExecComand(null); ?> |
| 8 |
|
| 9 |
<script> |
| 10 |
let wind = window.top; |
| 11 |
|
| 12 |
let adoptMetaTag = wind.document.createElement("meta"); |
| 13 |
adoptMetaTag.name = "adopt-website-id"; |
| 14 |
|
| 15 |
adoptMetaTag.content = '<?php echo esc_attr($idconsetimeto) ?>'; |
| 16 |
wind.document.getElementsByTagName("head")[0].appendChild(adoptMetaTag); |
| 17 |
|
| 18 |
let adoptTag = wind.document.createElement("script"); |
| 19 |
adoptTag.type = "text/javascript"; |
| 20 |
adoptTag.charset = "utf-8"; |
| 21 |
adoptTag.async = true; |
| 22 |
adoptTag.src = `//tag.goadopt.io/injector.js?website_code=<?php echo esc_attr($idconsetimeto) ?>`; |
| 23 |
wind.document.getElementsByTagName("head")[0].appendChild(adoptTag); |
| 24 |
</script> |
| 25 |
<?php |
| 26 |
} |