This post is mainly to provide feedback to the FSE-Outreach team and document a specific workflow issue. If you have thoughts on how you’d solve this, please please please let me know!
I’m having an issue with our Site Editor workflow for Headers / Navigation and I want to make sure I’m understanding this correctly. Here’s a list of assumptions based on my experience, but nothing would make me happier than being wrong somewhere here:
The core navigation block does not support “classic” menus at all- other than handling a one-time conversion to the new wp_navigation
post type. You cannot use the core Navigation block and still be controlling the menu through the classic Menus interface.
The navigation block does not support traditional menu locations (ex. Primary, Secondary, Footer). Once you pull a menu into the navigation block it will be converted and the menu location is not saved/applied in any meaningful way.
The Navigation block creates a new post in the wp_navigation
post type, which stores the menu items. This sort of replaces the old WP_Term that was used. So the navigation block needs to store a post_id
of a specific wp_navigation
post as an attribute (ref
).
Essentially this means that a theme can’t have a header.html
template part that gets continuous updates, especially when sending those updates to multiple sites, because it would then overwrite the unique post_id
of the menu on that specific site. (In classic themes, your header.php
would reference a menu “location” which was a more site-agnostic way to keep a reference to a specific menu without relying on site-specific unique IDs).
Similarly, I can’t programmatically create menus using the classic wp_nav_menu function at all because I still need the block editor to run it’s conversion process and set the post_id
in the header template part (which I believe is only possible as a manual action in the editor itself).
Does this make sense or am I missing functionality here? Essentially a theme can’t version control any template parts that use the navigation block without the site instance needed to override it with customizations?
Right now our proposed solution is to remove the core navigation block and write a custom block, but I’d love to know if there’s another solution.
Leave a Reply