function userpro_sc_get_option($option) { $userpro_default_options = userpro_sc_default_options(); $settings = get_option('userpro_sc'); switch ($option) { default: if (isset($settings[$option])) { return $settings[$option]; } else { if (isset($userpro_default_options[$option])) { return $userpro_default_options[$option]; } } break; } }
function set_defaults($array, $extension = false) { $defaults = userpro_default_options(); if ($extension == 'social') { $defaults = userpro_sc_default_options(); } foreach ($array as $key) { userpro_set_option($key, $defaults[$key]); } }
function reset() { update_option('userpro_sc', userpro_sc_default_options()); $this->options = array_merge($this->options, userpro_sc_default_options()); echo '<div class="updated"><p><strong>' . __('Settings are reset to default.', 'userpro') . '</strong></p></div>'; }