$value) { $key = sanitize_text_field($key); $value = sanitize_text_field($value); $id = str_replace('atkp_caption_', '', $key); $id = str_replace('atkp_name_', '', $id); $id = str_replace('atkp_type_', '', $id); $id = str_replace('atkp_format_', '', $id); $checkit = 0; $add = 1; $udf = new atkp_udfield(); $udf->id = $id; foreach($fields as $field) { if($field->id == $udf->id) { $udf = $field; $add = 0; break; } } if($this->substr_startswith($key, 'atkp_caption')) { $checkit = 1; $udf->caption = $value; } else if($this->substr_startswith($key, 'atkp_name')) { $checkit = 1; $udf->name = $value; } else if($this->substr_startswith($key, 'atkp_type')) { $checkit = 1; $udf->type = $value; } else if($this->substr_startswith($key, 'atkp_format')) { $checkit = 1; $udf->format = $value; } if($checkit && $add) { array_push($fields, $udf); } } foreach($fields as $field) { $field->name = sanitize_title($field->name, $field->id); } ATKPTools::set_setting(ATKP_PLUGIN_PREFIX.'_udf_product', $fields); ATKPTools::set_setting(ATKP_PLUGIN_PREFIX.'_product_manufacturer_taxonomy', ATKPTools::get_post_parameter(ATKP_PLUGIN_PREFIX.'_product_manufacturer_taxonomy', 'string')); ATKPTools::set_setting(ATKP_PLUGIN_PREFIX.'_product_brand_taxonomy', ATKPTools::get_post_parameter(ATKP_PLUGIN_PREFIX.'_product_brand_taxonomy', 'string')); ATKPTools::set_setting(ATKP_PLUGIN_PREFIX.'_product_author_taxonomy', ATKPTools::get_post_parameter(ATKP_PLUGIN_PREFIX.'_product_author_taxonomy', 'string')); if(atkp_options::$loader->get_productgroups_enabled()) ATKPTools::set_setting(ATKP_PLUGIN_PREFIX.'_product_category_taxonomy', ATKPTools::get_post_parameter(ATKP_PLUGIN_PREFIX.'_product_category_taxonomy', 'string')); $taxonomies = array(); foreach($_POST as $key => $value) { $key = sanitize_text_field($key); $value = sanitize_text_field($value); $id = str_replace('atkp_tax_caption_', '', $key); $id = str_replace('atkp_tax_name_', '', $id); $id = str_replace('atkp_tax_plural_', '', $id); $checkit = 0; $add = 1; $udf = new atkp_udtaxonomy(); $udf->id = $id; foreach($taxonomies as $field) { if($field->id == $udf->id) { $udf = $field; $add = 0; break; } } if($this->substr_startswith($key, 'atkp_tax_caption')) { $checkit = 1; $udf->caption = $value; } else if($this->substr_startswith($key, 'atkp_tax_name')) { $checkit = 1; $udf->name = $value; } else if($this->substr_startswith($key, 'atkp_tax_plural')) { $checkit = 1; $udf->captionplural = $value; } if($checkit && $add) { array_push($taxonomies, $udf); } } foreach($taxonomies as $field) { $field->name = sanitize_title($field->name, $field->id); } ATKPTools::set_setting(ATKP_PLUGIN_PREFIX.'_udt_product', $taxonomies); } $mytab = ATKPTools::get_get_parameter( 'tab', 'int'); if ($mytab != 0 ) $tab = $mytab; else $tab = 1; ?>