[wp-trac] [WordPress Trac] #64031: Image Block: Add Block Bindings support for caption attribute

WordPress Trac noreply at wordpress.org
Tue Sep 23 14:16:41 UTC 2025


#64031: Image Block: Add Block Bindings support for caption attribute
-----------------------------+----------------------
 Reporter:  Bernhard Reiter  |      Owner:  (none)
     Type:  enhancement      |     Status:  assigned
 Priority:  normal           |  Milestone:  6.9
Component:  General          |    Version:
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+----------------------
 The Image block's `caption` attribute is a bit different from attributes
 previosuly supported by Block Bindings in that if it is present, a
 `<figcaption>` HTML element is saved as part of the HTML markup (which
 isn't there if the attribute is empty).

 This behavior should be mimicked as closely as possible when the attribute
 is bound to a Block Bindings source instead. This can be partly done by
 including the `<figcaption>` in the saved HTML if the attribute is bound,
 and to have the `<figcaption>` element's inner HTML replaced by the value
 provided by the Block Bindings source upon render.

 If the Block Bindings source returns an empty value for the `caption`, we
 might want to remove the `<figcaption>` element before rendering.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64031>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list