Opened 7 weeks ago
Closed 3 weeks ago
#65389 closed defect (bug) (fixed)
Block Visibility: Keep hide-everywhere working after a block opts out of visibility support
| Reported by: | wildworks | Owned by: | wildworks |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.0.1 |
| Component: | Editor | Version: | |
| Severity: | normal | Keywords: | gutenberg-merge has-patch has-unit-tests dev-feedback |
| Cc: | Focuses: |
Description
- Gutenberg Issue: https://github.com/WordPress/gutenberg/issues/78701
- Gutenberg PR: https://github.com/WordPress/gutenberg/pull/78780
- Block Visibility in WordPress 7.0
The block content is not displayed on the front end when the block supports visibility and metadata.blockVisibility is true.
Previously, the Shortcode block and the HTML block supported visibility. However, this support was removed because it was found that the responsive hiding feature introduced in WordPress 7.1 did not work with these blocks.
As a result, even if these blocks were already hidden in WordPress 6.9, their content would unintentionally be displayed upon updating to WordPress 7.0.
Since this clearly goes against the user's intent, I propose that we do not display the block content on the front end whenever metadata.blockVisibility is true, regardless of whether the visibility block supports.
Change History (6)
This ticket was mentioned in PR #12053 on WordPress/wordpress-develop by @wildworks.
7 weeks ago
#1
- Keywords has-patch has-unit-tests added
#2
@
6 weeks ago
Tested with an existing post containing a Shortcode/HTML block that had metadata.blockVisibility = true set before the visibility support was removed.
After applying the patch, the block remained hidden on the frontend as expected. Without the patch, the content became visible. The fix addresses the backward-compatibility issue described in the ticket.
@masteradhoc commented on PR #12053:
3 weeks ago
#3
Thanks @t-hamano for this PR! This works well for me now applying both the newest GB Version and this core fix.
Waiting for a commiter review to get this into WP 7.0.1
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
## Use of AI Tools
None