block_core_navigation_get_classic_menu_fallback_blocks example

_deprecated_function( __FUNCTION__, '6.3.0', 'WP_Navigation_Fallback::create_classic_menu_fallback' );

    // See if we have a classic menu.     $classic_nav_menu = block_core_navigation_get_classic_menu_fallback();

    if ( ! $classic_nav_menu ) {
        return;
    }

    // If we have a classic menu then convert it to blocks.     $classic_nav_menu_blocks = block_core_navigation_get_classic_menu_fallback_blocks( $classic_nav_menu );

    if ( empty( $classic_nav_menu_blocks ) ) {
        return;
    }

    // Create a new navigation menu from the classic menu.     $wp_insert_post_result = wp_insert_post(
        array(
            'post_content' => $classic_nav_menu_blocks,
            'post_title'   => $classic_nav_menu->name,
            'post_name'    => $classic_nav_menu->slug,
            
Home | Imprint | This part of the site doesn't use cookies.