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: Hide post attributes meta box #36358

Merged
merged 2 commits into from
Nov 10, 2021

Conversation

Mamaduka
Copy link
Member

@Mamaduka Mamaduka commented Nov 9, 2021

Description

Disables "Post Attributes" for wp_navigation post type.

The attributes are also conditionally enabled when a site has custom templates. Block Theme templates can be available for every post type.

You can find the condition here: https://github.com/WordPress/wordpress-develop/blob/f22abe76100ed3647392e5b58a926e7e081d7736/src/wp-admin/includes/meta-boxes.php#L1504-L1506

Fixes #36308

How has this been tested?

  1. Go to Appearance > Navigation Menus
  2. The "Post Attributes" metabox shouldn't be visible.

Screenshots

CleanShot 2021-11-09 at 22 12 28

Types of changes

Bugfix

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).

@Mamaduka Mamaduka self-assigned this Nov 9, 2021
@Mamaduka Mamaduka added [Block] Navigation Affects the Navigation Block [Type] Bug An existing feature does not function as intended labels Nov 9, 2021
@Mamaduka Mamaduka requested review from talldan and carolinan November 9, 2021 18:18
@ramonjd
Copy link
Member

ramonjd commented Nov 10, 2021

I was just trying to test this and couldn't replicate the issue on trunk (or on this branch).

Tried TT1 Blocks, TwentyTwentyTwo on WordPress Version 5.8.1 and 5.9 alpha following the test instructions over at #36308.

I created a new navigation menu in both the site and post editor, then edited the menu from Appearance > Navigation Menus.

Screen Shot 2021-11-10 at 11 22 05 am

Could be just me! Am I missing something? Thanks!

@Mamaduka
Copy link
Member Author

Thanks for testing, @ramonjd.

Sorry, I forgot to mention that you'll need to create a custom template(s). It is when the second condition for this meta box goes into effect.

@Mamaduka Mamaduka force-pushed the fix/nav-disable-post-attributes branch from f358d62 to c6b2ee3 Compare November 10, 2021 04:34
@Mamaduka Mamaduka added the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Nov 10, 2021
Copy link
Member

@ramonjd ramonjd left a comment

Choose a reason for hiding this comment

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

Thanks @Mamaduka

The attributes are also conditionally enabled when a site has custom templates.

I probably should have read the comments more closely before diving in 🤦‍♀️

Before
Screen Shot 2021-11-10 at 7 58 01 pm

After
Screen Shot 2021-11-10 at 8 00 41 pm

LGTM!

@Mamaduka
Copy link
Member Author

Thank you, @ramonjd.

@Mamaduka Mamaduka merged commit 5d547f4 into trunk Nov 10, 2021
@Mamaduka Mamaduka deleted the fix/nav-disable-post-attributes branch November 10, 2021 09:28
@github-actions github-actions bot added this to the Gutenberg 12.0 milestone Nov 10, 2021
@ramonjd
Copy link
Member

ramonjd commented Nov 10, 2021

cc @andrewserong in case this needs to be cherry-picked in 11.9 since it's on the 5.9 must-have list. 🙇

@andrewserong andrewserong mentioned this pull request Nov 10, 2021
28 tasks
andrewserong pushed a commit that referenced this pull request Nov 10, 2021
* Navigation: Hide post attributes metabox
* Update comment
@andrewserong
Copy link
Contributor

Cherry picked into the Gutenberg 11.9 release in: cd3ce67

@noisysocks noisysocks removed the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Nov 11, 2021
noisysocks pushed a commit that referenced this pull request Nov 11, 2021
* Navigation: Hide post attributes metabox
* Update comment
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
Development

Successfully merging this pull request may close these issues.

Appearance > Navigation menus > Edit shows template post attributes
4 participants