Skip to content
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

Navigation: Streamline preloading requests #51803

Closed
scruffian opened this issue Jun 22, 2023 · 0 comments · Fixed by #52115
Closed

Navigation: Streamline preloading requests #51803

scruffian opened this issue Jun 22, 2023 · 0 comments · Fixed by #52115
Assignees
Labels
[Block] Navigation Affects the Navigation Block

Comments

@scruffian
Copy link
Contributor

What problem does this address?

We preload two different URLs for navigation, but they are almost identical: https://github.com/WordPress/gutenberg/blob/trunk/lib/compat/wordpress-6.3/navigation-block-preloading.php#L31

We should find a way to streamline this so that we only need to load one.

The difference between the two is the __locale parameter. This is necessary because in the sidebar we load navigation menus using useEntityRecords, but in the block we use getEntityRecords. We should probably switch to using useEntityRecords in both places.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block
Projects
Development

Successfully merging a pull request may close this issue.

1 participant