<?php

/**
 * OCDI after import.
 */
function dark_fitness_after_import_setup() {
	// Assign menus to their locations.
	$dark_fitness_primary_menu = get_term_by( 'name', 'Primary Menu', 'nav_menu' );
	$dark_fitness_social_menu  = get_term_by( 'name', 'Social Menu', 'nav_menu' );

	set_theme_mod(
		'nav_menu_locations',
		array(
			'primary' => $dark_fitness_primary_menu->term_id,
			'social'  => $dark_fitness_social_menu->term_id,
		)
	);

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

	update_option( 'show_on_front', 'page' );
	update_option( 'page_on_front', $dark_fitness_front_page_id->ID );
	update_option( 'page_for_posts', $dark_fitness_blog_page_id->ID );
}
add_action( 'ocdi/after_import', 'dark_fitness_after_import_setup' );