Make WordPress Core

Opened 3 days ago

Last modified 2 days ago

#64272 new defect (bug)

Block visibility: new support key conflicts with Block Visibility plugin

Reported by: dlh's profile dlh Owned by:
Milestone: 6.9 Priority: normal
Severity: normal Version: trunk
Component: Editor Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

The Block Visibility plugin predates the new block hiding functionality in WordPress 6.9, as was discussed early in the new feature's development.

While the current core functionality and the plugin's functionality can complement each other, they conflict in their use of the blockVisibility block support key.

The practical consequence of this conflict that I experienced is that isn't possible to turn off core's block-hiding functionality for a particular block (via register_block_type_args) while also allowing the Block Visibility plugin to apply to that block. The blockVisibility support key will be set to true by the plugin, and so core's UI will be turned back on. As things stand, when 6.9 is released, my sites that use the plugin would begin to see two ways to hide a block that behave differently, and as far as I can tell, I can't prevent it.

It would be disappointing for this conflict to make it into core since it was an avoidable conflict and since it's not too late to fix it. The original Block Visibility plugin has 40,000 installations, which might not be large, but it's also not small. But, if that's what's going to happen, I think it would be respectful to acknowledge it.

Change History (6)

#1 @jorbin
3 days ago

  • Milestone changed from Awaiting Review to 6.9

Moving to 6.9 for visibility. Not sure if this should be reported in https://github.com/WordPress/gutenberg/ instead though cc/ @cbravobernal

Related to: #64061.

#2 @cbravobernal
3 days ago

Thanks for the ping @jorbin . It's indeed an issue. I created an issue on Github so we can discuss a possible solution:

https://github.com/WordPress/gutenberg/issues/73403

#3 @wildworks
2 days ago

#64276 was marked as a duplicate.

This ticket was mentioned in PR #10530 on WordPress/wordpress-develop by @wildworks.


2 days ago
#4

  • Keywords has-patch has-unit-tests added

#5 @wildworks
2 days ago

Unfortunately, the attached patch cannot be tested until the next Gutenberg sync is run.

This is because the old blockVisibility key is still used in block.json, which is updated by the Gutenberg sync.

#6 @palak678
2 days ago

I appreciate you outlining the problem. I tested this locally, and the issue persists.

Many blocks have blockVisibility set to true when the Block Visibility plugin is active. As a result, even if I try to disable the core visibility UI using register_block_type_args, it turns it back on.

This indicates that the plugin's visibility UI and the core visibility UI appear simultaneously. Users will find that confusing, and developers are powerless to stop it.

The plugin is utilized on about 40,000 websites and predates the new core feature. It would be beneficial for site owners and plugin developers to at least acknowledge the conflict in order to get ready for WordPress 6.9.

Kindly see the below image :

https://postimg.cc/gallery/cSfkmvm

Note: See TracTickets for help on using tickets.