post->ID; } function php_console_log($data) { $output = $data; if (is_array($output)) { $output = implode(',', $output); } echo ""; } function current_url() { return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; } function redirect($url, $statusCode = 303) { header('Location: ' . $url, true, $statusCode); die(); } function connect_to_server($server) { if ($server == 'zinomedia') { return new wpdb('pkrstarsbot','ichpkrstarsbot#1337','pkrstarsbot','localhost'); } } function generateHiddenInputsFromArray( $data = array(), $namePrefix = '' ) { if(!is_array($data) || empty($data)) { return ''; } $html = ""; $namePrefix = trim($namePrefix); if ( is_array( $data ) && !empty($data) ) { foreach ( $data as $key => $value) { $keyEsc = htmlentities($key); if($namePrefix != '') { $keyEsc = $namePrefix."[{$keyEsc}]"; } if(is_array($value)) { $html .= generateHiddenInputsFromArray($value,$keyEsc); } else { $valueEsc = htmlentities($value); $html .= "".PHP_EOL; } } } return $html; } } } $ob = new HelperFunctions(); $ob->declareGlobalsFn();