#64031 closed enhancement (fixed)
Image Block: Add Block Bindings support for caption attribute
| Reported by: | Bernhard Reiter | Owned by: | Bernhard Reiter |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.9 |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests gutenberg-merge |
| Cc: | Focuses: |
Description
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Supersedes https://github.com/WordPress/wordpress-develop/pull/9702 for reasons stated here.
TODO:
Trac ticket: https://core.trac.wordpress.org/ticket/64031