function pcud_sorted_fields_indexes() { $data = pcud_get_sorted_fields(); $indexes = array(); foreach ($data as $term) { $indexes[] = $term->slug; } return $indexes; }
update_option('pcud_custom_fields_order', (array) $fdata['pcud_f_index']); update_option('pcud_fields_in_users_list', (array) $fdata['pcud_fields_in_users_list']); // update terms foreach ($fdata['pcud_f_index'] as $key => $fid) { $args = array('type' => $fdata['pcud_f_type'][$key], 'subtype' => $fdata['pcud_f_subtype'][$key], 'maxlen' => $fdata['pcud_f_maxlen'][$key], 'regex' => $fdata['pcud_f_regex'][$key], 'range_from' => $fdata['pcud_f_range_from'][$key], 'range_to' => $fdata['pcud_f_range_to'][$key], 'opt' => $fdata['pcud_f_options'][$key], 'placeh' => $fdata['pcud_f_placeh'][$key], 'multi_select' => $fdata['pcud_f_multi_select'][$key], 'check_txt' => $fdata['pcud_f_check_txt'][$key], 'disclaimer' => $fdata['pcud_f_disclaimer'][$key], 'note' => $fdata['pcud_f_note'][$key]); wp_update_term($fdata['pcud_f_id'][$key], 'pcud_fields', array('name' => $fdata['pcud_f_label'][$key], 'description' => base64_encode(serialize($args)))); } // WPML SYNC pcud_fields_wpml_sync($fdata); echo '<div class="updated"><p><strong>' . __('Fields saved', 'pcud_ml') . '</strong></p></div>'; } } else { $fdata = array(); $fdata['pcud_fields_in_users_list'] = (array) get_option('pcud_fields_in_users_list', array()); } $sorted_fields = pcud_get_sorted_fields(); ?> <div id="warning_wrap"></div> <form name="pcud_form" method="post" class="form-wrap" action="<?php echo admin_url(); ?> admin.php?page=pcud_fields_builder"> <div id="pcud_add_f_wrap" style="display: none;"> <h3 style="margin: 10px 0 0;"><?php _e('Add new field', 'pcud_ml'); ?> <small style="padding-left: 8px;">(<?php _e('field index must to be unique and cannot be changed', 'pcud_ml');