27 lines
548 B
PHP
27 lines
548 B
PHP
<?php
|
|
|
|
/**
|
|
* it means someone outside wp is accessing the file, in this case kill it.
|
|
*/
|
|
if (!defined('ABSPATH')) {
|
|
die('You can not access this file!');
|
|
}
|
|
|
|
/*
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
https://stackify.com/how-to-log-to-console-in-php/
|
|
*/
|
|
function console_log(...$outputs) {
|
|
if (CIPF_CONSOLE_OFF)
|
|
return;
|
|
foreach($outputs as $output)
|
|
{
|
|
$json_output = json_encode($output, JSON_HEX_TAG);
|
|
$js_code = '<script>console.log(' . $json_output . ');</script>';
|
|
echo $js_code;
|
|
}
|
|
}
|
|
|
|
|
|
?>
|