fixed error with automatically adding _name to option

This commit is contained in:
asus
2024-04-03 14:21:33 +02:00
parent 8ac16dc1f4
commit d2b2967218
2 changed files with 29 additions and 17 deletions

View File

@@ -35,9 +35,10 @@ function add_plugin_content_CIPF() {
* options
*
*/
$option_paypal = Plgntls::get_option_safe($option_paypal_object);
$option_payment = Plgntls::get_option_safe($option_payment_object);
$option_emails = Plgntls::get_option_safe($option_emails_object);
$option_paypal = Plgntls::get_option_safe($option_paypal_object, true);
$option_payment = Plgntls::get_option_safe($option_payment_object, true);
//delete_option($option_emails_object['_name']);
$option_emails = Plgntls::get_option_safe($option_emails_object, true);
ob_start();
include(Plgntls::root_path() . '/html/menu/cipf_menu.html');
@@ -171,13 +172,15 @@ function update_emails_settings_option_CIPF($request, $option_name, $option_data
//error_log("option_data bedore: " . json_encode($option_data));
foreach ($option_data as $email_type => $email_options) {
//error_log("email_type: " . $email_type);
if ($email_type === '_name') {
continue;
}
$ret_email = update_email_by_type_CIPF($email_type, $email_options, $request);
if ($ret_email !== false) {
$option_data[$email_type] = $ret_email;
}
// if ($email_type === '_name') {
// continue;
// }
// $ret_email = update_email_by_type_CIPF($email_type, $email_options, $request);
// if ($ret_email !== false) {
// $option_data[$email_type] = $ret_email;
// }
$option_data[$email_type] = update_email_by_type_CIPF($email_type, $email_options, $request);
}
//error_log("option_data after : " . json_encode($option_data));
@@ -193,9 +196,9 @@ function update_emails_settings_option_CIPF($request, $option_name, $option_data
function update_email_by_type_CIPF($email_type, $email_options, $request) {
Plgntls::debug_infos();
//error_log("email type: " . $email_type);
if ($email_type === '_name') {
return false;
}
//if ($email_type === '_name') {
// return false;
//}
/*
* set notification/confirmation_send to false by default,