'.$message.'
');
}
// Util function
function heroframe_display_error_message($message)
{
echo wp_kses_post('');
}
// Storage Util function
function heroframe_save_option_values($heroframe_keys_map)
{
//verify hero_button_clicked nonce
if (!isset($_POST['_wpnonce']) || !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['_wpnonce'])), 'hero_button_clicked')) {
heroframe_display_error_message('Error: Nonce Security check');
return;
}
//set all the values
foreach ($heroframe_keys_map as $key => $value) {
$val = santize_text_field($_POST[$value]);
heroframe_set_option_value($heroframe_keys_map, $key, $val);
}
}
// Storage Util function
function heroframe_get_option_value($heroframe_keys_map, $heroframe_defaults, $key)
{
$value = get_option($heroframe_keys_map[$key]);
if ($value == '') {
$value = $heroframe_defaults[$key];
}
return wp_kses_post($value);
}
// Storage Util function
function heroframe_set_option_value($heroframe_keys_map, $key, $value)
{
update_option($heroframe_keys_map[$key], sanitize_option($value));
}
function heroframe_verifyKeyString($string) {
// Check if the string is exactly 32 characters long
if (strlen($string) !== 32) {
return false;
}
// Check if the string contains only alphanumeric characters
if (!ctype_alnum($string)) {
return false;
}
// If both conditions pass, return true
return true;
}