<?php
// **********************************************************************// 
// ! One Click Demo Content Import
// **********************************************************************// 
function apparatus_oneclick_import_files() {
  return array(
    array(
      'import_file_name'             => 'App Demo One',
      'categories'                   => array( 'App' ),
      'local_import_file'            => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo1/demo-content.xml',
      'local_import_widget_file'     => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo1/widgets.wie',
      'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo1/customizer.dat',
	  'local_import_redux'         => array(
		array(
			'file_path'    => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo1/theme-options.json',
			'option_name' => 'theme_option_data',
		),
		),	  
      'import_preview_image_url'     => esc_url( get_template_directory_uri() ).'/images/preview/1.jpg',
      'import_notice'                => '',
      'preview_url'                  => 'https://fluentthemes.com/wp/appeasy/app-demo-one',
    ),
	array(
      'import_file_name'             => 'Software Demo One',
      'categories'                   => array( 'Software' ),
      'local_import_file'            => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo2/demo-content.xml',
      'local_import_widget_file'     => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo2/widgets.wie',
      'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo2/customizer.dat',
	  'local_import_redux'         => array(
		array(
			'file_path'    => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo2/theme-options.json',
			'option_name' => 'theme_option_data',
		),
		),	  
      'import_preview_image_url'     => esc_url( get_template_directory_uri() ).'/images/preview/11.jpg',
      'import_notice'                => '',
      'preview_url'                  => 'https://fluentthemes.com/wp/appeasy/software-demo-one',
    ),
	array(
      'import_file_name'             => 'App Demo Two',
      'categories'                   => array( 'App' ),
      'local_import_file'            => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo3/demo-content.xml',
      'local_import_widget_file'     => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo3/widgets.wie',
      'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo3/customizer.dat',
	  'local_import_redux'         => array(
		array(
			'file_path'    => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo3/theme-options.json',
			'option_name' => 'theme_option_data',
		),
		),	  
      'import_preview_image_url'     => esc_url( get_template_directory_uri() ).'/images/preview/2.jpg',
      'import_notice'                => '',
      'preview_url'                  => 'https://fluentthemes.com/wp/appeasy/app-demo-two',
    ),
	array(
      'import_file_name'             => 'Software Demo Two',
      'categories'                   => array( 'Software' ),
      'local_import_file'            => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo4/demo-content.xml',
      'local_import_widget_file'     => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo4/widgets.wie',
      'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo4/customizer.dat',
	  'local_import_redux'         => array(
		array(
			'file_path'    => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo4/theme-options.json',
			'option_name' => 'theme_option_data',
		),
		),	  
      'import_preview_image_url'     => esc_url( get_template_directory_uri() ).'/images/preview/22.jpg',
      'import_notice'                => '',
      'preview_url'                  => 'https://fluentthemes.com/wp/appeasy/software-demo-two',
    ),
	array(
      'import_file_name'             => 'App Demo Three',
      'categories'                   => array( 'App' ),
      'local_import_file'            => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo5/demo-content.xml',
      'local_import_widget_file'     => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo5/widgets.wie',
      'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo5/customizer.dat',
	  'local_import_redux'         => array(
		array(
			'file_path'    => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo5/theme-options.json',
			'option_name' => 'theme_option_data',
		),
		),	  
      'import_preview_image_url'     => esc_url( get_template_directory_uri() ).'/images/preview/3.jpg',
      'import_notice'                => '',
      'preview_url'                  => 'https://fluentthemes.com/wp/appeasy/app-demo-three',
    ),
	array(
      'import_file_name'             => 'Software Demo Three',
      'categories'                   => array( 'Software' ),
      'local_import_file'            => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo6/demo-content.xml',
      'local_import_widget_file'     => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo6/widgets.wie',
      'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo6/customizer.dat',
	  'local_import_redux'         => array(
		array(
			'file_path'    => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo6/theme-options.json',
			'option_name' => 'theme_option_data',
		),
		),	  
      'import_preview_image_url'     => esc_url( get_template_directory_uri() ).'/images/preview/33.jpg',
      'import_notice'                => '',
      'preview_url'                  => 'https://fluentthemes.com/wp/appeasy/software-demo-three',
    ),
	array(
      'import_file_name'             => 'App Demo Four',
      'categories'                   => array( 'App' ),
      'local_import_file'            => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo7/demo-content.xml',
      'local_import_widget_file'     => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo7/widgets.wie',
      'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo7/customizer.dat',
	  'local_import_redux'         => array(
		array(
			'file_path'    => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo7/theme-options.json',
			'option_name' => 'theme_option_data',
		),
		),	  
      'import_preview_image_url'     => esc_url( get_template_directory_uri() ).'/images/preview/4.jpg',
      'import_notice'                => '',
      'preview_url'                  => 'https://fluentthemes.com/wp/appeasy/app-demo-four',
    ),
	array(
      'import_file_name'             => 'Software Demo Four',
      'categories'                   => array( 'Software' ),
      'local_import_file'            => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo8/demo-content.xml',
      'local_import_widget_file'     => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo8/widgets.wie',
      'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo8/customizer.dat',
	  'local_import_redux'         => array(
		array(
			'file_path'    => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo8/theme-options.json',
			'option_name' => 'theme_option_data',
		),
		),	  
      'import_preview_image_url'     => esc_url( get_template_directory_uri() ).'/images/preview/44.jpg',
      'import_notice'                => '',
      'preview_url'                  => 'https://fluentthemes.com/wp/appeasy/software-demo-four',
    ),
	array(
      'import_file_name'             => 'App Demo Five',
      'categories'                   => array( 'App' ),
      'local_import_file'            => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo9/demo-content.xml',
      'local_import_widget_file'     => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo9/widgets.wie',
      'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo9/customizer.dat',
	  'local_import_redux'         => array(
		array(
			'file_path'    => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo9/theme-options.json',
			'option_name' => 'theme_option_data',
		),
		),	  
      'import_preview_image_url'     => esc_url( get_template_directory_uri() ).'/images/preview/5.jpg',
      'import_notice'                => '',
      'preview_url'                  => 'https://fluentthemes.com/wp/appeasy/app-demo-five',
    ),
	array(
      'import_file_name'             => 'Software Demo Five',
      'categories'                   => array( 'Software' ),
      'local_import_file'            => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo10/demo-content.xml',
      'local_import_widget_file'     => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo10/widgets.wie',
      'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo10/customizer.dat',
	  'local_import_redux'         => array(
		array(
			'file_path'    => trailingslashit( get_template_directory() ) . 'framework/demo-content/demo10/theme-options.json',
			'option_name' => 'theme_option_data',
		),
		),	  
      'import_preview_image_url'     => esc_url( get_template_directory_uri() ).'/images/preview/55.jpg',
      'import_notice'                => '',
      'preview_url'                  => 'https://fluentthemes.com/wp/appeasy/software-demo-five',
    ),
  );
}
add_filter( 'pt-ocdc/import_files', 'apparatus_oneclick_import_files' );

function apparatus_oneclick_after_import_setup() {
    // Assign menus to their locations.
    $main_menu = get_term_by( 'name', 'Main Menu', 'nav_menu' );

    set_theme_mod( 'nav_menu_locations', array(
            'apparatus_primary_menu' => $main_menu->term_id
        )
    );

    // Assign front page and posts page (blog page).
    $front_page_id = get_page_by_title( 'Home' );
    $blog_page_id  = get_page_by_title( 'Blog' );

    update_option( 'show_on_front', 'page' );
    update_option( 'page_on_front', $front_page_id->ID );
    update_option( 'page_for_posts', $blog_page_id->ID );

}
add_action( 'pt-ocdc/after_import', 'apparatus_oneclick_after_import_setup' );