This option allows you to save and restore all current theme settings using your host's WordPress
database. Your options will be
preserved across Aspen theme upgrades, as well when you change to different themes. There is only one
saved backup avaiable. You can also download your setting to your computer with the options below.
Note: This save option saves all settings, including those marked with a ♦.
Possible Non-Standard Web Host Configuration detected. If your options
are not saving correctly, your host may have limited the default number of values that PHP can use for
settings. Try saving your settings again, and if this message persists, please contact your host and ask them to "Increase the PHP max_input_vars value for $_POST to at least 600." If that does not fix the issue,
please contact Aspen support. (diagnostic info: last_option="").
$last";
}
}
function aspen_process_options_admin_standard() {
if (aspen_submitted('reset_aspen')) {
if (! current_user_can('manage_options'))
wp_die('You do not have the capability to do that.');
// delete everything!
aspen_save_msg(aspen_t_('All Aspen settings have been reset to the defaults.','aspen'));
delete_option( apply_filters('aspen_options','aspen_settings') );
global $aspen_opts_cache;
$aspen_opts_cache = false; // clear the cache
aspen_init_opts('reset_aspen');
update_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice', 0 ); // reset the dismiss on the plugin loader
}
if (aspen_submitted('uploadtheme') && function_exists('aspen_loadtheme')) {
aspen_loadtheme();
}
if (aspen_submitted('check_aspen')) {
// perform Aspen check
require_once('check-theme.php'); // include check code now
aspen_perform_check();
}
}
function aspen_saverestore(){
/* admin tab for saving and restoring theme */
$aspen_theme_dir = esc_url(aspen_f_uploads_base_dir() .'aspen-theme/');
$download_path = esc_url(aspen_relative_url('includes/download.php'));
$download_img_path = esc_url(aspen_relative_url('images/icons/download.png'));
$nonce = wp_create_nonce('aspen_download');
$a_pro = (function_exists('aspen_pro_plugin_installed')) ? '-pro' : '';
?>
This option allows you to save and restore all current theme settings by uploading and downloading to your
own computer.
Download Current Settings To Your Computer
Download - All current settings to file aspen-backup-settings.abu on your computer. (Full settings backup, including those marked with a ♦.)
Download - Only theme related current settings to file aspen-theme-settings.ath on your computer.
Note: Downloaded settings include Aspen Pro settings. Setting files from Aspen Pro can be uploaded to the Free Aspen version,
but will not be used or saved by the free version."
?>
";
$ok = false;
}
if ($ok && $ext_check != 'ath' && $ext_check != 'abu'){
$errors[] = "Theme files must have .ath or .abu extension.
";
$ok = false;
}
if ($ok) {
if (!aspen_f_exists($openname)) {
$errors[] = 'Sorry, there was a problem uploading your file.
You may need to check your folder permissions or other server settings.'.
"
(Trying to use file '$openname')";
$ok = false;
}
}
if (!$ok) {
echo 'ERROR
';
foreach($errors as $error){
echo $error.'
';
}
echo '
';
} else { // OK - read file and save to My Saved Theme
// $handle has file handle to temp file.
$contents = aspen_f_get_contents($openname);
if (!aspen_ex_set_current_to_serialized_values($contents,'aspen_uploadit:'.$openname)) {
echo 'Sorry,
there was a problem uploading your file. The file you picked was not a valid
Aspen theme file.
';
} else {
aspen_save_msg('Aspen theme options reset to uploaded theme.');
}
}
}
function aspen_ex_set_current_to_serialized_values($contents) {
global $aspen_opts_cache; // need to mess with the cache
if (substr($contents,0,10) == 'ATH-V01.00')
$type = 'theme';
else if (substr($contents,0,10) == 'ABU-V01.00')
$type = 'backup';
else
return aspen_f_fail(aspen_t_("Wrong theme file format version" /*a*/ )); /* simple check for one of ours */
$restore = array();
$restore = unserialize(substr($contents,10));
if (!$restore) return aspen_f_fail("Unserialize failed");
$version = aspen_getopt('aspen_version_id'); // get something to force load
if ($type == 'theme') {
// need to clear some settings
// first, pickup the per-site settings that aren't theme related...
$new_cache = array();
foreach ($aspen_opts_cache as $key => $val) {
if ($key[0] == '_') // these are non-theme specific settings
$new_cache[$key] = $val; // keep
}
$opts = $restore['aspen_base']; // fetch base opts
aspen_delete_all_options();
foreach ($opts as $key => $val) {
if ($key[0] != '_')
aspen_setopt($key, $val, false); // overwrite with saved theme values
}
foreach ($new_cache as $key => $val) { // set the values we need to keep
aspen_setopt($key,$val,false);
}
} else if ($type == 'backup') {
aspen_delete_all_options();
$opts = $restore['aspen_base']; // fetch base opts
foreach ($opts as $key => $val) {
aspen_setopt($key, $val, false); // overwrite with saved values
}
}
aspen_setopt('aspen_version_id',$version); // keep version, force save of db
aspen_setopt('last_option','Aspen');
aspen_save_opts('loading theme'); // OK, now we've saved the options, update them in the DB
return true;
}
?>