' . esc_html( $this->label ) . ''; if ( '' !== $this->description) { echo '' . $this->description . ''; } echo ''; echo '

' . __('Absolute Weaver Theme - Free version', 'absolute-weaver') . '

'; _e('Save all current core Absolute Weaver Theme settings to file on your computer. (Full settings backup, including those marked with ♦. Does NOT include Absolute Weaver Plus settings.) File:', 'absolute-weaver' /*adm*/); ?> aweaver-backup-settings.wxb



Save only theme related current settings to file on your computer. File: ', 'absolute-weaver'); ?> weaverx-theme-settings.wxt




' . __('Absolute Weaver Plus', 'absolute-weaver') . ABSOLUTE_WVR_PLUS_ICON . '

'; _e('Note: The previous download settings will include Absolute Weaver Plus settings values (if Absolute Weaver Plus is installed) along with the free version settings. The previous Save buttons do not include advanced Absolute Weaver Plus options like shortcodes or SmartMenu settings.', 'absolute-weaver' /*adm*/) . '

'; echo '

'; _e('Save ALL Settings - Basic Absolute Weaver, including ♦, ☆, and ★.', 'absolute-weaver' /*adm*/)?>

File: aweaver-settings-(timestamp).wxall


"; _e('Save Settings to Site Host Filesystem', 'absolute-weaver'); echo '

'; _e("You can also save and restore your settings to the Site's Host filesystem. Open the Appearance:Absolute Weaver Admin:Save/Restore tab to see the options to Save/Restore settings to the host filesystem. (requires free Weaver Theme Support Plugin)" , 'absolute-weaver'); } } static public function process_save( $wp_customize ) { if ( current_user_can( 'edit_theme_options' ) ) { if ( isset( $_REQUEST['wvrx_save'] ) ) { self::_save_settings( $wp_customize, $_REQUEST['wvrx_save'], 'wxt' ); } if ( isset( $_REQUEST['wvrx_save_all'] ) ) { self::_save_settings( $wp_customize, $_REQUEST['wvrx_save_all'], 'wxb' ); } if ( isset( $_REQUEST['wvrx_save_xplus'] ) ) { self::_save_settings( $wp_customize, $_REQUEST['wvrx_save_xplus'], 'wxall' ); } } } static private function _aweaver_filter_strip_default( $var ) { if (!is_string($var) ) return true; return strlen( $var ) && $var != 'default'; } static private function _save_settings( $wp_customize, $request, $ext ) { if (headers_sent()) { @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); wp_die(__('Headers Sent: The headers have been sent by another plugin - there may be a plugin conflict.', 'absolute-weaver' /*adm*/)); } if ( ! wp_verify_nonce( $request, 'wvrx-settings-saving' ) ) { return; } if ( $ext == 'wxall') { $time = date('Y-m-d-Hi'); $fn = 'weaverx-settings-' . $time . '.wxall'; $opt_func = ABSOLUTE_WVR_GET_OPTION; $aweaver_opts = $opt_func( apply_filters('aweaver_options',ABSOLUTE_WVR_SETTINGS_NAME) ,array()); $aweaverplus_opts = $opt_func('aweaverplus_settings' ,array()); $aweaver_opts = array_filter( $aweaver_opts, 'self::_aweaver_filter_strip_default' ); $aweaverplus_opts = array_filter( $aweaverplus_opts, 'self::_aweaver_filter_strip_default' ); $save = array(); $save['header'] = 'WVRX-PLUS1'; // format $save['ext'] = $ext; // the extension $save['aweaver'] = $aweaver_opts; $save['aweaverplus'] = $aweaverplus_opts; $absolute_wvr_settings = $save; } else { // free version save $base = 'aweaver-settings'; $a_pro = (function_exists('aweaverplus_plugin_installed')) ? '-plus' : ''; $opt_func = ABSOLUTE_WVR_GET_OPTION; $aweaver_opts = $opt_func( apply_filters('aweaver_options',ABSOLUTE_WVR_SETTINGS_NAME) ,array()); $aweaver_header = ''; $aweaver_save = array(); // @@@@@@@ $aweaver_opts['style_version'] = '1'; $aweaver_opts = array_filter( $aweaver_opts, 'self::_aweaver_filter_strip_default' ); unset( $aweaver_opts['wvrx_css_saved'] ); $aweaver_save['weaverx_base'] = $aweaver_opts; $a_pro = (function_exists('aweaverplus_plugin_installed')) ? '-plus' : ''; if ($ext == 'wxt') { $aweaver_header .= 'WVA-V01.00'; $fn = 'aweaver-theme-settings' . $a_pro . '.wxt'; foreach ($aweaver_opts as $opt => $val) { if ($opt[0] == '_') $aweaver_save['weaverx_base'][$opt] = false; } } else { $aweaver_header .= 'WVB-V01.00'; /* Save all settings: 10 byte header */ $fn = 'aweaver-backup-settings' . $a_pro . '.wxb'; } $absolute_wvr_settings = $aweaver_header . serialize($aweaver_save); /* serialize full set of options right now */ } // Set the download headers. header( 'Content-disposition: attachment; filename=' . $fn ); header( 'Content-Type: application/octet-stream; charset=utf-8'); // echo the export data. echo $absolute_wvr_settings; // Start the download. die(); } static public function enqueue_scripts() { // Register wp_register_style( 'wvrx-sr-css', get_template_directory_uri().'/admin/customizer/save-restore/save-restore'.ABSOLUTE_WVR_MINIFY.'.css', array(), ABSOLUTE_WVR_VERSION ); wp_register_script( 'wvrx-sr-js', get_template_directory_uri().'/admin/customizer/save-restore/save-restore'.ABSOLUTE_WVR_MINIFY.'.js', array( 'jquery' ), ABSOLUTE_WVR_VERSION, true ); // Localize wp_localize_script( 'wvrx-sr-js', 'WVRXl10n', array( 'emptyImport' => __( 'Please choose a file to import.', 'absolute-weaver' ) )); // Config wp_localize_script( 'wvrx-sr-js', 'WVRXConfig', array( 'customizerURL' => admin_url( 'customize.php' ), 'exportNonce' => wp_create_nonce( 'wvrx-settings-saving' ) )); // Enqueue wp_enqueue_style( 'wvrx-sr-css' ); wp_enqueue_script( 'wvrx-sr-js' ); } } endif; if ( class_exists( 'WP_Customize_Control' ) && ! class_exists( 'WeaverA_Restore_WV_Settings' ) ) : class WeaverA_Restore_WV_Settings extends WP_Customize_Control { public $description = ''; public $code; static private $wvrx_error = ''; /** */ public function render_content() { echo '' . esc_html( $this->label ) . ''; if ( '' !== $this->description) { echo '' . $this->description . ''; } ?>

'; return; } if (!aweaver_f_exists($openname)) { self::$wvrx_error = __('Sorry, there was a problem uploading your file. You may need to check your folder permissions or other server settings.', 'absolute-weaver' /*adm*/) . __('Trying to use file', 'absolute-weaver' /*adm*/) . $openname ; return; } // Get the upload data. $contents = aweaver_f_get_contents( $openname ); // Remove the uploaded file. unlink( $openname ); unset($FILES); if (!self::reset_options($contents, $ext_check)) return; // we will now redirect to the customizer so all settings are reloaded wp_redirect( home_url('/wp-admin/customize.php?return=%2Fwp-admin%2Fthemes.php%3Fpage%3DWeaverX') ); } static public function reset_options($contents, $ext) { if ($ext == 'wxall') { $version = aweaver_getopt('aweaver_version_id'); // get something to force load opts_cache aweaver_delete_all_options(); $restore = array(); $restore = unserialize($contents); $opts = $restore['aweaver']; // fetch base opts //if (isset($opts['fonts_added']) ) { // $opts['fonts_added'] = serialize($opts['fonts_added']); //} foreach ($opts as $key => $val) { aweaver_setopt($key, $val, false); // overwrite with saved values } aweaver_setopt('aweaver_version_id',$version); // keep version, force save of db aweaver_setopt('wvrx_css_saved',''); aweaver_setopt('last_option',ABSOLUTE_WVR_THEMENAME); aweaverplus_clear_opts(); $opts = $restore['aweaverplus']; // fetch plus opts foreach ($opts as $key => $val) { aweaverplus_setopt($key, $val, false); // overwrite with saved values } aweaverplus_update_opts(); aweaver_save_opts('xplus',true); } else { if (substr($contents,0,10) == 'WXT-V01.00'|| substr($contents,0,10) != 'WVA-V01.00') $type = 'theme'; else if (substr($contents,0,10) == 'WXB-V01.00'|| substr($contents,0,10) != 'WVB-V01.00') $type = 'backup'; else { $val = substr($contents,0,10); self::$wvrx_error = __("Wrong theme file format version", 'absolute-weaver' /*adm*/) . ':' . $val; return false; /* simple check for one of ours */ } $restore = array(); $restore = unserialize(substr($contents,10)); if (!$restore) { self::$wvrx_error = __("Unserialize failed", 'absolute-weaver' /*adm*/); return false; } $version = aweaver_getopt('aweaver_version_id'); // get something to force load $new_cache = array(); global $aweaver_opts_cache; if ($type == 'theme') { // need to clear some settings // first, pickup the per-site settings that aren't theme related... foreach ($aweaver_opts_cache as $key => $val) { if (isset($key[0]) && $key[0] == '_') // these are non-theme specific settings $new_cache[$key] = $val; // keep } $opts = $restore['weaverx_base']; // fetch base opts foreach ($opts as $key => $val) { if (isset($key[0]) && $key[0] != '_') $new_cache[$key] = $val; // and add rest from restore } } else if ($type == 'backup') { $opts = $restore['weaverx_base']; // fetch base opts foreach ($opts as $key => $val) { $new_cache[$key] = $val; // overwrite with saved values } } $new_cache['aweaver_version_id'] = $version; $new_cache['wvrx_css_saved'] = ''; $new_cache['last_option'] = ABSOLUTE_WVR_THEMENAME; $new_cache['style_date'] = date('Y-m-d-H:i:s'); $opt_func = ABSOLUTE_WVR_DELETE_OPTION; $opt_func(ABSOLUTE_WVR_SETTINGS_NAME); $opt_func = ABSOLUTE_WVR_UPDATE_OPTION; $opt_func(ABSOLUTE_WVR_SETTINGS_NAME,$new_cache); $aweaver_opts_cache = $new_cache; aweaver_fwrite_current_css( true ); do_action('aweaver_save_mcecss'); // theme support plugin saved editor css in file do_action('aweaver_save_gutenberg_css'); } return true; } static public function enqueue_scripts() { // Register wp_register_style( 'wvrx-css', dirname( __FILE__ ) . 'save-restore.css', array(), ABSOLUTE_WVR_VERSION ); wp_register_script( 'wvrx-js', dirname( __FILE__ ) . 'save-restore.js', array( 'jquery' ), ABSOLUTE_WVR_VERSION, true ); // Localize wp_localize_script( 'wvrx-js', 'WVRXl10n', array( 'emptyImport' => __( 'Please choose a file to import.', 'absolute-weaver' ) )); // Config wp_localize_script( 'wvrx-js', 'WVRXConfig', array( 'customizerURL' => admin_url( 'customize.php?return=%2Fwp-admin%2F' ), 'exportNonce' => wp_create_nonce( 'wvrx-settings-saving' ) )); // Enqueue wp_enqueue_style( 'wvrx-css' ); wp_enqueue_script( 'wvrx-js' ); } static public function controls_print_scripts() { if ( self::$wvrx_error ) { echo ''; } } } endif; if ( class_exists( 'WP_Customize_Control' ) && ! class_exists( 'WeaverA_Load_WA_Subtheme' ) ) : class WeaverA_Load_WA_Subtheme extends WP_Customize_Control { public $description = ''; public $code; static private $wvrx_error = ''; /** */ public function render_content() { echo '' . esc_html( $this->label ) . ''; if ( '' !== $this->description) { echo '' . $this->description . ''; } $theme_dir = trailingslashit(WP_CONTENT_DIR) . 'themes/' . get_template() . '/subthemes/'; $theme_list = array( 'ajax', 'arctic-white', 'black-and-white', 'blank', 'cosmic-latte', 'full-width-dark', 'go-basic-traditional', 'go-basic-full', 'go-basic-stretched', 'go-blue', 'go-green', 'kitchen-sink', 'magazine', 'pioneer', 'plain-full-width', 'transparent-dark', 'transparent-light' ); ?>

Click "Set to Selected Subtheme" to pick new selected subtheme. Selecting a subtheme will reset all existing theme settings. Site settings (♦) will not be changed.

' . "\n"; } else { echo "
\n"; } } wp_nonce_field( 'wvrx_select_subtheme', 'wvrx-upload-subtheme' ); ?>

$val) { if (isset($key[0]) && $key[0] == '_') // these are non-theme specific settings $new_cache[$key] = $val; // keep } $opts = $restore['weaverx_base']; // fetch base opts foreach ($opts as $key => $val) { if (isset($key[0]) && $key[0] != '_') $new_cache[$key] = $val; // and add rest from restore } } else if ($type == 'backup') { $opts = $restore['weaverx_base']; // fetch base opts foreach ($opts as $key => $val) { $new_cache[$key] = $val; // overwrite with saved values } } $new_cache['aweaver_version_id'] = $version; $new_cache['wvrx_css_saved'] = ''; $new_cache['settings_version'] = ABSOLUTE_WVR_SETTINGS_VERSION; $new_cache['last_option'] = ABSOLUTE_WVR_THEMENAME; $new_cache['style_date'] = date('Y-m-d-H:i:s'); $opt_func = ABSOLUTE_WVR_DELETE_OPTION; $opt_func(ABSOLUTE_WVR_SETTINGS_NAME); $opt_func = ABSOLUTE_WVR_UPDATE_OPTION; $opt_func(ABSOLUTE_WVR_SETTINGS_NAME,$new_cache); $aweaver_opts_cache = $new_cache; aweaver_fwrite_current_css( true ); do_action('aweaver_save_mcecss'); // theme support plugin saved editor css in file do_action('aweaver_save_gutenberg_css'); return true; } static public function enqueue_scripts() { // Register wp_register_style( 'wvrx-css', dirname( __FILE__ ) . 'save-restore.css', array(), ABSOLUTE_WVR_VERSION ); wp_register_script( 'wvrx-js', dirname( __FILE__ ) . 'save-restore.js', array( 'jquery' ), ABSOLUTE_WVR_VERSION, true ); // Localize wp_localize_script( 'wvrx-js', 'WVRXl10n', array( 'emptyImport' => __( 'Please choose a file to import.', 'absolute-weaver' ) )); // Config wp_localize_script( 'wvrx-js', 'WVRXConfig', array( 'customizerURL' => admin_url( 'customize.php?return=%2Fwp-admin%2F' ), 'exportNonce' => wp_create_nonce( 'wvrx-settings-saving' ) )); // Enqueue wp_enqueue_style( 'wvrx-css' ); wp_enqueue_script( 'wvrx-js' ); } static public function controls_print_scripts() { if ( self::$wvrx_error ) { echo ''; } } } endif; ?>