firstChild; $style = $div->getAttribute( 'style' ) ? $div->getAttribute( 'style' ) . ';' : ''; $div->setAttribute( 'style', $style . '--wp--style--block-gap:' . $block['attrs']['style']['spacing']['blockGap'] ); $content = $dom->saveHTML(); } return $content; } add_filter( 'render_block', NS . 'render_query_blocks', 10, 2 ); /** * Description of expected behavior. * * @since 0.0.1 * * @param string $content * @param array $block * * @return string */ function render_query_blocks( string $content, array $block ): string { if ( 'core/post-title' === $block['blockName'] ) { if ( is_home() && str_contains( $content, '
' ], [ '' ], $content ); } if ( 'core/post-terms' === $block['blockName'] && isset( $block['attrs']['align'] ) ) { $content = str_replace( [ 'wp-block-post-terms', 'rel="tag"', ], [ 'wp-block-post-terms flex justify-' . $block['attrs']['align'], 'class="wp-block-post-terms__link" rel="tag"', ], $content ); } return $content; }