wp-includes/blocks/navigation.php:1015Renders the navigation block.
$attributesarray$contentstring$blockWP_Blockstring public static function render( $attributes, $content, $block ) { /** * Deprecated: * The rgbTextColor and rgbBackgroundColor attributes * have been deprecated in favor of * customTextColor and customBackgroundColor ones. * Move the values from old attrs to the new ones. */ if ( isset( $attributes['rgbTextColor'] ) && empty( $attributes['textColor'] ) ) { $attributes['customTextColor'] = $attributes['rgbTextColor']; } if ( isset( $attributes['rgbBackgroundColor'] ) && empty( $attributes['backgroundColor'] ) ) { $attributes['customBackgroundColor'] = $attributes['rgbBackgroundColor']; } unset( $attributes['rgbTextColor'], $attributes['rgbBackgroundColor'] ); $inner_blocks = static::get_inner_blocks( $attributes, $block ); // Prevent navigation blocks referencing themselves from rendering. if ( block_core_navigation_block_tree_has_block_type( $inner_blocks, 'core/navigation' ) ) { return ''; } static::handle_view_script_module_loading( $attributes, $block, $inner_blocks ); // Use div wrapper if this navigation block is within an overlay template part. $is_within_overlay = $attributes['_isWithinOverlayTemplatePart'] ?? false; $tag_name = $is_within_overlay ? 'div' : 'nav'; return sprintf( '<%1$s %2$s>%3$s</%1$s>', $tag_name, static::get_nav_attributes( $attributes, $inner_blocks ), static::get_inner_block_markup( $attributes, $inner_blocks ) ); }Introduced in 6.5.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/blocks/navigation.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.