Function Reference: geodir_resave_settings

Summary

Handle the plugin settings for plugin deactivate to activate.

Description

It manages the the settings without loosing previous settings saved when plugin
status changed from deactivate to activate.

Parameters

$settings
(array) (required) The option settings array.

Default: None

Return Values

(array)
  • The settings array.

Change Log

Since: 1.6.9

Source File

geodir_resave_settings() is located in geodirectory-admin/admin_hooks_actions.php [Line: 2481]

Source Code

function geodir_resave_settings($settings = array()) {
    if (!empty($settings) && is_array($settings)) {
        $c = 0;
        
        foreach ($settings as $setting) {
            if (!empty($setting['id']) && false !== ($value = get_option($setting['id']))) {
                $settings[$c]['std'] = $value;
            }
            $c++;
        }
    }

    return $settings;
}