-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Rosetta header menu items instead of global #49
Comments
@dd32 , function render_global_header() {
remove_inner_group_container();
if ( isset( $GLOBALS['rosetta'] ) ) {
switch_to_blog( 82 ); // nl.w.org root site
$rendered = wp_nav_menu( array(
'menu' => get_nav_menu_locations()['rosetta_main'],
'echo' => false,
'theme_location' => 'rosetta_main'
) );
var_dump($rendered);
restore_current_blog();
wp_die();
|
FYI, i network-activated the Gutenberg plugin on Rosetta sites to support this. cc @ocean90, @SergeyBiryukov, @dd32 |
This lays the groundwork for swapping out the global items for Rosetta items, depending on the site. See #49
I think this is all done now, except for things that have separate issues opened. |
The new header works on Rosetta sites, but it needs to have the local menu items (
nav_menu_item
posts).Currently Rosetta sites use a homegrown API endpoint, e.g. https://de.wordpress.org/?fetch-custom-header=%2Fplugins%2F.
If we want to take a different approach, then one workaround might be to have a cron job to generate the markup, and cache it in an option on each site. Then the global menu could
switch_to_blog
and retrieve it.That may not even be necessary, though, since the Rosetta sites don't need to use the current homegrown REST API endpoint. It looks like they can just include the new block directly and it works fine. So, they could pull the menu items directly, without the need for a
switch_to_blog
, endpoint, etc.The text was updated successfully, but these errors were encountered: