aboutsummaryrefslogtreecommitdiff
path: root/actions/profile/fields/delete.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/profile/fields/delete.php')
-rw-r--r--actions/profile/fields/delete.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/actions/profile/fields/delete.php b/actions/profile/fields/delete.php
index 38d8b8379..26ab48cba 100644
--- a/actions/profile/fields/delete.php
+++ b/actions/profile/fields/delete.php
@@ -7,7 +7,7 @@
$id = get_input('id');
-$fieldlist = get_plugin_setting('user_defined_fields', 'profile');
+$fieldlist = elgg_get_config('profile_custom_fields');
if (!$fieldlist) {
$fieldlist = '';
}
@@ -16,9 +16,11 @@ $fieldlist = str_replace("{$id},", "", $fieldlist);
$fieldlist = str_replace(",{$id}", "", $fieldlist);
$fieldlist = str_replace("{$id}", "", $fieldlist);
-if (($id) && (clear_plugin_setting("admin_defined_profile_$id", 'profile')) &&
- (clear_plugin_setting("admin_defined_profile_type_$id", 'profile')) &&
- set_plugin_setting('user_defined_fields', $fieldlist, 'profile')) {
+if ($id &&
+ unset_config("admin_defined_profile_$id") &&
+ unset_config("admin_defined_profile_type_$id") &&
+ elgg_save_config('profile_custom_fields', $fieldlist)) {
+
system_message(elgg_echo('profile:editdefault:delete:success'));
} else {
register_error(elgg_echo('profile:editdefault:delete:fail'));