<?php
/**
 * Register the demo content available for import.
 *
 */

function ocdi_import_files() {
	return array(
		array(
			'import_file_name'						 	=> 'Default Demo Import',
			// 'categories'									 => array( 'Category 1', 'Category 2' ),
			'local_import_file'							=> trailingslashit( get_template_directory() ) . 'demo/default-demo-content.xml',
			'local_import_customizer_file' 	=> trailingslashit( get_template_directory() ) . 'demo/default-demo-customizer.dat',
			'local_import_widget_file'		 	=> trailingslashit( get_template_directory() ) . 'demo/default-demo-widgets.json',
			'import_preview_image_url'		 	=> esc_url( 'https://organicthemes.com/images/startup-demos/default-demo-img.png' ),
			'import_notice'									=> __( 'After importing the content, navigate to Appearance > Customizer to continue setting up your theme.', 'organic-startup' ),
			'preview_url'										=> esc_url( 'https://organicthemes.com/demo/startup/' ),
		),
		array(
			'import_file_name'						 	=> 'More Coming Soon',
			// 'categories'									 => array( 'Category 1', 'Category 2' ),
			// 'local_import_file'							=> trailingslashit( get_template_directory() ) . 'demo/default-demo-content.xml',
			// 'local_import_widget_file'		 	=> trailingslashit( get_template_directory() ) . 'demo/default-demo-widgets.json',
			// 'local_import_customizer_file' 	=> trailingslashit( get_template_directory() ) . 'demo/default-demo-customizer.dat',
			'import_preview_image_url'		 	=> esc_url( 'https://organicthemes.com/images/startup-demos/more-demo-img.png' ),
			// 'import_notice'									=> __( 'Howdy, after you import this demo, you will have to setup the slider separately.', 'organic-startup' ),
			// 'preview_url'										=> esc_url( 'https://organicthemes.com/demo/startup/' ),
		),
	);
}
add_filter( 'pt-ocdi/import_files', 'ocdi_import_files' );

// Setup home page template as front page.
function ocdi_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(
			'main-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-ocdi/after_import', 'ocdi_after_import_setup' );

// Disable Branding.
add_filter( 'pt-ocdi/disable_pt_branding', '__return_true' );
