Skip to content

Block Visibility attribute conflicts with Block Visibility plugin. #73403

@cbravobernal

Description

@cbravobernal

Description

Reported by @dlh01 in https://core.trac.wordpress.org/ticket/64272

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.

Ping @t-hamano as the main developer for the feature.

Step-by-step reproduction instructions

  1. Install block visibility plugin. Apply visibility to any block.
  2. Check that enables core UI for all blocks.
  3. Both visibility rules are slightly different.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

Labels

Needs DecisionNeeds a decision to be actionable or relevant[Feature] Block APIAPI that allows to express the block paradigm.[Priority] HighUsed to indicate top priority items that need quick attention[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions