| 1 |
<?php |
| 2 |
/** |
| 3 |
* Fix columns core spacing. |
| 4 |
* @see https://github.com/WordPress/gutenberg/issues/45277 |
| 5 |
* |
| 6 |
* @package twentig |
| 7 |
*/ |
| 8 |
|
| 9 |
defined( 'ABSPATH' ) || exit; |
| 10 |
|
| 11 |
function twentig_fix_columns_default_gap( $metadata ) { |
| 12 |
if ( isset( $metadata['name'] ) && $metadata['name'] === 'core/columns' ) { |
| 13 |
if ( isset( $metadata['supports']['spacing']['blockGap'] ) && is_array( $metadata['supports']['spacing']['blockGap'] ) ) { |
| 14 |
$metadata['supports']['spacing']['blockGap']['__experimentalDefault'] = 'var(--wp--style--columns-gap-default,2em)'; |
| 15 |
} |
| 16 |
} |
| 17 |
return $metadata; |
| 18 |
} |
| 19 |
add_filter( 'block_type_metadata', 'twentig_fix_columns_default_gap' ); |
| 20 |
|