<?php 
add_filter( 'pt-ocdi/disable_pt_branding', '__return_true' );
//add_filter( 'pt-ocdi/regenerate_thumbnails_in_content_import', '__return_false' );

function magazina_import_files() {
  return array(
    array(
      'import_file_name'           => 'Demo Import 1',
      'local_import_file'            => trailingslashit( get_template_directory()).'/demo/import/magazina.xml',
      'local_import_customizer_file' => trailingslashit( get_template_directory()).'/demo/import/magazina.dat',
        'local_import_widget_file'     => trailingslashit( get_template_directory()).'/demo/import/magazina.wie',
        'import_notice'                => __( 'After you import this demo, you will have to setup the slider separately.', 'magazina' ),
    ),
  );
}
add_filter( 'pt-ocdi/import_files', 'magazina_import_files');


//Magazina_Demo::init( apply_filters( 'Magazina_Demo_filter', $config ) );

/**
 * OCDI after import.
 *
 * @since 1.0.0
 */


function magazina_after_import() {

  // Assign menus to their locations.
  $main_menu = get_term_by( 'name', 'Main menu', 'nav_menu' );
  $top_menu = get_term_by( 'name', 'Top Menu', 'nav_menu' );

  set_theme_mod( 'nav_menu_locations', array(
      'primary' => $main_menu->term_id,
      'top-menu' => $top_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( 'Contact Us' );

  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', 'magazina_after_import' );
