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 Visibility Doesn't Work in Customizer #21446

Closed
bobmatyas opened this issue Oct 18, 2021 · 7 comments · Fixed by #21505
Closed

Widget Visibility Doesn't Work in Customizer #21446

bobmatyas opened this issue Oct 18, 2021 · 7 comments · Fixed by #21505
Assignees
Labels
Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". [Feature] Widget Visibility [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Type] Bug When a feature is broken and / or not performing as intended

Comments

@bobmatyas
Copy link
Contributor

Impacted plugin

Jetpack

Steps to Reproduce

  1. Turn on Widget Visibility module in Jetpack
  2. Add widgets with conditions to restrict their visibility
  3. Changes are not reflected in Customizer preview

A clear and concise description of what you expected to happen.

The Customizer view should reflect what shows on the front-end of the site.

What actually happened

At present, widgets show in Customizer regardless of the visibility conditions you setup. By contrast, if you go to the actual site you will see a different view depending on how you have configured the Widget Visibility.

For example, a widget set to display only on the "blog" page will show everwhere in Customizer, while on the frontend it will show only when the criteria is met.

Other information

Possibly related to:

First reported here:

Operating System

macOS

OS Version

No response

Browser

Firefox

Browser Version(s)

v93

@bobmatyas bobmatyas added [Type] Bug When a feature is broken and / or not performing as intended [Feature] Widget Visibility Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". Involves Happiness labels Oct 18, 2021
@github-actions github-actions bot added the [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ label Oct 18, 2021
@jeherve
Copy link
Member

jeherve commented Oct 18, 2021

cc @dsas who worked on that last PR.

@dsas
Copy link
Contributor

dsas commented Oct 21, 2021

Thanks. The filtering code doesn't run on any page where you can edit widgets because I wanted to ensure you can always edit a widget - if you hide it it'll no longer be editable. The issue here is that it doesn't know the difference between the sidebar and the preview area.

I think it should be doable using is_customize_preview but given past experience, it'll be fiddly, especially to make it work with both classic and block based widgets.

I'm afk next week but I am aware of this issue

dsas added a commit that referenced this issue Oct 22, 2021
The customizer screen was not applying saved visibility rules for
widgets in the preview on the right hand side. This change addresses
that by distinguishing between the customizer and the preview using the
`customize_changeset_uuid` GET var.

Note that when widget visibility rules are first added they will not be
respected until the preview is reloaded, e.g. by navigating inside the
preview or by refreshing page.

Addresses #21446
@dsas
Copy link
Contributor

dsas commented Oct 22, 2021

On a related note, on wpcom the preview in the customizer sidebar isn't working for legacy widgets with a visibility rule, it works fine on dotorg.

image

@lakellie
Copy link

Another user report in #4396793-zen

@ParhamG
Copy link

ParhamG commented Nov 4, 2021

We are experiencing the same issue that the visibility settings are ignored in the customizer preview. I see there is already a pending PR to fix this, is there an update on when that will be released?

@jeherve
Copy link
Member

jeherve commented Nov 5, 2021

@ParhamG We're still working on that fix, so I'm afraid we cannot give you an ETA at the moment.

@Gustavo-Hilario
Copy link

This issue also reported here: 4442118-zd-woothemes

dsas added a commit that referenced this issue Nov 12, 2021
The customizer screen was not applying saved visibility rules for
widgets in the preview on the right hand side. This change addresses
that by distinguishing between the customizer and the preview using the
`customize_changeset_uuid` GET var.

Note that when widget visibility rules are first added they will not be
respected until the preview is reloaded, e.g. by navigating inside the
preview or by refreshing page.

Addresses #21446
dsas added a commit that referenced this issue Nov 23, 2021
The customizer screen was not applying saved visibility rules for
widgets in the preview on the right hand side. This change addresses
that by distinguishing between the customizer and the preview using the
`customize_changeset_uuid` GET var.

Note that when widget visibility rules are first added they will not be
respected until the preview is reloaded, e.g. by navigating inside the
preview or by refreshing page.

Addresses #21446
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". [Feature] Widget Visibility [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants