diff options
Diffstat (limited to 'actions/profile/fields/delete.php')
| -rw-r--r-- | actions/profile/fields/delete.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/actions/profile/fields/delete.php b/actions/profile/fields/delete.php index 38d8b8379..9879feb3f 100644 --- a/actions/profile/fields/delete.php +++ b/actions/profile/fields/delete.php @@ -2,12 +2,11 @@ /** * Elgg profile plugin edit default profile action removal * - * @package ElggProfile */ $id = get_input('id'); -$fieldlist = get_plugin_setting('user_defined_fields', 'profile'); +$fieldlist = elgg_get_config('profile_custom_fields'); if (!$fieldlist) { $fieldlist = ''; } @@ -16,9 +15,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')); |
