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

Widget Blocks in Gutenberg 8.9 are not disabled for Reader themes #5322

Closed
westonruter opened this issue Sep 3, 2020 · 4 comments · Fixed by #5338
Closed

Widget Blocks in Gutenberg 8.9 are not disabled for Reader themes #5322

westonruter opened this issue Sep 3, 2020 · 4 comments · Fixed by #5338
Assignees
Labels
Bug Something isn't working Changelogged Whether the issue/PR has been added to release notes. Integration: WP Core Reader Mode WS:Core Work stream for Plugin core
Milestone

Comments

@westonruter
Copy link
Member

westonruter commented Sep 3, 2020

Bug Description

In Gutenberg 8.9, the the Widget Blocks feature was enabled by default (WordPress/gutenberg#24843, WordPress/gutenberg#24087). The result is that now when a Reader theme is active, a Widget Blocks section appears even though widgets are supposed to be disabled in Reader mode:

image

image

Expected Behaviour

Gutenberg's Widget Blocks functionality should be disabled in Reader themes.

Steps to reproduce

  1. Enable Reader mode and select a Reader theme other than Legacy.
  2. Activate Gutenberg 8.9.0
  3. Open the AMP Customizer.
  4. See the Widget Blocks section.

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • The Widget Blocks section should not be shown in the AMP Customizer.

Implementation brief

  • We should perhaps empty out the $wp_registered_sidebars global in \AmpProject\AmpWP\ReaderThemeLoader::disable_widgets(), though this method may get called to early. We may need a new disable_sidebars() method that run the latest that register_sidebar() and register_sidebars() may be called.

QA testing instructions

Demo

Changelog entry

@westonruter westonruter added Bug Something isn't working Integration: WP Core Reader Mode WS:Core Work stream for Plugin core labels Sep 3, 2020
@westonruter westonruter added this to the v2.0.2 milestone Sep 3, 2020
@westonruter
Copy link
Member Author

Note to make tests pass in #5319, I had to remove_filter( 'customize_loaded_components', 'gutenberg_remove_widgets_panel' ) in a test: 521737d.

@westonruter
Copy link
Member Author

There is also a filter and theme support which may be used. See https://make.wordpress.org/core/2020/09/03/whats-new-in-gutenberg-2-september/

@westonruter westonruter changed the title Widget Blocks in Gutenberg 8.9 are not suppressed for Reader themes Widget Blocks in Gutenberg 8.9 are not disabled for Reader themes Sep 4, 2020
@jwold jwold self-assigned this Sep 17, 2020
@jwold
Copy link
Collaborator

jwold commented Sep 17, 2020

QA passed.

I setup Local with with 8.9 Gutenberg plugin and latest DEV build of AMP.

I'm not seeing the Widget section in Customizer: https://d.pr/i/u3ckqb

@jwold
Copy link
Collaborator

jwold commented Sep 17, 2020

QA passed passed. (Needed to run off the 2.0 branch)

@westonruter westonruter added the Changelogged Whether the issue/PR has been added to release notes. label Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Changelogged Whether the issue/PR has been added to release notes. Integration: WP Core Reader Mode WS:Core Work stream for Plugin core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants