"1.1.0", "debug" => false, "env" => "prod", "buildid" => "PI9-LFO", "support_email" => "support@getallears.com" ); class AllEarsUtils { // Surprisingly WordPress does not have the next function. If you need to emit // HTML comments, the only thing you care about is to avoid anything that looks // like a comment closing "-->". As far as I understand it, WordPress has a lot // of functions to cleanup strings: // https://codex.wordpress.org/Validating_Sanitizing_and_Escaping_User_Data // But you either get functions that only touch "<" ("sanitize*"), or functions // that replace too much (including double quotes, all the "esc*"). So we need // to add this simple function ourselves... public static function sanitize_comment($text) { return str_replace(">", ">", $text); } public static function dbg($text) { if(ALLEARS_GLOBALS["debug"]) { echo "\n"; } } public static function format_comment($text) { return "\n"; } public static function emit_comment($text) { echo self::format_comment($text); } } add_action("admin_init", "allEars_admin_init");