Image block uses esc_attr()
wrongly, passing an array
#54930
Labels
[Block] Image
Affects the Image Block
[Feature] Interactivity API
API to add frontend interactivity to blocks.
[Type] Bug
An existing feature does not function as intended
Description
Introduced in #3851 / badc344, this causes PHP warnings when using the Image block with Lightbox enabled.
Why?
The
block_core_image_render_lightbox()
function passes the results ofwp_get_global_styles()
directly toesc_attr()
.wp_get_global_styles()
can return an array, butesc_attr()
works on strings.Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
WP trunk
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: