wordpress/wp-content/themes/basic/themify/customizer/class-themify-customizer.php
/**
		 * Export Customizer Settings to zip file and prompt to download
		 * @since 3.0.2
		 */
Export Customizer Settings to zip file and prompt to download
@since 3.0.2
Export Customizer Settings to zip file and prompt to download @since 3 . 0 . 2
function customizer_export() {
			if (isset($_GET['export']) && 'themify-customizer' === $_GET['export']) {
				check_admin_referer('themify_customizer_export_nonce');
				$theme = wp_get_theme();
				$mods = get_theme_mods();
				$mods['theme'] = strtolower($theme->display('Name'));
				$mods['timestamp'] = dechex(time());
				if (!function_exists('WP_Filesystem')) {
					require_once ABSPATH . 'wp-admin/includes/file.php';
				}
				WP_Filesystem();
				global $wp_filesystem;
				if (class_exists('ZipArchive')) {
					$datafile = 'customizer_export.txt';
					$wp_filesystem->put_contents($datafile, serialize($mods));
					$files_to_zip = array($datafile);
					$file = $mods['theme'] . '_themify_customizer_export_' . date('Y_m_d') . '.zip';
					$result = themify_create_zip($files_to_zip, $file, true);
				}
				if (isset($result) && $result) {
					if (( isset($file) ) && ( $wp_filesystem->exists($file) )) {
						ob_start();
						header('Pragma: public');
						header('Expires: 0');
						header("Content-type: application/force-download");
						header('Content-Disposition: attachment; filename="' . $file . '"');
						header("Content-Transfer-Encoding: Binary");
						header("Content-length: " . filesize($file));
						header('Connection: close');
						ob_clean();
						flush();
						echo $wp_filesystem->get_contents($file);
						$wp_filesystem->delete($datafile);
						$wp_filesystem->delete($file);
						exit();
					} else {
						return false;
					}
				} else {
					if (ini_get('zlib.output_compression')) {
						ini_set('zlib.output_compression', 'Off');
					}
					ob_start();
					header('Content-Type: application/force-download');
					header('Pragma: public');
					header('Expires: 0');
					header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
					header('Cache-Control: private', false);
					header('Content-Disposition: attachment; filename="' . $mods['theme'] . '_themify_customizer_export_' . date("Y_m_d") . '.txt"');
					header('Content-Transfer-Encoding: binary');
					ob_clean();
					flush();
					echo serialize($mods);
					exit();
				}
			}
			return false;
		}
function customizer_export ( ) { if ( isset ( $ _GET [ 'export' ] ) && 'themify-customizer' === $ _GET [ 'export' ] ) { check_admin_referer ( 'themify_customizer_export_nonce' ) ; $ theme = wp_get_theme ( ) ; $ mods = get_theme_mods ( ) ; $ mods [ 'theme' ] = strtolower ( $ theme -> display ( 'Name' ) ) ; $ mods [ 'timestamp' ] = dechex ( time ( ) ) ; if ( ! function_exists ( 'WP_Filesystem' ) ) { require_once ABSPATH . 'wp-admin/includes/file.php' ; } WP_Filesystem ( ) ; global $ wp_filesystem ; if ( class_exists ( 'ZipArchive' ) ) { $ datafile = 'customizer_export.txt' ; $ wp_filesystem -> put_contents ( $ datafile , serialize ( $ mods ) ) ; $ files_to_zip = array ( $ datafile ) ; $ file = $ mods [ 'theme' ] . '_themify_customizer_export_' . date ( 'Y_m_d' ) . '.zip' ; $ result = themify_create_zip ( $ files_to_zip , $ file , true ) ; } if ( isset ( $ result ) && $ result ) { if ( ( isset ( $ file ) ) && ( $ wp_filesystem -> exists ( $ file ) ) ) { ob_start ( ) ; header ( 'Pragma: public' ) ; header ( 'Expires: 0' ) ; header ( " Content-type: application/force-download " ) ; header ( 'Content-Disposition: attachment; filename="' . $ file . '"' ) ; header ( " Content-Transfer-Encoding: Binary " ) ; header ( " Content-length:  " . filesize ( $ file ) ) ; header ( 'Connection: close' ) ; ob_clean ( ) ; flush ( ) ; echo $ wp_filesystem -> get_contents ( $ file ) ; $ wp_filesystem -> delete ( $ datafile ) ; $ wp_filesystem -> delete ( $ file ) ; exit ( ) ; } else { return false ; } } else { if ( ini_get ( 'zlib.output_compression' ) ) { ini_set ( 'zlib.output_compression' , 'Off' ) ; } ob_start ( ) ; header ( 'Content-Type: application/force-download' ) ; header ( 'Pragma: public' ) ; header ( 'Expires: 0' ) ; header ( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' ) ; header ( 'Cache-Control: private' , false ) ; header ( 'Content-Disposition: attachment; filename="' . $ mods [ 'theme' ] . '_themify_customizer_export_' . date ( " Y_m_d " ) . '.txt"' ) ; header ( 'Content-Transfer-Encoding: binary' ) ; ob_clean ( ) ; flush ( ) ; echo serialize ( $ mods ) ; exit ( ) ; } } return false ; }
Export Customizer Settings to zip file and prompt to download
 @since 3.0.2
Export Customizer Settings to zip file and prompt to download @since 3 . 0 . 2