ID; } else { $front_page_id = $front_page->ID; } } $blog_page = get_page_by_title( 'Blog' ); if ( $blog_page ) { if ( is_array( $blog_page ) ) { $first_page = array_shift( $blog_page ); $blog_page_id = $first_page->ID; } else { $blog_page_id = $blog_page->ID; } } if ( $front_page_id && $blog_page_id ) { update_option( 'show_on_front', 'page' ); update_option( 'page_on_front', $front_page_id ); update_option( 'page_for_posts', $blog_page_id ); } // Assign navigation menu locations. $menu_location_details = array( 'menu-1' => 'main-menu', 'menu-2' => 'footer-menu', ); if ( ! empty( $menu_location_details ) ) { $navigation_settings = array(); $current_navigation_menus = wp_get_nav_menus(); if ( ! empty( $current_navigation_menus ) && ! is_wp_error( $current_navigation_menus ) ) { foreach ( $current_navigation_menus as $menu ) { foreach ( $menu_location_details as $location => $menu_slug ) { if ( $menu->slug === $menu_slug ) { $navigation_settings[ $location ] = $menu->term_id; } } } } set_theme_mod( 'nav_menu_locations', $navigation_settings ); } } add_action( 'pt-ocdi/after_import', 'best_hotel_ocdi_after_import' ); /** * OCDI additional intro text. * * @since 1.0.0 * * @param string $intro Intro text. * @return string Modified text. */ function best_hotel_additional_intro_text( $intro ) { $info = ''; $info .= '
'; $info .= '

' . esc_html__( 'NOTE: ', 'best-hotel' ); $info .= esc_html__( 'Before importing, please make sure that Advanced Booking Calendar plugin is installed and activated. Rooms should be properly setup to display room sections in the front page.', 'best-hotel' ); $info .= '

'; $info .= '
'; return $intro . $info; } add_filter( 'pt-ocdi/plugin_intro_text', 'best_hotel_additional_intro_text' );