<?php
include_once( get_template_directory() . '/libs/ocdi/codestar.php');
function benqu_ocdi_import_files() {
	return array(
		array(
			'import_file_name'             => 'Benqu Main / Magazin And Gaming',
			'categories'                   => array( 'benqu' ),
			'local_import_file'            => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/content.xml',
			'local_import_widget_file'     => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/widgets.wie',
			'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/customizer.dat',
			'local_import_json'           => array(
				array(
					'file_path'   => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/codestar.json',
					'option_name' => 'benqu',
				),
			),
			'import_preview_image_url'     => '',
			'import_notice'                => esc_html__( 'Import process may take 3-10 minutes. If you facing any issues please contact our support.After Import Succesfuly go to Appearance->Menu And Set your Menu', 'benqu' ),
			'preview_url'                  => 'https://itcroctheme.com/wp/demos/themes/benqu/',
		),
		array(
			'import_file_name'             => 'Food',
			'categories'                   => array( 'food' ),
			'local_import_file'            => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/content-food.xml',
			'local_import_widget_file'     => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/widgets-food.wie',
			'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/customizer-food.dat',
			'local_import_json'           => array(
				array(
					'file_path'   => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/codestar-food.json',
					'option_name' => 'benqu',
				),
			),
			'import_preview_image_url'     => 'https://itcroctheme.com/wp/fodd-screens.jpg',
			'import_notice'                => esc_html__( 'Import process may take 3-10 minutes. If you facing any issues please contact our support.After Import Succesfuly go to Appearance->Menu And Set your Menu', 'benqu' ),
			'preview_url'                  => 'https://itcroctheme.com/wp/benqu-wp/food/',
		),
		array(
			'import_file_name'             => 'Newspaper',
			'categories'                   => array( 'Newspaper' ),
			'local_import_file'            => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/news/content-news.xml',
			'local_import_widget_file'     => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/news/widgets-news.wie',
			'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/news/customizer-news.dat',
			'local_import_json'           => array(
				array(
					'file_path'   => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/news/codestar.json',
					'option_name' => 'benqu',
				),
			),
			'import_preview_image_url'     => 'https://itcroctheme.com/wp/newspaper-sc.jpg',
			'import_notice'                => esc_html__( 'Import process may take 3-10 minutes. If you facing any issues please contact our support.After Import Succesfuly go to Appearance->Menu And Set your Menu', 'benqu' ),
			'preview_url'                  => 'https://itcroctheme.com/wp/benqu-wp/newspaper/',
		),
		array(
			'import_file_name'             => 'Mental Health',
			'categories'                   => array( 'Health' ),
			'local_import_file'            => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/helth/content.xml',
			'local_import_widget_file'     => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/helth/widgets.wie',
			'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/helth/customizer.dat',
			'local_import_json'           => array(
				array(
					'file_path'   => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/helth/codestar.json',
					'option_name' => 'benqu',
				),
			),
			'import_preview_image_url'     => 'https://itcroctheme.com/wp/benqu-wp/mental.jpg',
			'import_notice'                => esc_html__( 'Import process may take 3-10 minutes. If you facing any issues please contact our support.After Import Succesfuly go to Appearance->Menu And Set your Menu', 'benqu' ),
			'preview_url'                  => 'https://itcroctheme.com/wp/benqu-wp/mental-health/',
		),
		array(
			'import_file_name'             => 'Illustration',
			'categories'                   => array( 'benqu' ),
			'local_import_file'            => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/illustration/content.xml',
			'local_import_widget_file'     => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/illustration/widgets.wie',
			'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/illustration/customizer.dat',
			'local_import_json'           => array(
				array(
					'file_path'   => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/illustration/codestar.json',
					'option_name' => 'benqu',
				),
			),
			'import_preview_image_url'     => 'https://itcroctheme.com/wp/benqu-wp/illustrations-.jpg',
			'import_notice'                => esc_html__( 'Import process may take 3-10 minutes. If you facing any issues please contact our support.After Import Succesfuly go to Appearance->Menu And Set your Menu', 'benqu' ),
			'preview_url'                  => 'https://itcroctheme.com/wp/benqu-wp/illustration/',
		),
		array(
			'import_file_name'             => 'Photography',
			'categories'                   => array( 'benqu' ),
			'local_import_file'            => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/photography/content.xml',
			'local_import_widget_file'     => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/photography/widgets.wie',
			'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/photography/customizer.dat',
			'local_import_json'           => array(
				array(
					'file_path'   => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/photography/codestar.json',
					'option_name' => 'benqu',
				),
			),
			'import_preview_image_url'     => 'https://itcroctheme.com/wp/benqu-wp/photography.jpg',
			'import_notice'                => esc_html__( 'Import process may take 3-10 minutes. If you facing any issues please contact our support.After Import Succesfuly go to Appearance->Menu And Set your Menu', 'benqu' ),
			'preview_url'                  => 'https://itcroctheme.com/wp/benqu-wp/photography/',
		),
		array(
			'import_file_name'             => 'Pet Blog',
			'categories'                   => array( 'benqu' ),
			'local_import_file'            => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/pet-blog/content.xml',
			'local_import_widget_file'     => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/pet-blog/widgets.wie',
			'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/pet-blog/customizer.dat',
			'local_import_json'           => array(
				array(
					'file_path'   => trailingslashit( get_template_directory() ) . 'libs/ocdi/demo/pet-blog/codestar.json',
					'option_name' => 'benqu',
				),
			),
			'import_preview_image_url'     => 'https://itcroctheme.com/wp/demo/assets/images/preview/pet-blog.jpg',
			'import_notice'                => esc_html__( 'Import process may take 3-10 minutes. If you facing any issues please contact our support.After Import Succesfuly go to Appearance->Menu And Set your Menu', 'benqu' ),
			'preview_url'                  => 'https://itcroctheme.com/wp/benqu-wp/pet-blog/',
		),
	);
}
add_filter( 'pt-ocdi/import_files', 'benqu_ocdi_import_files' );

function benqu_ocdi_after_import( $selected_import ) {
	// Assign benqu menus to their locations where will be display.
    $primary  = get_term_by( 'name', 'Main Menu', 'nav_menu' );

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

    // benqu Assign front page and posts page Set
    $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', 'benqu_ocdi_after_import' );

function benqu_ocdi_before_content_import() {
    add_filter( 'wp_import_post_data_processed', 'benqu_ocdi_wp_import_post_data_processed', 99, 2 );
}
add_action( 'pt-ocdi/before_content_import', 'benqu_ocdi_before_content_import', 99 );

function benqu_ocdi_wp_import_post_data_processed( $postdata, $data ) {
    return wp_slash( $postdata );
}

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