Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#54407 closed defect (bug) (fixed)

Move CSS code that hides visibility and status for wp_navigation type posts from Gutenberg to Core

Reported by: antonvlasenko's profile antonvlasenko Owned by: hellofromtonya's profile hellofromTonya
Milestone: 5.9 Priority: normal
Severity: normal Version: 5.9
Component: Editor Keywords: has-patch has-testing-info commit
Focuses: ui Cc:

Description

The Gutenberg plugin currently contains CSS code that hides visibility and status for wp_navigation type posts. If and when the Gutenberg plugin is merged to Core, we need to move that CSS code from "gutenberg_hide_visibility_and_status_for_navigation_posts" function to the wp-admin/css/edit.css.

Attachments (2)

before-after-pr-1980.jpg (55.2 KB) - added by costdev 3 years ago.
Before and After PR 1980
before-after-pr-1980-2.jpg (100.1 KB) - added by costdev 3 years ago.
Before and After PR 1980 (2)

Download all attachments as: .zip

Change History (19)

#2 @noisysocks
3 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 5.9

The Gutenberg plugin is forced to use CSS to do this but there's no such limitation in Core.

We should fix this by modifying wp-admin/includes/meta-boxes.php. Either by hardcoding a check for wp_navigation, or, ideally, by adding two new hooks which wp-includes/defalt-filters.php uses similarly to _disable_block_editor_for_navigation_post_type.

#3 @hellofromTonya
3 years ago

Hey @antonvlasenko, what's the status of this ticket? Could it be ready for Beta 1?

#4 @antonvlasenko
3 years ago

@hellofromTonya I should be able to create a PR in 30-60 minutes or so.
But I'm not sure if we should add new filters as proposed here.
Most likely, we will disable UI (show_ui option) for wp_navigation posts in the future. These filters will become unused.
cc @noisysocks

Version 0, edited 3 years ago by antonvlasenko (next)

This ticket was mentioned in PR #1980 on WordPress/wordpress-develop by anton-vlasenko.


3 years ago
#5

  • Keywords has-patch added; needs-patch removed

#6 @antonvlasenko
3 years ago

  • Focuses ui added
  • Version set to trunk

Steps to test this PR:

  1. Activate Twenty Twenty-Two theme.
  2. Go to Appearance -> Navigation Menus.
  3. Click Add New button.
  4. Make sure you can't edit visibility and status settings (they should be hidden).

#7 @hellofromTonya
3 years ago

  • Keywords needs-testing has-testing-info added

This ticket was mentioned in Slack in #core-test by hellofromtonya. View the logs.


3 years ago

#9 @costdev
3 years ago

Test Report


Env

  • WordPress 5.9-alpha-51272-src
  • Chrome 96.0.4664.45
  • WSL2
  • Theme: Twenty Twenty Two
  • Gutenberg Editor
  • Plugin: None activated


Steps to test

  1. Activate Twenty Twenty-Two theme.
  2. Go to Appearance -> Navigation Menus.
  3. Click Add New button.
  4. Make sure you can't edit visibility and status settings (they should be hidden).


Results

Before PR 1980: The visibility and status settings are available and can be edited. ❌
After PR 1980: The visibility and status settings are hidden and can't be edited. ✅

Notes

After creating a Navigation Menu and navigating to /edit.php?post_type=wp_navigation, it is possible to edit the Status by clicking Quick Edit.

Pinging @antonvlasenko for an update as this was to be raised as an issue in the GB repo and would be worthwhile to have as part of this PR.

#10 @costdev
3 years ago

  • Keywords reporter-feedback added; needs-testing removed

@costdev
3 years ago

Before and After PR 1980

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


3 years ago

#12 @antonvlasenko
3 years ago

  • Keywords reporter-feedback removed

As we (@costdev and I) agreed, I've committed @costdev's fix.
So https://core.trac.wordpress.org/ticket/54407#comment:9 should be fixed now.

#13 @costdev
3 years ago

Test Report 2


Env

  • WordPress 5.9-alpha-51272-src
  • Chrome 96.0.4664.45
  • WSL2
  • Theme: Twenty Twenty Two
  • Gutenberg Editor
  • Plugin: None activated


Steps to test

  1. Activate Twenty Twenty-Two theme.
  2. Go to Appearance -> Navigation Menus.
  3. Add a new Navigation Menu.
  4. Navigate to Appearance -> Navigation Menus.
  5. Click Quick Edit.
  6. Make sure you can't edit the Status setting.


Results

Before PR 1980: The Status setting is available and can be edited. ❌
After PR 1980: The Status setting is hidden and can't be edited. ✅

@costdev
3 years ago

Before and After PR 1980 (2)

#14 @hellofromTonya
3 years ago

  • Keywords commit added

Marking PR 1980 ready for commit.

#15 @hellofromTonya
3 years ago

  • Owner set to hellofromTonya
  • Resolution set to fixed
  • Status changed from new to closed

In 52293:

Editor: Hide visibility and status settings for wp_navigation post type.

Adds CSS to hide both the visibility and status settings for the wp_navigation post type.

Props antonvlasenko , costdev.
Fixes #54407.

#17 @noisysocks
3 years ago

Most likely, we will disable UI (show_ui option) for wp_navigation posts in the future.

Yes I think we should do this. There's a ticket here: https://github.com/WordPress/gutenberg/issues/36589

Note: See TracTickets for help on using tickets.