wpseek.com
A WordPress-centric search engine for devs and theme authors
block_core_navigation_maybe_use_classic_menu_fallback is deprecated since version 6.3.0!
Alternative: WP_Navigation_Fallback::create_classic_menu_fallback
Alternative: WP_Navigation_Fallback::create_classic_menu_fallback
block_core_navigation_maybe_use_classic_menu_fallback › WordPress Function
Since6.2.0
Deprecated6.3.0
› block_core_navigation_maybe_use_classic_menu_fallback ( No parameters )
Returns: |
|
Defined at: |
|
Codex: |
If there's a classic menu then use it as a fallback.
Source
function block_core_navigation_maybe_use_classic_menu_fallback() { _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, 'post_status' => 'publish', 'post_type' => 'wp_navigation', ), true // So that we can check whether the result is an error. ); if ( is_wp_error( $wp_insert_post_result ) ) { return; } // Fetch the most recently published navigation which will be the classic one created above. return block_core_navigation_get_most_recently_published_navigation(); }