| Server IP : 64.225.102.56 / Your IP : 216.73.216.220 Web Server : Apache/2.4.68 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2 System : Linux smtp.zejefoy.com 5.15.0-185-generic #195-Ubuntu SMP Fri Jun 19 17:11:50 UTC 2026 x86_64 User : auto ( 1002) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,system,passthru,shell_exec,proc_open,popen MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/auto/web/cifisoa.com/public_html/wp-content/themes/newsever/inc/ |
Upload File : |
<?php
/**
* OCDI support.
*
* @package Newsever
*/
// Disable PT branding.
add_filter( 'pt-ocdi/disable_pt_branding', '__return_true' );
/**
* OCDI after import.
*
* @since 1.0.0
*/
function newsever_ocdi_after_import() {
// Assign front page and posts page (blog page).
$front_page_id = null;
$blog_page_id = null;
$front_page = get_page_by_title( 'Home' );
if ( $front_page ) {
if ( is_array( $front_page ) ) {
$first_page = array_shift( $front_page );
$front_page_id = $first_page->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(
'aft-primary-nav' => 'main-menu-items',
'aft-footer-nav' => 'footer-menu-items',
'aft-social-nav' => 'social-menu-items',
'aft-secondary-nav' => 'secondary-menu-items',
);
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', 'newsever_ocdi_after_import' );