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

Hide visilibility and status for navigation posts #36363

Merged

Conversation

anton-vlasenko
Copy link
Contributor

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

Description

Visiblity and status fields are not appropriate for navigation posts.
We should hide them.
Fixes #36309.

How has this been tested?

  1. Enable a theme that supports full-site-editing (tested with tt1 blocks theme).
  2. Go to Appearance -> Navigation Menus. Create a new menu.
  3. Make sure you don't see visibility, status, published on and revisions options.
  4. Try to edit your newly created navigation menu.
  5. Make sure you don't see visibility, status, published on and revisions options.
  6. Make sure you are able to edit visibility, status, published on and revisions for non-navigation posts.

Types of changes

Bug fix

Screenshots:
Screenshot 2021-11-09 at 23 53 36
Screenshot 2021-11-09 at 23 53 15

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

@anton-vlasenko anton-vlasenko force-pushed the fix/hide-visibility-and-status-for-navigation-posts branch from c5590c6 to 161f6c9 Compare November 9, 2021 22:57
@anton-vlasenko anton-vlasenko self-assigned this Nov 9, 2021
@anton-vlasenko anton-vlasenko added [Type] Bug An existing feature does not function as intended [Block] Navigation Affects the Navigation Block labels Nov 9, 2021
@anton-vlasenko
Copy link
Contributor Author

anton-vlasenko commented Nov 9, 2021

I've tried to implement this using filters or actions, but it doesn't seem to be possible.

@anton-vlasenko
Copy link
Contributor Author

anton-vlasenko commented Nov 9, 2021

Trac ticket for merging this PR into Core: https://core.trac.wordpress.org/ticket/54407

@anton-vlasenko anton-vlasenko force-pushed the fix/hide-visibility-and-status-for-navigation-posts branch from 161f6c9 to 6b5436e Compare November 10, 2021 07:00
@anton-vlasenko anton-vlasenko self-assigned this Nov 10, 2021
Copy link
Contributor

@getdave getdave left a comment

Choose a reason for hiding this comment

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

Followed test steps and I wasn't able to see the status settings.

Screen Shot 2021-11-10 at 12 20 08

Screen Shot 2021-11-10 at 12 20 35

Bug

🐞 One bug - I was still able to see the status via the "Quick Edit" link on the Post Listing screen. We should fix that in a followup.

Screen Shot 2021-11-10 at 12 19 51

Additional explorations

Whilst the UI isn't modify-able via a hook, I wonder if it's worth exploring a way to block the ability to modify a Nav Menu Post's status at a PHP level when the post is being updated. That way programmatic updates will also be blocked.

@anton-vlasenko
Copy link
Contributor Author

Thank you for the review, @getdave! I appreciate it.

@anton-vlasenko
Copy link
Contributor Author

I will create a followup issue sometime today.

@anton-vlasenko anton-vlasenko merged commit 4cea909 into trunk Nov 11, 2021
@anton-vlasenko anton-vlasenko deleted the fix/hide-visibility-and-status-for-navigation-posts branch November 11, 2021 13:05
@github-actions github-actions bot added this to the Gutenberg 12.0 milestone Nov 11, 2021
@Mamaduka
Copy link
Member

@anton-vlasenko Should we backport this issue into WP 5.9 beta?

@getdave getdave 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 11, 2021
@anton-vlasenko
Copy link
Contributor Author

@Mamaduka Yes, I think we should.

@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 15, 2021
noisysocks pushed a commit that referenced this pull request Nov 15, 2021
* Hide visilibility and status for navigation posts.
These fields are not appropriate for navigation posts.

* Hide visibility and status for new posts too.
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: Visibility and publishing states
5 participants