Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/wp-includes/blocks/navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ private static function get_inner_blocks_html( $attributes, $inner_blocks ) {
* @since 6.5.0
*
* @param array $attributes The block attributes.
* @return WP_Block_List Returns the inner blocks for the navigation block.
* @return ?WP_Block_List Returns the inner blocks for the navigation block.
*/
private static function get_inner_blocks_from_navigation_post( $attributes ) {
$navigation_post = get_post( $attributes['ref'] );
Expand All @@ -251,6 +251,9 @@ private static function get_inner_blocks_from_navigation_post( $attributes ) {
// context which could be refined.
return new WP_Block_List( $blocks, $attributes );
}

// Return null if there are no valid posts.
return null;
}

/**
Expand Down Expand Up @@ -1269,7 +1272,7 @@ function block_core_navigation_parse_blocks_from_menu_items( $menu_items, $menu_
*
* @deprecated 6.3.0 Use WP_Navigation_Fallback::get_classic_menu_fallback() instead.
*
* @return object WP_Term The classic navigation.
* @return ?\WP_Term The classic navigation.
*/
function block_core_navigation_get_classic_menu_fallback() {

Expand Down Expand Up @@ -1306,6 +1309,8 @@ static function ( $a, $b ) {
);
return $classic_nav_menus[0];
}

return null;
}

/**
Expand Down
Loading