Skip to content

Commit 4d94de2

Browse files
committed
Block Bindings: Support Image block caption attribute
1 parent 077c0f4 commit 4d94de2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/compat/wordpress-6.9/block-bindings.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@
77
* @subpackage Block Bindings
88
*/
99

10+
// The following filter can be removed once the minimum required WordPress version is 6.9 or newer.
11+
add_filter(
12+
'block_bindings_supported_attributes_core/image',
13+
function ( $attributes ) {
14+
if ( ! in_array( 'caption', $attributes, true ) ) {
15+
$attributes[] = 'caption';
16+
}
17+
return $attributes;
18+
},
19+
10,
20+
3
21+
);
22+
1023
/**
1124
* Callback function for the render_block filter.
1225
*

0 commit comments

Comments
 (0)