File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change 88 */
99
1010
11- // The following filters can be removed once the minimum required WordPress version is 6.9 or newer.
11+ // The following filter can be removed once the minimum required WordPress version is 6.9 or newer.
1212add_filter (
13- 'block_bindings_supported_attributes_core/image ' ,
14- function ( $ attributes ) {
15- if ( ! in_array ( 'caption ' , $ attributes , true ) ) {
13+ 'block_bindings_supported_attributes ' ,
14+ function ( $ attributes, $ block_type ) {
15+ if ( ' core/image ' === $ block_type && ! in_array ( 'caption ' , $ attributes , true ) ) {
1616 $ attributes [] = 'caption ' ;
1717 }
18- return $ attributes ;
19- },
20- 10 ,
21- 3
22- );
23-
24- add_filter (
25- 'block_bindings_supported_attributes_core/post-date ' ,
26- function ( $ attributes ) {
27- if ( ! in_array ( 'datetime ' , $ attributes , true ) ) {
18+ if ( 'core/post-date ' === $ block_type && ! in_array ( 'datetime ' , $ attributes , true ) ) {
2819 $ attributes [] = 'datetime ' ;
2920 }
3021 return $ attributes ;
3122 },
3223 10 ,
33- 3
24+ 2
3425);
3526
3627/**
You can’t perform that action at this time.
0 commit comments