function wpv_admin_menu_import_export_hook()
{
    if (isset($_POST['export']) && $_POST['export'] == __('Export', 'wpv-views') && isset($_POST['wpv-export-nonce']) && wp_verify_nonce($_POST['wpv-export-nonce'], 'wpv-export-nonce')) {
        wpv_admin_export_data();
        die;
    }
    if (isset($_POST['import']) && $_POST['import'] == __('Import', 'wpv-views') && isset($_POST['wpv-import-nonce']) && wp_verify_nonce($_POST['wpv-import-nonce'], 'wpv-import-nonce')) {
        global $import_errors, $import_messages;
        $import_errors = wpv_admin_import_data();
        if ($import_errors) {
            add_action('admin_notices', 'wpv_import_errors');
        }
        if (sizeof($import_messages)) {
            add_action('admin_notices', 'wpv_import_messages');
            global $wpv_theme_import, $wpv_theme_import_xml;
            if (isset($wpv_theme_import) && $wpv_theme_import != '') {
                include $wpv_theme_import;
                update_option('views-embedded-import', $timestamp);
            }
        }
    }
}
/**
* wpv_admin_menu_import_export_hook
*
* Performs the actual export and inport based on $_POST data. Executed on wp_loaded
*
* @since unknown
*/

function wpv_admin_export_on_form_submit() {
    if ( 
		isset( $_POST['export'] ) 
		&& (
			$_POST['export'] == __( 'Export', 'wpv-views' ) 
			|| $_POST['export'] == 'wpv-export'
		)
		&& isset( $_POST['wpv-export-nonce'] ) 
		&& wp_verify_nonce( $_POST['wpv-export-nonce'], 'wpv-export-nonce' ) 
	) {
        wpv_admin_export_data();
        die();
    }
}