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

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

'; echo aweaver_filter_text( __( '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' ) ); ?> aweaver-backup-settings.wxb



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




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

'; echo aweaver_filter_text( __( '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' ) ) . '

'; echo '

'; echo aweaver_filter_text( __( 'Save ALL Settings - Basic Absolute Weaver, including ♦, ☆, and ★.', 'absolute-weaver' ) ); ?>

File: aweaver-settings-( timestamp ).wxall


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

'; echo aweaver_filter_text( __( "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'] ) ) { if ( wp_verify_nonce( $_REQUEST['wvrx_save'], 'wvrx-settings-saving' ) ) // use the wp_verify_nonce to validate the $_REQUEST value { self::_save_settings( $wp_customize, 'wxt' ); } } elseif ( isset( $_REQUEST['wvrx_save_all'] ) ) { if ( wp_verify_nonce( $_REQUEST['wvrx_save_all'], 'wvrx-settings-saving' ) ) // use the wp_verify_nonce to validate the $_REQUEST value { self::_save_settings( $wp_customize, 'wxb' ); } } elseif ( isset( $_REQUEST['wvrx_save_xplus'] ) ) { if ( wp_verify_nonce( $_REQUEST['wvrx_save_xplus'], 'wvrx-settings-saving' ) ) // use the wp_verify_nonce to validate the $_REQUEST value { self::_save_settings( $wp_customize, '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, $ext ) { // Note: a $_REQUEST based nonce has been verified before this funciton called if ( headers_sent() ) { header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) ); wp_die( esc_html__( 'Headers Sent: The headers have been sent by another plugin - there may be a plugin conflict.', 'absolute-weaver' ) ); } 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' => esc_html__( '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 '' . esc_html( $this->description ) . ''; } ?>

'; return; } if ( ! aweaver_f_exists( $openname ) ) { self::$wvrx_error = esc_html__( 'Sorry, there was a problem uploading your file. You may need to check your folder permissions or other server settings.', 'absolute-weaver' ) . esc_html__( 'Trying to use file', 'absolute-weaver' ) . $openname; aweaver_alert( self::$wvrx_error ); 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'; } elseif ( 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 = esc_html__( "Wrong theme file format version", 'absolute-weaver' ) . ':' . $val; aweaver_alert( self::$wvrx_error ); return false; /* simple check for one of ours */ } $restore = array(); $restore = unserialize( substr( $contents, 10 ) ); if ( ! $restore ) { print_r( $contents ); self::$wvrx_error = esc_html__( "Unserialize failed", 'absolute-weaver' ); aweaver_alert( self::$wvrx_error ); 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 } } elseif ( $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' => esc_html__( '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() { $cur_theme = aweaver_getopt( 'theme_filename' ); echo '' . esc_html( $this->label ) . ''; if ( '' !== $this->description ) { echo '' . esc_html( $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 } } elseif ( $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' => esc_html__( '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; ?>