How to modify wordpress gutenberg output for columns & column?

Question

I’m using bulma.css in my WP project. I want to change html output for columns & column block. I rewrite css rules for columns and it’s working good. The problem is with column element and witch modifications like is-6 etc. So I want to simplify it. Is there any way to change standard wp-block-column class to column class? I found similar problem and code but it’s not working as it should. It creates new div called column and wp-block-column inside which I don’t want. So is there any way to do it? I can make it with JS but I can be overkill for the website.

add_filter( 'render_block', 'wrap_my_image_block', 10, 2 );
function wrap_my_image_block( $block_content, $block ) {
if ( 'core/column' !== $block['blockName'] ) {
    return $block_content;
}
$return  = '<div class="column">';
$return .= $block_content;
$return .= '</div>';

return $return;
}
0
MMPL1 4 months 0 Answers 15 views 0

Leave an answer