function dt_geodir_delete_custom_field($htmlvar_name, $post_type) { global $wpdb; $id = $wpdb->get_var($wpdb->prepare("select id from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array($htmlvar_name, $post_type))); if ($id) { geodir_custom_field_delete($id); } }
$field_ids = $_REQUEST['licontainer']; echo godir_set_sort_field_order($field_ids); } /* ---- Show field form in admin ---- */ if ($field_type != '' && $field_id != '' && $field_action == 'new' && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') { geodir_custom_field_adminhtml($field_type, $field_id, $field_action); } if ($field_type != '' && $field_id != '' && $field_action == 'new' && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'sorting_options') { geodir_custom_sort_field_adminhtml($field_type, $field_id, $field_action); } /* ---- Delete field ---- */ if ($field_id != '' && $field_action == 'delete' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') { if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id)) { return; } echo geodir_custom_field_delete($field_id); } if ($field_id != '' && $field_action == 'delete' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'sorting_options') { if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id)) { return; } echo geodir_custom_sort_field_delete($field_id); } /* ---- Save field ---- */ if ($field_id != '' && $field_action == 'submit' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') { if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id)) { return; } foreach ($_REQUEST as $pkey => $pval) { if (is_array($_REQUEST[$pkey])) { $tags = 'skip_field';