#64031 closed enhancement (fixed)
Image Block: Add Block Bindings support for caption attribute
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.9 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | General | Keywords: | has-patch has-unit-tests gutenberg-merge |
| Focuses: | Cc: |
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.
Change History (3)
This ticket was mentioned in PR #9949 on WordPress/wordpress-develop by @Bernhard Reiter.
9 months ago
#1
- Keywords has-patch has-unit-tests added
Supersedes https://github.com/WordPress/wordpress-develop/pull/9702 for reasons stated here.
TODO:
Trac ticket: https://core.trac.wordpress.org/ticket/64031