';
}
/**
* Check token with all the possibilities
*/
public static function checkToken()
{
$token = Security::getVar('cmd', '_wpnonce');
if (!wp_verify_nonce($token, 'acycnonce')) {
die('Invalid Token');
}
}
public static function getFormToken()
{
$token = Security::getVar('cmd', '_wpnonce', '');
if (empty($token)) {
$token = wp_create_nonce('acycnonce');
}
Security::setVar('_wpnonce', $token);
return '_wpnonce='.$token;
}
public static function noTemplate($component = true)
{
return 'noheader=1';
}
public static function isNoTemplate()
{
return Security::getVar('cmd', 'noheader') == '1';
}
public static function setNoTemplate($status = true)
{
if ($status) {
Security::setVar('noheader', '1');
} else {
unset($_REQUEST['noheader']);
}
}
/**
* @param bool $token
* @param string $task
* @param string $currentStep
* @param string $currentCtrl
* @param bool $addPage
*/
public static function formOptions($token = true, $task = '', $currentStep = null, $currentCtrl = '', $addPage = true)
{
if (!empty($currentStep)) {
echo '';
}
echo '';
echo '';
if ($addPage) {
echo '';
}
echo '';
if ($token) {
Form::formToken();
}
echo '';
}
public static function includeHeaders()
{
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Not our hook
do_action('head');
}
public static function checked(bool $checked, bool $current = true, bool $display = true): string
{
return checked($checked, $current, $display);
}
public static function selected(bool $selected, bool $current = true, bool $display = true): string
{
return selected($selected, $current, $display);
}
public static function disabled(bool $disabled, bool $current = true, bool $display = true): string
{
return disabled($disabled, $current, $display);
}
}