wip prevent post publish if wrong coordinates

This commit is contained in:
lenovo
2022-11-08 21:00:05 +01:00
parent cfc747bad3
commit 73d988eb6a
4 changed files with 157 additions and 41 deletions

View File

@@ -1,8 +1,25 @@
<?php
// https://stackify.com/how-to-log-to-console-in-php/
function mp_console_log($output) {
$js_code = 'console.log(' . json_encode($output, JSON_HEX_TAG) . ');';
$js_code = '<script>' . $js_code . '</script>';
echo $js_code;
$time = date('H:i');
$file = '/var/www/html/wp-debug.log';
file_put_contents($file, $time . " " . $output . "\n", FILE_APPEND);
}
// function mp_console_log($output) {
// $js_code = 'console.log(' . json_encode($output, JSON_HEX_TAG) . ');';
// $js_code = '<script>' . $js_code . '</script>';
// echo $js_code;
// }
// function mp_console_log($output, $with_script_tags = true) {
// $js_code = 'console.log(' . json_encode($output, JSON_HEX_TAG) .
// ');';
// if ($with_script_tags) {
// $js_code = '<script>' . $js_code . '</script>';
// }
// echo $js_code;
// }
?>