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

Disable ability to edit menus via Appearance -> Navigation Menus for non-FSE themes #36257

Merged

Conversation

anton-vlasenko
Copy link
Contributor

@anton-vlasenko anton-vlasenko commented Nov 5, 2021

Description

We must not allow to manage wp_navigation type posts when the current theme doesn's support FSE.
Fixes #36258

How has this been tested?

  1. Enable a non-FSE theme like Twenty Twenty-One.
  2. Check Appearance menu. There must be no Navigation Menu items.
  3. Enable a FSE-capable theme (i've tested with TT1 blocks).
  4. Check Appearance menu. There must be Navigation Menu menu item.

Screenshots

Screenshot 2021-11-05 at 14 52 10
Screenshot 2021-11-05 at 14 52 19

Types of changes

Bug fix

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

@@ -418,7 +418,8 @@ function gutenberg_register_navigation_post_type() {
'description' => __( 'Navigation menus.', 'gutenberg' ),
'public' => false,
'has_archive' => false,
'show_ui' => true,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not sure whether we should disable wp_navigation definition entirely or just the show_ui flag. My PR only disables the show_ui flag.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When in doubt, do the safe thing. show_ui it is for now.

@anton-vlasenko anton-vlasenko added [Block] Navigation Affects the Navigation Block [Type] Bug An existing feature does not function as intended labels Nov 5, 2021
@anton-vlasenko anton-vlasenko merged commit 687e3bb into trunk Nov 5, 2021
@anton-vlasenko anton-vlasenko deleted the fix/hide-navigation-menus-ui-for-non-fse-themes branch November 5, 2021 14:50
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 [Type] Bug An existing feature does not function as intended
Projects
None yet
2 participants