*/
wp_enqueue_media();
}
/**
* Output a global JS object in the <head> tag for the admin.
* Allow developers to add JS data for their project in the admin area only.
*/
public function adminHead()
{
$datas = apply_filters('themosisAdminGlobalObject', []);
$output = "<script type=\"text/javascript\">\n\r";
$output .= "//<![CDATA[\n\r";
$output .= "var themosisAdmin = {\n\r";
if (!empty($datas)) {
foreach ($datas as $key => $value) {
$output .= $key . ': ' . json_encode($value) . ",\n\r";
}
}
$output .= "};\n\r";
$output .= "//]]>\n\r";
$output .= '</script>';
// Output the datas.
echo $output;
}
}
}
/*
* Globally register the instance.
*/
$GLOBALS['themosis'] = Themosis::instance();