';
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
'; 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
'; 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 ) . ''; } ?>
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.
$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; ?>