[17.5] Extensibility bug in the Image block due to interactivity changes #57966
Labels
Backwards Compatibility
Issues or PRs that impact backwards compatability
[Block] Image
Affects the Image Block
[Type] Bug
An existing feature does not function as intended
Description
A user reported that 17.5 breaks the Screen Size control in Block Visibility, so porting this over here.
The Screen Size control adds CSS classes to the block, allowing the user to show or hide the block on the front end. This implementation is a bit unique because classes are not added to the "Additional CSS" field on the block. Instead, these classes are appended on the front end using
render_block
. You can see the code here.I am not sure how many other plugins are using a similar method, but it has worked for the last couple of years without issue.
It's likely that the code in Block Visibility needs a rewrite (it was written before the HTML tag processor was available), but guidance on this would be helpful. I would guess that there may be others who are modifying the Image block with
render_block
, which could be impacted as well.Step-by-step reproduction instructions
Steps to reproduce
Expected Results
Actual Result
The markup for the second image on the front end looks like the following. You can see how the added class breaks the wrapper markup.
Screenshots, screen recording, code snippet
No response
Environment info
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
The text was updated successfully, but these errors were encountered: