Filtering the Navigation Block
First I was about to suggest you’d try replacing the render_callback of the core/navigation block. The custom rendering callback would have returned a class extending the WP_Navigation_Block_Renderer class. E.g. add_filter( ‘block_type_metadata_settings’, ‘wpse_426956_replace_core_nav_block_renderer’, 10, 2 ); function wpse_426956_replace_core_nav_block_renderer( array $settings, array $metadata ): array { if ( ‘core/navigation’ === $metadata[‘name’] ) { $settings[‘render_callback’] = ‘wpse_426956_my_core_nav_block_renderer’; } … Read more